mors.miscellaneous
miscellaneous
Module for holding miscellaneous functions that can be used by many other modules.
ActivityLifetime(Age=None, Track=None, Threshold=None, AgeMax=None)
Takes evolutionary track for parameter, calculates when value drops below threshold.
This function can be used to determine when a star's emission crosses a given threshold value for a few activity quantities. These are Lx, Fx, Rx, and FxHZ for X-rays, and similar values for EUV1, EUV2, EUV, XUV, and Ly-alpha. If the star crosses the threshold (from above it to below it) multiple times, this will find the final time it will cross the threshold. If the user wants to set a maximum age so that the code only looks for crossings of the threshold below this age then this can be done using the AgeMax keyword argument. If the track is always below this threshold value then the function returns 0.0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Age
|
ndarray
|
Age array for evolutionary track. |
None
|
Track
|
ndarray
|
Value array for evolutionary track. |
None
|
Threshold
|
float
|
Value for threshold in units of quantity. |
None
|
AgeMax
|
float
|
End age of track to consider in Myr. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
AgeActive |
float
|
Activity lifetime in Myr. |
Source code in src/mors/miscellaneous.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
IntegrateEmission(AgeMin=None, AgeMax=None, Age=None, Luminosity=None, aOrb=None)
Takes evolutionary track for parameter, calculates when value drops below threshold.
This code can be used to integrate a star's luminosity between two ages. This can be applied to Lx, Leuv, or any other luminosity and the result is a total energy emitted in this time in erg. If the user also specifies an orbital distance using the aOrb keyword argument, the code integrates the flux at this obital distance returns a fluence in erg cm^-2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
AgeMin
|
float
|
Start of time period to integrate in Myr. |
None
|
AgeMax
|
float
|
End of time period to integrate in Myr. |
None
|
Age
|
ndarray
|
Age array for evolutionary track. |
None
|
Luminosity
|
ndarray
|
Value array for evolutionary track. |
None
|
aOrb
|
float
|
Orbital distance to get fluence at in AU. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Energy |
float
|
Integrated luminosity of flux in erg or erg cm^-2. |
Source code in src/mors/miscellaneous.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
Load(filename)
Takes filename of saved star or cluster and loads object.
Source code in src/mors/miscellaneous.py
56 57 58 59 60 61 62 63 64 65 66 | |
ModelCluster()
Reads the model cluster used in Johnstone et al. (2020).
Source code in src/mors/miscellaneous.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
_GetPackageDirectory()
Gets path to main directory where the code is installed.
Source code in src/mors/miscellaneous.py
15 16 17 18 | |
_convertFloatArray(Xin)
Takes a value and returns either as float or numpy.ndarray of floats.
Source code in src/mors/miscellaneous.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
_getIndexGT(Xarray, X)
Takes array of values and a value, returns index of closest element in array larger than value.
Source code in src/mors/miscellaneous.py
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | |
_getIndexLT(Xarray, X)
Takes array of values and a value, returns index of closest element in array smaller than value.
Source code in src/mors/miscellaneous.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
_getIndexLTordered(Xarray, X)
Takes min to max ordered array of values and a value, returns index of closest element in array smaller than value.
Source code in src/mors/miscellaneous.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | |