Skip to content

Commit ac52a33

Browse files
author
Yicun Duan
committed
fix on_magnitudes
1 parent 4a3f13e commit ac52a33

File tree

1 file changed

+6
-6
lines changed
  • case_studies/redshift/redshift_from_img/encoder

1 file changed

+6
-6
lines changed

case_studies/redshift/redshift_from_img/encoder/metrics.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def update(self, true_cat, est_cat, matching):
8080
true_red = true_cat["redshifts"][i, tcat_matches, :].to(self.device)
8181
est_red = est_cat["redshifts"][i, ecat_matches, :].to(self.device)
8282

83-
true_mag = true_cat.on_magnitudes(zero_point=3631)[i][..., self.mag_band][
83+
true_mag = true_cat.on_magnitudes(zero_point=3631e9)[i][..., self.mag_band][
8484
tcat_matches
8585
].to(self.device)
8686
bin_indices = torch.bucketize(true_mag, cutoffs)
@@ -254,7 +254,7 @@ def update(self, true_cat, est_cat, matching):
254254
est_red = est_cat["redshifts"][i, ecat_matches, :].to(self.device)
255255

256256
if self.bin_type == "ab_mag":
257-
true_mag = true_cat.on_magnitudes(zero_point=3631)[i][..., self.mag_band][
257+
true_mag = true_cat.on_magnitudes(zero_point=3631e9)[i][..., self.mag_band][
258258
tcat_matches
259259
].to(self.device)
260260
elif self.bin_type == "njy":
@@ -343,7 +343,7 @@ def update(self, true_cat, est_cat, matching):
343343
est_red = est_cat["redshifts"][i, ecat_matches, :].to(self.device)
344344

345345
if self.bin_type == "ab_mag":
346-
true_mag = true_cat.on_magnitudes(zero_point=3631)[i][..., self.mag_band][
346+
true_mag = true_cat.on_magnitudes(zero_point=3631e9)[i][..., self.mag_band][
347347
tcat_matches
348348
].to(self.device)
349349
elif self.bin_type == "njy":
@@ -425,7 +425,7 @@ def update(self, true_cat, est_cat, matching):
425425
est_red = est_cat["redshifts"][i, ecat_matches, :].to(self.device)
426426

427427
if self.bin_type == "ab_mag":
428-
true_mag = true_cat.on_magnitudes(zero_point=3631)[i][..., self.mag_band][
428+
true_mag = true_cat.on_magnitudes(zero_point=3631e9)[i][..., self.mag_band][
429429
tcat_matches
430430
].to(self.device)
431431
elif self.bin_type == "njy":
@@ -523,7 +523,7 @@ def update(self, true_cat, est_cat, matching):
523523
est_red = est_cat["redshifts"][i, ecat_matches, :].to(self.device)
524524

525525
if self.bin_type == "ab_mag":
526-
true_mag = true_cat.on_magnitudes(zero_point=3631)[i][..., self.mag_band][
526+
true_mag = true_cat.on_magnitudes(zero_point=3631e9)[i][..., self.mag_band][
527527
tcat_matches
528528
].to(self.device)
529529
elif self.bin_type == "njy":
@@ -613,7 +613,7 @@ def update(self, true_cat, est_cat, matching):
613613
est_red = est_cat["redshifts"][i, ecat_matches, :].to(self.device)
614614

615615
if self.bin_type == "ab_mag":
616-
true_mag = true_cat.on_magnitudes(zero_point=3631)[i][..., self.mag_band][
616+
true_mag = true_cat.on_magnitudes(zero_point=3631e9)[i][..., self.mag_band][
617617
tcat_matches
618618
].to(self.device)
619619
elif self.bin_type == "njy":

0 commit comments

Comments
 (0)