simple.ccsne
simple.ccsne
z_names
module-attribute
z_names = ['Neut', 'H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar', 'K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', 'Rb', 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'I', 'Xe', 'Cs', 'Ba', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'At', 'Rn', 'Fr', 'Ra', 'Ac', 'Th', 'Pa', 'U']
CCSNe
CCSNe(collection, name, **hdf5_attrs)
Bases: ModelTemplate
Model specifically for CCSNe yields and their mass coordinates.
Attributes:
-
type
(str
) –The type of data stored in the model. Required at initialisation
-
citation
(str
) –A citation for the data. Required at initialisation
-
mass
–The initial mass of the CCSNe modelled. Required at initialisation
-
masscoord
–The mass coordinates of the yields. Required at initialisation
-
abundance
–A key array containing the isotope yields. Is created upon model initiation from the
-
abundance_values
–A 2dim array containing the isotope yields. Required at initialisation
-
abundance_keys
–The isotope key for each column in
abundance_values
. Required at initialisation -
abundance_unit
–Unit for the yields. Should typically be either
mol
ormass
for molar and mass fractions respectively. Required at initialisation -
refid_isoabu
(str
) –Name of the reference model containing the reference isotope abundances used for normalisations. Required at initialisation
-
refid_isomass
(str
) –Name of the reference model containing the reference isotope masses used for normalisations. Required at initialisation
Source code in simple/models.py
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 |
|
REQUIRED_ATTRS
class-attribute
instance-attribute
REQUIRED_ATTRS = ['type', 'dataset', 'citation', 'mass', 'masscoord', 'abundance_values', 'abundance_keys', 'abundance_unit', 'refid_isoabu', 'refid_isomass']
REPR_ATTRS
class-attribute
instance-attribute
REPR_ATTRS = ['name', 'type', 'dataset', 'mass']
ABUNDANCE_KEYARRAY
class-attribute
instance-attribute
ABUNDANCE_KEYARRAY = 'abundance'
masscoord_label
class-attribute
instance-attribute
masscoord_label = 'Mass Coordinate [solar masses]'
masscoord_label_latex
class-attribute
instance-attribute
masscoord_label_latex = 'Mass Coordinate [M${}_{\\odot}$]'
get_mask
get_mask(mask, shape=None, **mask_attrs)
Returns a selection mask for an array with shape
.
This function is used by plotting functions to plot only a sub selction of the data. The mask string
can an integer representing an index, a slice or a condition that generates a mask. Use &
or |
to combine multiple indexes and/or conditions.
Supplied attributes can be accesed by putting a dot infront of the name, e.g. .data > 1
. The available
operators for mask conditions are ==
, !=
, >
, >=
, <
, <=
.
The result of the mask evaluation must be broadcastable with shape
. If it is not an all False
mask is
returned.
Masks for the different onion layers are included as attributes.
Note
- It is not possible to mix &
and |
seperators. Doing so will raise an exception.
- Any text not precceded by a dot will be evaluated as text. Text on its own will always be evaluated
as False
.
- An empty string will be evaluated as True
Parameters:
-
mask
–String or object that will be evaluated to create a mask.
-
shape
–Shape of the returned mask. If omitted the shape of the default abundance array is used.
-
**mask_attrs
–Attributes to be used during the evaluation.
Examples:
>>> a = np.array([0,1,2,3,4])
>>> model.get_mask('3', a.shape)
array([False, False, False, True, False])
>>> model.get_mask('1:3', a.shape)
array([False, True, True, False, False])
>>> model.get_mask('.data >= 1 & .data < 3', a.shape, data=a)
array([False, True, True, False, False])
>>> model.get_mask('.data >= 1 | .data > 3', a.shape, data=a)
rray([True, True, False, False, True])
Returns:
-
–
A boolean numpy array with
shape
.
Source code in simple/ccsne.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 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 |
|
calc_default_onion_structure
calc_default_onion_structure(abundance, keys, masscoord)
Calculated the boundaries of different layers within the CCSNe onion structure.
Note This function is calibrated for the initial set of CCSNe models and might not be applicable to other models.
The returned array contains the index of the lower bound of the given layer. If a layer is not found the index is given as np.nan.
Source code in simple/ccsne.py
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 55 56 57 58 59 60 61 62 63 64 65 66 67 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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
load_Ri18
load_Ri18(fol2mod, ref_isoabu, ref_isomass)
Source code in simple/ccsne.py
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 252 253 254 255 256 257 258 259 260 261 |
|
load_Pi16
load_Pi16(fol2mod, ref_isoabu, ref_isomass)
Source code in simple/ccsne.py
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 |
|
load_La22
load_La22(data_dir, ref_isoabu, ref_isomass)
Source code in simple/ccsne.py
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 354 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 |
|
load_Si18
load_Si18(data_dir, ref_isoabu, ref_isomass, decayed=False)
Source code in simple/ccsne.py
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 |
|
load_Ra02
load_Ra02(data_dir, ref_isoabu, ref_isomass)
Source code in simple/ccsne.py
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 |
|
load_LC18
load_LC18(data_dir, ref_isoabu, ref_isomass)
Source code in simple/ccsne.py
481 482 483 484 485 486 487 488 489 490 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 |
|
get_onion_layer_mask
get_onion_layer_mask(model, layer)
Source code in simple/ccsne.py
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 |
|
plot_onion_structure
plot_onion_structure(model, *, ax=None, update_ax=True, update_fig=True, **kwargs)
Source code in simple/ccsne.py
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 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 |
|
plot_ccsne
plot_ccsne(models, ykey, *, semilog=False, onion=None, **kwargs)
Plot for CCSNe models. Plots the mass coordinates on the x-axis.
Source code in simple/ccsne.py
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 722 723 724 725 726 727 |
|
mhist_ccsne
mhist_ccsne(models, xkey, ykey, r=None, weights=1, **kwargs)
Histogram plot on a rose diagram for CCNSe models.
Source code in simple/ccsne.py
746 747 748 749 750 751 752 753 754 755 756 757 758 |
|
mcontour_ccsne
mcontour_ccsne(models, xkey, ykey, r=None, weights=1, **kwargs)
Contour plot on a rose diagram for CCNSe models.
Source code in simple/ccsne.py
760 761 762 763 764 765 766 767 768 769 770 771 772 |
|
plot_abundance
plot_abundance(*args, **kwargs)
Source code in simple/ccsne.py
777 778 779 |
|
plot_intnorm
plot_intnorm(*args, **kwargs)
Source code in simple/ccsne.py
781 782 783 |
|
plot_simplenorm
plot_simplenorm(*args, **kwargs)
Source code in simple/ccsne.py
785 786 787 |
|
show_root_heading: true
show_root_members_full_path: false
show_root_toc_entry: true
show_category_heading: true
show_symbol_type_toc: false
show_bases: true