mors.stellarevo
stellarevo
Module for loading the stellar evolution tracks and retrieving basic stellar properties.
FWL_DATA_DIR = Path(os.environ.get('FWL_DATA', platformdirs.user_data_dir('fwl_data')))
module-attribute
ModelDataDefault = None
module-attribute
evoModelsDefault = 'X0p70952_Z0p01631_A1p875'
module-attribute
nDecValue = 7
module-attribute
starEvoDirDefault = str(FWL_DATA_DIR / 'stellar_evolution_tracks' / 'Spada' / 'fs255_grid')
module-attribute
StarEvo(starEvoDir=starEvoDirDefault, evoModels=evoModelsDefault)
Class to hold complete information about stellar evolution models.
An instance of this class will hold evolutionary tracks for all masses and all quantities of interest. For now, only models from Spada et al. (2013) can be loaded. The main set of information held in this class is in ModelData, which is a dictionary of dictionaries. Each dictionary in this dictionary corresponds to a single stellar mass and holds evolutionary tracks for a bunch of important quantities.
Attributes:
| Name | Type | Description |
|---|---|---|
ModelData |
dict
|
This is a dictionary of dictionaries, holding evolution tracks for each stellar mass. |
Source code in src/mors/stellarevo.py
44 45 46 47 48 49 50 51 52 53 54 55 56 | |
Icore(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns core moment of interia.
Source code in src/mors/stellarevo.py
131 132 133 | |
Ienv(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns envelope moment of interia.
Source code in src/mors/stellarevo.py
135 136 137 | |
Itotal(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns total moment of interia.
Source code in src/mors/stellarevo.py
127 128 129 | |
Lbol(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns bolometric luminosity.
Source code in src/mors/stellarevo.py
119 120 121 | |
LoadTrack(Mstar, ClearData=False)
Takes stellar mass, loads evolutionary track for a specific mass into the model data.
This can be useful if the user wants to load a specific evolutionary track into a model data for a specific mass since this will make getting values for this mass faster since no interpolation between mass bins will be needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Mstar
|
float
|
Mass of star in Msun. |
required |
ClearData
|
bool
|
If set to True, all other stellar masses will be removed from the ModelData dictionary. |
False
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Source code in src/mors/stellarevo.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
Mcore(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns core mass.
Source code in src/mors/stellarevo.py
139 140 141 | |
Menv(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns envelope mass.
Source code in src/mors/stellarevo.py
143 144 145 | |
Rcore(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns core radius.
Source code in src/mors/stellarevo.py
147 148 149 | |
Rstar(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns stellar radius.
Source code in src/mors/stellarevo.py
115 116 117 | |
Teff(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns effective temperature.
Source code in src/mors/stellarevo.py
123 124 125 | |
Value(Mstar, Age, ParamString)
Takes stellar mass, age, and a parameter string, returns values corresponding to named parameter.
The set of models should have already been loaded. With this function, the user can ask for a value of one of the parameters for a specific stellar mass and age. All three of these can be input as multiple values and an array of values will be returned if this is the case. For example, if Mstar is input as a 1D array, the function will return a 1D array giving the value for each of these masses. ParamString can be input as a list of strings and values for each parameter in that list will be returned in a 1D array. If two are given as arrays or lists, then a 2D array will be returned. If all three then a 3D array with dimensions len(Mstar)xlen(Age)xlen(ParamString) will be returned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Mstar
|
float or int or ndarray
|
Mass of star in Msun. |
required |
Age
|
float or int or ndarray
|
Age in Myr. |
required |
ParamString
|
str
|
String holding name of parameter to get value for. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
value |
float or ndarray
|
Value of parameter at this mass and age. |
Source code in src/mors/stellarevo.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
dIcoredt(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns rate of change of core moment of inertia.
Source code in src/mors/stellarevo.py
159 160 161 | |
dIenvdt(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns rate of change of envelope moment of inertia.
Source code in src/mors/stellarevo.py
163 164 165 | |
dItotaldt(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns rate of change of total moment of inertia.
Source code in src/mors/stellarevo.py
155 156 157 | |
dMcoredt(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns rate of change of core mass.
Source code in src/mors/stellarevo.py
167 168 169 | |
dRcoredt(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns rate of change of core radius.
Source code in src/mors/stellarevo.py
171 172 173 | |
tauConv(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns convective turnover time.
Source code in src/mors/stellarevo.py
151 152 153 | |
Icore(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns core moment of interia.
Source code in src/mors/stellarevo.py
799 800 801 | |
Ienv(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns envelope moment of interia.
Source code in src/mors/stellarevo.py
803 804 805 | |
Itotal(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns total moment of interia.
Source code in src/mors/stellarevo.py
795 796 797 | |
Lbol(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns bolometric luminosity.
Source code in src/mors/stellarevo.py
787 788 789 | |
LoadTrack(Mstar, ModelData=None, ClearData=False)
Source code in src/mors/stellarevo.py
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 | |
Mcore(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns core mass.
Source code in src/mors/stellarevo.py
807 808 809 | |
Menv(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns envelope mass.
Source code in src/mors/stellarevo.py
811 812 813 | |
Rcore(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns core radius.
Source code in src/mors/stellarevo.py
815 816 817 | |
Rstar(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns stellar radius.
Source code in src/mors/stellarevo.py
783 784 785 | |
Teff(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns effective temperature.
Source code in src/mors/stellarevo.py
791 792 793 | |
Value(MstarIn, AgeIn, ParamString, ModelData=ModelDataDefault)
Takes stellar mass, age, and a parameter string, returns values corresponding to named parameter.
The set of models should have already been loaded. With this function, the user can ask for a value of one of the parameters for a specific stellar mass and age. All three of these can be input as multiple values and an array of values will be returned if this is the case. For example, if MstarIn is input as a 1D array, the function will return a 1D array giving the value for each of these masses. ParamString can be input as a list of strings and values for each parameter in that list will be returned in a 1D array. If two are given as arrays or lists, then a 2D array will be returned. If all three then a 3D array with dimensions len(MstarIn)xlen(AgeIn)xlen(ParamString) will be returned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
MstarIn
|
float or int or ndarray
|
Mass of star in Msun. |
required |
AgeIn
|
float or int or ndarray
|
Age in Myr. |
required |
ParamString
|
str
|
String holding name of parameter to get value for. |
required |
ModelData
|
dict
|
Dictionary of dictionaries holding set of stellar evolution models. |
ModelDataDefault
|
Returns:
| Name | Type | Description |
|---|---|---|
value |
float or ndarray
|
Value of parameter at this mass and age. |
Source code in src/mors/stellarevo.py
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 | |
_CalculateGradient(Age, X)
Takes an evolutionary track for quantity, returns evolution of rate of change of quantity.
Source code in src/mors/stellarevo.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | |
_CheckAgeLimit(AgeArray, Age)
Takes age track and an age, outputs error and stops code if age is not within limits.
Source code in src/mors/stellarevo.py
723 724 725 726 727 728 729 730 731 732 733 | |
_CheckMassLimit(MstarArray, Mstar)
Takes array of masses and an age, outputs error and stops code if mass is not within limits.
Source code in src/mors/stellarevo.py
735 736 737 738 739 740 741 | |
_CompileNewGrid(starEvoDir, evoModels)
Compiles new dictionary of stellar evo models.
Source code in src/mors/stellarevo.py
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 | |
_Interpolate1D(Xarray, Yarray, X)
Takes 1D arrays for corresponding X and Y values, returns interpolated Y value corresponding to input X.
Source code in src/mors/stellarevo.py
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 | |
_Interpolate2D(Z1, Z2, Z, Xarray1, Xarray2, X, Yarray1, Yarray2)
Takes two sets of 1D arrays for corresponding X and Y values, returns interpolated Y value corresponding to input X.
Source code in src/mors/stellarevo.py
743 744 745 746 747 748 749 750 751 752 753 754 | |
_LoadDefaultModelData()
Source code in src/mors/stellarevo.py
549 550 551 552 553 554 555 556 557 558 559 | |
_LoadModels(starEvoDir=starEvoDirDefault, evoModels=evoModelsDefault)
Loads evolutionary tracks as a grid of parameters at each mass and age.
Source code in src/mors/stellarevo.py
175 176 177 178 179 180 181 182 183 184 | |
_LoadSavedGrid(starEvoDir, evoModels)
Takes filename for stellar evo model, returns grid of models.
Source code in src/mors/stellarevo.py
410 411 412 413 414 415 416 417 | |
_LoadTrack(Mstar, ModelData)
Takes stellar mass and model data dictionary, returns dictionary with track for this mass.
Source code in src/mors/stellarevo.py
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
_ReadEvolutionTrack(starEvoDir, evoModels, Mstar, MstarFilenameMiddle)
Loads the stellar evolution models from Spada et al. (2013) for a mass bin and puts it into a dictionary.
Source code in src/mors/stellarevo.py
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 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 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | |
_RemoveDuplicateAges(nHeader, content)
Takes lines from evo file, removes duplicate ages.
Source code in src/mors/stellarevo.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | |
_ValueSingle(Mstar, Age, ParamString, ModelData=ModelDataDefault)
Takes stellar mass and age and parameter string, returns value of that parameter at that mass and age.
Source code in src/mors/stellarevo.py
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 | |
_shouldCompileNew(starEvoDir, evoModels)
Takes directory for stellar evo models, returns if new grid needs to be compiled.
Source code in src/mors/stellarevo.py
186 187 188 189 190 191 192 193 194 195 196 | |
dIcoredt(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns rate of change of core moment of inertia.
Source code in src/mors/stellarevo.py
827 828 829 | |
dIenvdt(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns rate of change of envelope moment of inertia.
Source code in src/mors/stellarevo.py
831 832 833 | |
dItotaldt(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns rate of change of total moment of inertia.
Source code in src/mors/stellarevo.py
823 824 825 | |
dMcoredt(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns rate of change of core mass.
Source code in src/mors/stellarevo.py
835 836 837 | |
dRcoredt(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns rate of change of core radius.
Source code in src/mors/stellarevo.py
839 840 841 | |
tauConv(Mstar, Age, ModelData=ModelDataDefault)
Takes mass and age, returns convective turnover time.
Source code in src/mors/stellarevo.py
819 820 821 | |