File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1523,6 +1523,31 @@ def registration_element_masses_in_stars(
1523
1523
return
1524
1524
1525
1525
1526
+ def registration_snia_rates (
1527
+ field_path : str , unit_system : VelociraptorUnits
1528
+ ) -> (unyt .Unit , str , str ):
1529
+ """
1530
+ Registers the SNIa rates within apertures
1531
+ """
1532
+
1533
+ unit = unit_system .velocity / unit_system .length
1534
+ # Capture aperture size
1535
+ match_string = "Aperture_SNIaRates_aperture_total_star_([0-9]*)_kpc"
1536
+ regex = cached_regex (match_string )
1537
+
1538
+ match = regex .match (field_path )
1539
+
1540
+ if match :
1541
+ aperture_size = match .group (1 )
1542
+
1543
+ full_name = f"SNIa rate ({ aperture_size } kpc)"
1544
+ snake_case = f"snia_rates_{ aperture_size } _kpc"
1545
+
1546
+ return unit , full_name , snake_case
1547
+ else :
1548
+ raise RegistrationDoesNotMatchError
1549
+
1550
+
1526
1551
# TODO
1527
1552
# lambda_B
1528
1553
# q
@@ -1545,6 +1570,7 @@ def registration_element_masses_in_stars(
1545
1570
global_registration_functions = {
1546
1571
k : globals ()[f"registration_{ k } " ]
1547
1572
for k in [
1573
+ "snia_rates" ,
1548
1574
"metallicity" ,
1549
1575
"ids" ,
1550
1576
"energies" ,
You can’t perform that action at this time.
0 commit comments