Skip to content

Commit 4207dfc

Browse files
committed
Format
1 parent b4d2bf4 commit 4207dfc

2 files changed

Lines changed: 31 additions & 108 deletions

File tree

velociraptor/catalogue/soap_catalogue.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ def _register_metadata(self, handle: h5py.File):
141141
"""
142142
metadata = handle[self.name].attrs
143143
factor = (
144-
metadata["Conversion factor to physical CGS (including cosmological corrections)"][0]
144+
metadata[
145+
"Conversion factor to physical CGS (including cosmological corrections)"
146+
][0]
145147
* unyt.A ** metadata["U_I exponent"][0]
146148
* unyt.cm ** metadata["U_L exponent"][0]
147149
* unyt.g ** metadata["U_M exponent"][0]
@@ -374,7 +376,7 @@ def _register_elements(self, handle: h5py.File):
374376
"""
375377
h5group = handle[self.name] if self.name != "" else handle["/"]
376378
for (key, h5obj) in h5group.items():
377-
if key == 'Cells':
379+
if key == "Cells":
378380
continue
379381
if isinstance(h5obj, h5py.Group):
380382
el = CatalogueGroup(self.file_name, f"{self.name}/{key}", handle)
@@ -542,8 +544,7 @@ def _register_quantities(self):
542544
# get the box size and length unit from the SWIFT header and unit metadata
543545
boxsize = handle["SWIFT/Header"].attrs["BoxSize"][0]
544546
boxsize_unit = (
545-
handle["Units"].attrs["Unit length in cgs (U_L)"][0]
546-
* unyt.cm
547+
handle["Units"].attrs["Unit length in cgs (U_L)"][0] * unyt.cm
547548
).in_base("galactic")
548549
boxsize *= boxsize_unit
549550
physical_boxsize = self.a * boxsize

velociraptor/catalogue/translator.py

Lines changed: 26 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -852,10 +852,7 @@ def VR_to_SOAP(particle_property_name: str) -> str:
852852
"spherical_overdensities.r_2500_rhocrit": ("so.2500_crit.soradius", -1),
853853
"spherical_overdensities.r_500_rhocrit": ("so.500_crit.soradius", -1),
854854
"structure_type.structuretype": ("inputhalos.iscentral", -1),
855-
"black_hole_masses.max": (
856-
"boundsubhalo.mostmassiveblackholemass",
857-
-1,
858-
),
855+
"black_hole_masses.max": ("boundsubhalo.mostmassiveblackholemass", -1),
859856
"temperature.t_gas": ("boundsubhalo.gastemperature", -1),
860857
"temperature.t_gas_hight_incl": (
861858
"boundsubhalo.gastemperaturewithoutcoolgas",
@@ -875,89 +872,29 @@ def VR_to_SOAP(particle_property_name: str) -> str:
875872
"positions.zcmbp": ("inputhalos.halocentre", 2),
876873
"positions.zcminpot": ("inputhalos.halocentre", 2),
877874
"metallicity.zmet_gas": ("boundsubhalo.gasmassfractioninmetals", -1),
878-
"metallicity.zmet_star": (
879-
"boundsubhalo.stellarmassfractioninmetals",
880-
-1,
881-
),
875+
"metallicity.zmet_star": ("boundsubhalo.stellarmassfractioninmetals", -1),
882876
"number.bh": ("boundsubhalo.numberofblackholeparticles", -1),
883877
"number.gas": ("boundsubhalo.numberofgasparticles", -1),
884878
"number.star": ("boundsubhalo.numberofstarparticles", -1),
885-
"veldisp.veldisp_xx_gas": (
886-
"boundsubhalo.gasvelocitydispersionmatrix",
887-
0,
888-
),
889-
"veldisp.veldisp_xx_star": (
890-
"boundsubhalo.stellarvelocitydispersionmatrix",
891-
0,
892-
),
893-
"veldisp.veldisp_xy_gas": (
894-
"boundsubhalo.gasvelocitydispersionmatrix",
895-
3,
896-
),
897-
"veldisp.veldisp_xy_star": (
898-
"boundsubhalo.stellarvelocitydispersionmatrix",
899-
3,
900-
),
901-
"veldisp.veldisp_xz_gas": (
902-
"boundsubhalo.gasvelocitydispersionmatrix",
903-
4,
904-
),
905-
"veldisp.veldisp_xz_star": (
906-
"boundsubhalo.stellarvelocitydispersionmatrix",
907-
4,
908-
),
909-
"veldisp.veldisp_yx_gas": (
910-
"boundsubhalo.gasvelocitydispersionmatrix",
911-
3,
912-
),
913-
"veldisp.veldisp_yx_star": (
914-
"boundsubhalo.stellarvelocitydispersionmatrix",
915-
3,
916-
),
917-
"veldisp.veldisp_yy_gas": (
918-
"boundsubhalo.gasvelocitydispersionmatrix",
919-
1,
920-
),
921-
"veldisp.veldisp_yy_star": (
922-
"boundsubhalo.stellarvelocitydispersionmatrix",
923-
1,
924-
),
925-
"veldisp.veldisp_yz_gas": (
926-
"boundsubhalo.gasvelocitydispersionmatrix",
927-
5,
928-
),
929-
"veldisp.veldisp_yz_star": (
930-
"boundsubhalo.stellarvelocitydispersionmatrix",
931-
5,
932-
),
933-
"veldisp.veldisp_zx_gas": (
934-
"boundsubhalo.gasvelocitydispersionmatrix",
935-
4,
936-
),
937-
"veldisp.veldisp_zx_star": (
938-
"boundsubhalo.stellarvelocitydispersionmatrix",
939-
4,
940-
),
941-
"veldisp.veldisp_zy_gas": (
942-
"boundsubhalo.gasvelocitydispersionmatrix",
943-
5,
944-
),
945-
"veldisp.veldisp_zy_star": (
946-
"boundsubhalo.stellarvelocitydispersionmatrix",
947-
5,
948-
),
949-
"veldisp.veldisp_zz_gas": (
950-
"boundsubhalo.gasvelocitydispersionmatrix",
951-
2,
952-
),
953-
"veldisp.veldisp_zz_star": (
954-
"boundsubhalo.stellarvelocitydispersionmatrix",
955-
2,
956-
),
957-
"stellar_age.tage_star": (
958-
"boundsubhalo.massweightedmeanstellarage",
959-
-1,
960-
),
879+
"veldisp.veldisp_xx_gas": ("boundsubhalo.gasvelocitydispersionmatrix", 0),
880+
"veldisp.veldisp_xx_star": ("boundsubhalo.stellarvelocitydispersionmatrix", 0),
881+
"veldisp.veldisp_xy_gas": ("boundsubhalo.gasvelocitydispersionmatrix", 3),
882+
"veldisp.veldisp_xy_star": ("boundsubhalo.stellarvelocitydispersionmatrix", 3),
883+
"veldisp.veldisp_xz_gas": ("boundsubhalo.gasvelocitydispersionmatrix", 4),
884+
"veldisp.veldisp_xz_star": ("boundsubhalo.stellarvelocitydispersionmatrix", 4),
885+
"veldisp.veldisp_yx_gas": ("boundsubhalo.gasvelocitydispersionmatrix", 3),
886+
"veldisp.veldisp_yx_star": ("boundsubhalo.stellarvelocitydispersionmatrix", 3),
887+
"veldisp.veldisp_yy_gas": ("boundsubhalo.gasvelocitydispersionmatrix", 1),
888+
"veldisp.veldisp_yy_star": ("boundsubhalo.stellarvelocitydispersionmatrix", 1),
889+
"veldisp.veldisp_yz_gas": ("boundsubhalo.gasvelocitydispersionmatrix", 5),
890+
"veldisp.veldisp_yz_star": ("boundsubhalo.stellarvelocitydispersionmatrix", 5),
891+
"veldisp.veldisp_zx_gas": ("boundsubhalo.gasvelocitydispersionmatrix", 4),
892+
"veldisp.veldisp_zx_star": ("boundsubhalo.stellarvelocitydispersionmatrix", 4),
893+
"veldisp.veldisp_zy_gas": ("boundsubhalo.gasvelocitydispersionmatrix", 5),
894+
"veldisp.veldisp_zy_star": ("boundsubhalo.stellarvelocitydispersionmatrix", 5),
895+
"veldisp.veldisp_zz_gas": ("boundsubhalo.gasvelocitydispersionmatrix", 2),
896+
"veldisp.veldisp_zz_star": ("boundsubhalo.stellarvelocitydispersionmatrix", 2),
897+
"stellar_age.tage_star": ("boundsubhalo.massweightedmeanstellarage", -1),
961898
"snia_rates.snia_rates_30_kpc": ("exclusivesphere.30kpc.totalsniarate", -1),
962899
"snia_rates.snia_rates_50_kpc": ("exclusivesphere.50kpc.totalsniarate", -1),
963900
"snia_rates.snia_rates_100_kpc": ("exclusivesphere.100kpc.totalsniarate", -1),
@@ -1225,26 +1162,14 @@ def VR_to_SOAP(particle_property_name: str) -> str:
12251162
"boundsubhalo.medianstellarbirthdensity",
12261163
-1,
12271164
),
1228-
"stellar_birth_densities.min": (
1229-
"boundsubhalo.minimumstellarbirthdensity",
1230-
-1,
1231-
),
1232-
"stellar_birth_densities.max": (
1233-
"boundsubhalo.maximumstellarbirthdensity",
1234-
-1,
1235-
),
1165+
"stellar_birth_densities.min": ("boundsubhalo.minimumstellarbirthdensity", -1),
1166+
"stellar_birth_densities.max": ("boundsubhalo.maximumstellarbirthdensity", -1),
12361167
"stellar_birth_pressures.median": (
12371168
"boundsubhalo.medianstellarbirthpressure",
12381169
-1,
12391170
),
1240-
"stellar_birth_pressures.min": (
1241-
"boundsubhalo.minimumstellarbirthpressure",
1242-
-1,
1243-
),
1244-
"stellar_birth_pressures.max": (
1245-
"boundsubhalo.maximumstellarbirthpressure",
1246-
-1,
1247-
),
1171+
"stellar_birth_pressures.min": ("boundsubhalo.minimumstellarbirthpressure", -1),
1172+
"stellar_birth_pressures.max": ("boundsubhalo.maximumstellarbirthpressure", -1),
12481173
"stellar_birth_temperatures.median": (
12491174
"boundsubhalo.medianstellarbirthtemperature",
12501175
-1,
@@ -1561,10 +1486,7 @@ def VR_to_SOAP(particle_property_name: str) -> str:
15611486
"exclusivesphere.100kpc.linearmassweightedironfromsniaoverhydrogenofstars",
15621487
-1,
15631488
),
1564-
"searchradius.search_radius": (
1565-
"boundsubhalo.encloseradius",
1566-
-1,
1567-
),
1489+
"searchradius.search_radius": ("boundsubhalo.encloseradius", -1),
15681490
}
15691491

15701492
try:

0 commit comments

Comments
 (0)