Target Material Module
Import the target material utilites from spyral_utils.nuclear.target
Module containing AT-TPC representation of target materials and their associated energy loss calculations.
Target materials can be defined as either the corresponding CAtima name or a compound array.
Classes should never be directly instantiated, rather use the load_target function to do the work for you.
Classes:
Name | Description |
---|---|
GasTarget |
AT-TPC representation of a gas target |
SolidTarget |
AT-TPC representation of a solid target |
GasMixtureTarget |
AT-TPC representation of a gas mixture target |
Functions:
Name | Description |
---|---|
load_target |
Load a target from JSON. This is what should be used to load a target. |
save_target |
Save a targe to JSON. This is what should be used to save a target. |
GasMixtureTarget
Source code in src/spyral_utils/nuclear/target.py
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 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 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 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 694 695 696 697 698 699 700 701 702 703 |
|
__init__(components, volume_fractions, pressure, nuclear_map)
An AT-TPC gas mixutre target
Gas mixture target for which energy loss can be calculated using pycatima. Can perform several types of energy loss calculations (straggling, dEdx, energy lost, etc.)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
components
|
list[list[tuple[int, int, int]]]
|
A list specifiying compound elements in the target compound as (Z, A, S) |
required |
volume_fractions
|
list[float]
|
A list of mixture fractions by volume (in same order as components) |
required |
pressure
|
float
|
The gas pressure in Torr |
required |
nuclear_data
|
The nucleus data |
required |
Attributes:
Name | Type | Description |
---|---|---|
components |
list[list[tuple[int, int, int]]]
|
A list specifiying compound elements in the target compound as (Z, A, S) |
volume_fractions |
list[float]
|
A list of mixture fractions by volume (in same order as components) |
pressure |
float
|
The gas pressure in Torr |
ugly_string |
str
|
A string representation without rich formatting |
pretty_string |
str
|
A string representation with rich formatting |
material |
Material
|
The catima representation of the target |
density |
float
|
The target density in g/cm^3 |
Functions:
Name | Description |
---|---|
get_dedx |
get the stopping power (dEdx) for a projectile in this target |
get_angular_straggling |
get the angular straggling for a projectile in this target |
get_energy_loss |
get the energy loss values for a projectile travelling distances through the target |
Source code in src/spyral_utils/nuclear/target.py
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 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 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
|
get_angular_straggling(projectile_data, projectile_energy)
Calculate the angular straggling for a projectile
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
Returns:
Type | Description |
---|---|
float
|
angular straggling in radians |
Source code in src/spyral_utils/nuclear/target.py
614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 |
|
get_dedx(projectile_data, projectile_energy)
Calculate the stopping power of the target for a projectile
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
Returns:
Type | Description |
---|---|
float
|
dEdx in MeV/g/cm^2 |
Source code in src/spyral_utils/nuclear/target.py
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 |
|
get_energy_loss(projectile_data, projectile_energy, distances)
Calculate the energy loss of a projectile traveling over a set of distances
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
distances
|
ndarray
|
a set of distances in meters over which to calculate the energy loss |
required |
Returns:
Type | Description |
---|---|
ndarray
|
set of energy losses |
Source code in src/spyral_utils/nuclear/target.py
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 |
|
get_number_density()
Get the number density of gas molecules
Returns:
Type | Description |
---|---|
Number density of gas molecules in molecules/cm^3
|
|
Source code in src/spyral_utils/nuclear/target.py
696 697 698 699 700 701 702 703 |
|
get_range(projectile_data, projectile_energy)
Calculate the range of a projectile in the target
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
Returns:
Type | Description |
---|---|
float
|
The range in m |
Source code in src/spyral_utils/nuclear/target.py
671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 |
|
GasTarget
An AT-TPC gas target
Gas target for which energy loss can be calculated using pycatima. Can perform several types of energy loss calculations (straggling, dEdx, energy lost, etc.)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
compound
|
list[tuple[int, int, int]]
|
A list specifiying elements in the target compound as (Z, A, S) |
required |
pressure
|
float
|
The gas pressure in Torr |
required |
nuclear_data
|
NuclearDataMap
|
The nucleus data |
required |
Attributes:
Name | Type | Description |
---|---|---|
compound |
list[tuple[int, int, int]]
|
A list specifiying elements in the target compound as (Z, A, S) |
pressure |
float
|
The gas pressure in Torr |
ugly_string |
str
|
A string representation without rich formatting |
pretty_string |
str
|
A string representation with rich formatting |
material |
Material
|
The catima representation of the target |
density |
float
|
The target density in g/cm^3 |
Methods:
Name | Description |
---|---|
get_dedx |
get the stopping power (dEdx) for a projectile in this target |
get_angular_straggling |
get the angular straggling for a projectile in this target |
get_energy_loss |
get the energy loss values for a projectile travelling distances through the target |
Source code in src/spyral_utils/nuclear/target.py
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 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 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 221 222 223 224 225 226 227 228 |
|
get_angular_straggling(projectile_data, projectile_energy)
Calculate the angular straggling for a projectile
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
Returns:
Type | Description |
---|---|
float
|
angular straggling in radians |
Source code in src/spyral_utils/nuclear/target.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
get_dedx(projectile_data, projectile_energy)
Calculate the stopping power of the target for a projectile
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
Returns:
Type | Description |
---|---|
float
|
dEdx in MeV/g/cm^2 |
Source code in src/spyral_utils/nuclear/target.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
get_energy_loss(projectile_data, projectile_energy, distances)
Calculate the energy loss of a projectile traveling over a set of distances
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
distances
|
ndarray
|
a set of distances in meters over which to calculate the energy loss |
required |
Returns:
Type | Description |
---|---|
ndarray
|
set of energy losses |
Source code in src/spyral_utils/nuclear/target.py
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 |
|
get_number_density()
Get the number density of gas molecules
Returns:
Type | Description |
---|---|
Number density of gas molecules in molecules/cm^3
|
|
Source code in src/spyral_utils/nuclear/target.py
221 222 223 224 225 226 227 228 |
|
get_range(projectile_data, projectile_energy)
Calculate the range of a projectile in the target
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
Returns:
Type | Description |
---|---|
float
|
The range in m |
Source code in src/spyral_utils/nuclear/target.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
|
SolidTarget
An AT-TPC solid target
Solid target for which energy loss can be calculated using pycatima. Can perform several types of energy loss calculations (straggling, dEdx, energy lost, etc.)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
compound
|
list[tuple[int, int, int]]
|
A list specifiying elements in the target compound as (Z, A, S) |
required |
thickness
|
float
|
The target thickness in ug/cm^2 |
required |
nuclear_data
|
NuclearDataMap
|
The nucleus data |
required |
Attributes:
Name | Type | Description |
---|---|---|
compound |
list[tuple[int, int, int]]
|
A list specifiying elements in the target compound as (Z, A, S) |
thickness |
float
|
The target thickness in ug/cm^2 |
ugly_string |
str
|
A string representation without rich formatting |
pretty_string |
str
|
A string representation with rich formatting |
material |
Material
|
The catima representation of the target |
Methods:
Name | Description |
---|---|
get_dedx |
get the stopping power (dEdx) for a projectile in this target |
get_angular_straggling |
get the angular straggling for a projectile in this target |
get_energy_loss |
get the energy loss values for a projectile travelling at angles through the target |
Source code in src/spyral_utils/nuclear/target.py
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 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 383 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 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
|
get_angular_straggling(projectile_data, projectile_energy)
Calculate the angular straggling for a projectile
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
Returns:
Type | Description |
---|---|
float
|
angular straggling in radians |
Source code in src/spyral_utils/nuclear/target.py
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
|
get_dedx(projectile_data, projectile_energy)
Calculate the stopping power of the target for a projectile
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
Returns:
Type | Description |
---|---|
float
|
dEdx in MeV/g/cm^2 |
Source code in src/spyral_utils/nuclear/target.py
351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
get_energy_loss(projectile_data, projectile_energy, incident_angles)
Calculate the energy loss of a projectile traveling through the solid target for a given set of incident angles
Assumes travelling through the entire target at an incident angle.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
incident_angles
|
ndarray
|
a set of incident angles, describing the angle between the particle trajectory and the normal of the target surface |
required |
Returns:
Type | Description |
---|---|
ndarray
|
set of energy losses |
Source code in src/spyral_utils/nuclear/target.py
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 |
|
get_range(projectile_data, projectile_energy)
Calculate the range of a projectile in the target in g/cm^2
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projectile_data
|
NucleusData
|
the projectile type |
required |
projectile_energy
|
float
|
the projectile kinetic energy in MeV |
required |
Returns:
Type | Description |
---|---|
float
|
The range in g/cm^2 |
Source code in src/spyral_utils/nuclear/target.py
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
|
deserialize_gas_target_data(target_path, nuclear_map)
Deserialize gas target data from a JSON file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_path
|
Path
|
Path to JSON file containing gas target data |
required |
Returns:
Type | Description |
---|---|
GasTarget | None
|
If the data loaded successfully, returns a GasTarget. Otherwise returns None. |
Source code in src/spyral_utils/nuclear/target.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
deserialize_mixture_data(path, nuclear_map)
Deserialize gas mixture target data from a JSON file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
Path
|
Path to JSON file containing target data |
required |
Returns:
Type | Description |
---|---|
GasMixtureTarget | None
|
If the data loaded successfully, returns a GasMixtureTarget. Otherwise returns None. |
Source code in src/spyral_utils/nuclear/target.py
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 |
|
deserialize_solid_target_data(target_path, nuclear_map)
Deserialize solid target data from a JSON file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_path
|
Path
|
Path to JSON file containing target data |
required |
Returns:
Type | Description |
---|---|
SolidTarget | None
|
If the data loaded successfully, returns a SolidTarget. Otherwise returns None. |
Source code in src/spyral_utils/nuclear/target.py
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 |
|
load_target(target_path, nuclear_map)
Load a target from a JSON file
Read the JSON data, and construct the appropriate target type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_path
|
Path
|
Path to JSON data |
required |
nuclear_map
|
NuclearDataMap
|
Nucleus mass data |
required |
Returns:
Type | Description |
---|---|
GasTarget | SolidTarget | GasMixtureTarget
|
Return a GasTarget, GasMixtureTarget, or SolidTarget where appropriate. Raises a TargetError on failure. |
Source code in src/spyral_utils/nuclear/target.py
759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 |
|
save_target(target_path, target)
Write a target to a JSON file
Create the JSON data, and write to disk.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_path
|
Path
|
Path to JSON data file |
required |
target
|
GasTarget | SolidTarget | GasMixtureTarget
|
Target to be written |
required |
Source code in src/spyral_utils/nuclear/target.py
791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 |
|
serialize_gas_target_data(target_path, data)
Serialize gas target data to JSON file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_path
|
Path
|
Path to JSON file to write target data |
required |
data
|
GasTarget
|
data to be written |
required |
Source code in src/spyral_utils/nuclear/target.py
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
|
serialize_mixture_data(target_path, data)
Serialize gas mixture target data to JSON file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_path
|
Path
|
Path to JSON file to write target data |
required |
data
|
GasMixtureTarget
|
data to be written |
required |
Source code in src/spyral_utils/nuclear/target.py
737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 |
|
serialize_solid_target_data(target_path, data)
Serialize solid target data to JSON file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_path
|
Path
|
Path to JSON file to write target data |
required |
data
|
SolidTarget
|
data to be written |
required |
Source code in src/spyral_utils/nuclear/target.py
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 |
|