diff --git a/app/entrypoints/blast-data.json b/app/entrypoints/blast-data.json index d999624d..210579b6 100644 --- a/app/entrypoints/blast-data.json +++ b/app/entrypoints/blast-data.json @@ -2010,30 +2010,35 @@ "size": 720000164 }, { + "TODO": "Remove me", "path": "sbipp/SBI_model.pt", "version_id": "bGgAnrSKwAqAodKHhuUncVEKLs7M0pt", "etag": "cbf5690b49ca21cddacae4ddf24f146f-4", "size": 65007493 }, { + "TODO": "Replace me with data/sbipp/SBI_model_blast_zfix_global.pt", "path": "sbipp/SBI_model_global.pt", "version_id": "TqYFph0y083LP9FqdP1bBDpbnQ5G9ye", "etag": "255f5a086f7e5dbbb322faac659f6673-4", "size": 65007493 }, { + "TODO": "Replace me with data/sbipp/SBI_model_blast_zfree_global.pt", "path": "sbipp/SBI_model_local.pt", "version_id": "FtKKE82y1UkrQ1dhXkFc3HebczNWISP", "etag": "22b59e91fa47e87f0e688f46e4d31242-4", "size": 65009239 }, { + "TODO": "Replace with new model", "path": "sbipp_phot/sbi_phot_global.h5", "version_id": "TKLSBpdYgHXIg1J8js.XoTKXoRPd8RP", "etag": "cb5e6fd738694f4da1541e4b1fa717d5-2", "size": 1024005856 }, { + "TODO": "Replace with new model", "path": "sbipp_phot/sbi_phot_local.h5", "version_id": "jZiVHZ6wMlO1PLbhQbr1OA-0H-j8mqI", "etag": "37a90f8b01643a4699b01d027c34256c-2", diff --git a/app/host/SBI/__init__.py b/app/host/SBI/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/app/host/SBI/run_sbi_blast.py b/app/host/SBI/run_sbi_blast.py index fdbd3af9..61618186 100644 --- a/app/host/SBI/run_sbi_blast.py +++ b/app/host/SBI/run_sbi_blast.py @@ -40,10 +40,14 @@ } sbi_params = { - "anpe_fname_global": f"{settings.SBIPP_ROOT}/SBI_model_global.pt", # trained sbi model - "train_fname_global": f"{settings.SBIPP_PHOT_ROOT}/sbi_phot_global.h5", # training set - "anpe_fname_local": f"{settings.SBIPP_ROOT}/SBI_model_local.pt", # trained sbi model - "train_fname_local": f"{settings.SBIPP_PHOT_ROOT}/sbi_phot_local.h5", # training set + #"anpe_fname_global": f"{settings.SBIPP_ROOT}/SBI_model_global.pt", # trained sbi model + #"train_fname_global": f"{settings.SBIPP_PHOT_ROOT}/sbi_phot_global.h5", # training set + #"anpe_fname_local": f"{settings.SBIPP_ROOT}/SBI_model_local.pt", # trained sbi model + #"train_fname_local": f"{settings.SBIPP_PHOT_ROOT}/sbi_phot_local.h5", # training set + "anpe_fname_zspec": f"{settings.SBIPP_ROOT}/SBI_model_blast_zfix_global.pt", # trained sbi model + "train_fname_zspec": f"{settings.SBIPP_PHOT_ROOT}/sbi_phot_blast_zfix_global.h5", # training set + "anpe_fname_zphot": f"{settings.SBIPP_ROOT}/SBI_model_blast_zfree_global.pt", # trained sbi model + "train_fname_zphot": f"{settings.SBIPP_PHOT_ROOT}/sbi_phot_blast_zfree_global.h5", # training set "nhidden": 500, # architecture of the trained density estimator "nblocks": 15, # architecture of the trained density estimator } @@ -76,7 +80,7 @@ # training set def run_training_set(): - for _fit_type in ["global", "local"]: + for _fit_type in ["zspec", "zphot"]: data = h5py.File(sbi_params[f"train_fname_{_fit_type}"], "r") x_train = np.array(data["theta"]) # physical parameters y_train = np.array(data["phot"]) # fluxes & uncertainties @@ -109,76 +113,104 @@ def run_training_set(): ) ) anpe._x_shape = Ut.x_shape_from_simulation(y_tensor) - if _fit_type == "global": - hatp_x_y_global = anpe.build_posterior( + if _fit_type == "zspec": + hatp_x_y_zspec = anpe.build_posterior( p_x_y_estimator, sample_with="rejection" ) - y_train_global = y_train[:] - x_train_global = x_train[:] - elif _fit_type == "local": - hatp_x_y_local = anpe.build_posterior( + y_train_zspec = y_train[:] + x_train_zspec = x_train[:] + elif _fit_type == "zphot": + hatp_x_y_zphot = anpe.build_posterior( p_x_y_estimator, sample_with="rejection" ) - y_train_local = y_train[:] - x_train_local = x_train[:] + y_train_zphot = y_train[:] + x_train_zphot = x_train[:] print("""Storing training sets as data files...""") with open( - os.path.join(settings.SBI_TRAINING_ROOT, "hatp_x_y_global.pkl"), "wb" + os.path.join(settings.SBI_TRAINING_ROOT, "hatp_x_y_zspec.pkl"), "wb" ) as handle: - pickle.dump(hatp_x_y_global, handle) + pickle.dump(hatp_x_y_zspec, handle) with open( - os.path.join(settings.SBI_TRAINING_ROOT, "y_train_global.pkl"), "wb" + os.path.join(settings.SBI_TRAINING_ROOT, "y_train_zspec.pkl"), "wb" ) as handle: - pickle.dump(y_train_global, handle) + pickle.dump(y_train_zspec, handle) with open( - os.path.join(settings.SBI_TRAINING_ROOT, "x_train_global.pkl"), "wb" + os.path.join(settings.SBI_TRAINING_ROOT, "x_train_zspec.pkl"), "wb" ) as handle: - pickle.dump(x_train_global, handle) + pickle.dump(x_train_zspec, handle) with open( - os.path.join(settings.SBI_TRAINING_ROOT, "hatp_x_y_local.pkl"), "wb" + os.path.join(settings.SBI_TRAINING_ROOT, "hatp_x_y_zphot.pkl"), "wb" ) as handle: - pickle.dump(hatp_x_y_local, handle) + pickle.dump(hatp_x_y_zphot, handle) with open( - os.path.join(settings.SBI_TRAINING_ROOT, "y_train_local.pkl"), "wb" + os.path.join(settings.SBI_TRAINING_ROOT, "y_train_zphot.pkl"), "wb" ) as handle: - pickle.dump(y_train_local, handle) + pickle.dump(y_train_zphot, handle) with open( - os.path.join(settings.SBI_TRAINING_ROOT, "x_train_local.pkl"), "wb" + os.path.join(settings.SBI_TRAINING_ROOT, "x_train_zphot.pkl"), "wb" ) as handle: - pickle.dump(x_train_local, handle) - + pickle.dump(x_train_zphot, handle) + try: print("""Loading training sets from data files...""") with open( - os.path.join(settings.SBI_TRAINING_ROOT, "hatp_x_y_global.pkl"), "rb" + os.path.join(settings.SBI_TRAINING_ROOT, "hatp_x_y_zspec.pkl"), "rb" ) as handle: - hatp_x_y_global = pickle.load(handle) + hatp_x_y_zspec = pickle.load(handle) with open( - os.path.join(settings.SBI_TRAINING_ROOT, "y_train_global.pkl"), "rb" + os.path.join(settings.SBI_TRAINING_ROOT, "y_train_zspec.pkl"), "rb" ) as handle: - y_train_global = pickle.load(handle) + y_train_zspec = pickle.load(handle) with open( - os.path.join(settings.SBI_TRAINING_ROOT, "x_train_global.pkl"), "rb" + os.path.join(settings.SBI_TRAINING_ROOT, "x_train_zspec.pkl"), "rb" ) as handle: - x_train_global = pickle.load(handle) + x_train_zspec = pickle.load(handle) with open( - os.path.join(settings.SBI_TRAINING_ROOT, "hatp_x_y_local.pkl"), "rb" + os.path.join(settings.SBI_TRAINING_ROOT, "hatp_x_y_zphot.pkl"), "rb" ) as handle: - hatp_x_y_local = pickle.load(handle) + hatp_x_y_zphot = pickle.load(handle) with open( - os.path.join(settings.SBI_TRAINING_ROOT, "y_train_local.pkl"), "rb" + os.path.join(settings.SBI_TRAINING_ROOT, "y_train_zphot.pkl"), "rb" ) as handle: - y_train_local = pickle.load(handle) + y_train_zphot = pickle.load(handle) with open( - os.path.join(settings.SBI_TRAINING_ROOT, "x_train_local.pkl"), "rb" + os.path.join(settings.SBI_TRAINING_ROOT, "x_train_zphot.pkl"), "rb" ) as handle: - x_train_local = pickle.load(handle) + x_train_zphot = pickle.load(handle) print("""Training sets loaded.""") except Exception as err: print(f"""Error loading training sets: {err}. Regenerating...""") run_training_set() + print("""Loading training sets from data files...""") + with open( + os.path.join(settings.SBI_TRAINING_ROOT, "hatp_x_y_zspec.pkl"), "rb" + ) as handle: + hatp_x_y_zspec = pickle.load(handle) + with open( + os.path.join(settings.SBI_TRAINING_ROOT, "y_train_zspec.pkl"), "rb" + ) as handle: + y_train_zspec = pickle.load(handle) + with open( + os.path.join(settings.SBI_TRAINING_ROOT, "x_train_zspec.pkl"), "rb" + ) as handle: + x_train_zspec = pickle.load(handle) + with open( + os.path.join(settings.SBI_TRAINING_ROOT, "hatp_x_y_zphot.pkl"), "rb" + ) as handle: + hatp_x_y_zphot = pickle.load(handle) + with open( + os.path.join(settings.SBI_TRAINING_ROOT, "y_train_zphot.pkl"), "rb" + ) as handle: + y_train_zphot = pickle.load(handle) + with open( + os.path.join(settings.SBI_TRAINING_ROOT, "x_train_zphot.pkl"), "rb" + ) as handle: + x_train_zphot = pickle.load(handle) + print("""Training sets loaded.""") + + print("""Training sets generated.""") @@ -189,7 +221,7 @@ def maggies_to_asinh(x): return -a * math.asinh((x / 2.0) * np.exp(mu / a)) + mu -def fit_sbi_pp(observations, n_filt_cuts=True, fit_type="global"): +def fit_sbi_pp(observations, n_filt_cuts=True): np.random.seed(100) # make results reproducible # toy noise model @@ -260,6 +292,8 @@ def fit_sbi_pp(observations, n_filt_cuts=True, fit_type="global"): "mags_unc" ] = mags_unc ##2.5/np.log(10)*observations['maggies_unc']/observations['maggies'] obs["redshift"] = observations["redshift"] + if observations["redshift"] is not None: fit_type="zspec" + else: fit_type="zphot" obs["wavelengths"] = wavelengths obs["filternames"] = filternames @@ -268,14 +302,14 @@ def fit_sbi_pp(observations, n_filt_cuts=True, fit_type="global"): return {}, 1 # prepare to pass the reconstructed model to sbi_pp - if fit_type == "global": - sbi_params["y_train"] = y_train_global - sbi_params["theta_train"] = x_train_global - sbi_params["hatp_x_y"] = hatp_x_y_global - elif fit_type == "local": - sbi_params["y_train"] = y_train_local - sbi_params["hatp_x_y"] = hatp_x_y_local - sbi_params["theta_train"] = x_train_local + if fit_type == "zspec": + sbi_params["y_train"] = y_train_zspec + sbi_params["theta_train"] = x_train_zspec + sbi_params["hatp_x_y"] = hatp_x_y_zspec + elif fit_type == "zphot": + sbi_params["y_train"] = y_train_zphot + sbi_params["hatp_x_y"] = hatp_x_y_zphot + sbi_params["theta_train"] = x_train_zphot # Run SBI++ chain, obs, flags = sbi_pp.sbi_pp( diff --git a/app/host/SBI/snrfiles/DES_g_magvsnr.txt b/app/host/SBI/snrfiles/DES_g_magvsnr.txt index ac213267..c8a08e10 100644 --- a/app/host/SBI/snrfiles/DES_g_magvsnr.txt +++ b/app/host/SBI/snrfiles/DES_g_magvsnr.txt @@ -1,33 +1,44 @@ -14.095 1498.834 -14.345 1351.754 -14.595 1539.793 -14.845 1354.735 -15.095 1127.177 -15.345 825.908 -15.595 665.150 -15.845 842.000 -16.095 728.931 -16.345 676.029 -16.595 562.362 -16.845 488.038 -17.095 383.174 -17.345 394.547 -17.595 349.924 -17.845 320.220 -18.095 242.899 -18.345 192.111 -18.595 193.220 -18.845 169.726 -19.095 142.447 -19.345 155.718 -19.595 130.075 -19.845 111.698 -20.095 98.763 -20.345 92.329 -20.595 75.412 -20.845 72.376 -21.095 69.339 -21.345 56.024 -21.595 45.311 -21.845 44.467 -22.095 32.316 +12.756 100.743 +13.006 100.797 +13.256 100.850 +13.506 100.769 +13.756 100.600 +14.006 100.633 +14.256 100.610 +14.506 100.451 +14.756 100.579 +15.006 100.473 +15.256 100.087 +15.506 98.510 +15.756 99.593 +16.006 99.552 +16.256 99.251 +16.506 98.512 +16.756 97.598 +17.006 97.181 +17.256 96.188 +17.506 94.882 +17.756 93.243 +18.006 91.857 +18.256 90.140 +18.506 88.165 +18.756 85.328 +19.006 81.921 +19.256 78.153 +19.506 71.680 +19.756 68.049 +20.006 65.352 +20.256 59.085 +20.506 52.060 +20.756 49.272 +21.006 41.462 +21.256 38.490 +21.506 33.899 +21.756 28.464 +22.006 25.879 +22.256 20.193 +22.506 19.895 +22.756 16.265 +23.006 14.125 +23.256 12.318 +23.506 8.555 diff --git a/app/host/SBI/snrfiles/DES_r_magvsnr.txt b/app/host/SBI/snrfiles/DES_r_magvsnr.txt index 3a64ffc7..99d7f8e0 100644 --- a/app/host/SBI/snrfiles/DES_r_magvsnr.txt +++ b/app/host/SBI/snrfiles/DES_r_magvsnr.txt @@ -1,35 +1,42 @@ -13.220 1380.660 -13.470 1515.118 -13.720 1440.689 -13.970 1075.392 -14.220 1171.863 -14.470 1122.357 -14.720 743.579 -14.970 847.772 -15.220 701.530 -15.470 607.197 -15.720 638.522 -15.970 581.440 -16.220 401.855 -16.470 350.811 -16.720 509.118 -16.970 344.474 -17.220 283.598 -17.470 204.505 -17.720 224.727 -17.970 158.058 -18.220 173.284 -18.470 165.233 -18.720 150.001 -18.970 109.567 -19.220 96.969 -19.470 110.299 -19.720 74.490 -19.970 85.434 -20.220 79.614 -20.470 73.795 -20.720 46.062 -20.970 45.486 -21.220 41.995 -21.470 38.503 -21.720 25.180 +12.424 100.617 +12.674 100.664 +12.924 100.712 +13.174 100.388 +13.424 100.662 +13.674 100.623 +13.924 100.486 +14.174 100.477 +14.424 100.136 +14.674 99.826 +14.924 99.986 +15.174 99.668 +15.424 99.002 +15.674 98.421 +15.924 98.065 +16.174 95.832 +16.424 95.031 +16.674 94.200 +16.924 94.663 +17.174 92.153 +17.424 90.064 +17.674 86.884 +17.924 84.744 +18.174 81.741 +18.424 78.850 +18.674 73.872 +18.924 72.352 +19.174 65.074 +19.424 58.806 +19.674 54.362 +19.924 51.035 +20.174 40.640 +20.424 38.705 +20.674 32.043 +20.924 33.475 +21.174 28.748 +21.424 23.027 +21.674 19.599 +21.924 16.171 +22.174 14.494 +22.424 12.818 +22.674 11.141 diff --git a/app/host/SBI/snrfiles/DES_z_magvsnr.txt b/app/host/SBI/snrfiles/DES_z_magvsnr.txt index 46badb51..65cefea9 100644 --- a/app/host/SBI/snrfiles/DES_z_magvsnr.txt +++ b/app/host/SBI/snrfiles/DES_z_magvsnr.txt @@ -1,34 +1,36 @@ -12.541 745.456 -12.791 851.234 -13.041 877.348 -13.291 673.375 -13.541 603.870 -13.791 552.570 -14.041 539.094 -14.291 485.266 -14.541 386.892 -14.791 328.524 -15.041 298.223 -15.291 266.563 -15.541 305.988 -15.791 228.101 -16.041 200.223 -16.291 211.366 -16.541 177.799 -16.791 139.803 -17.041 132.773 -17.291 124.820 -17.541 88.054 -17.791 88.806 -18.041 93.157 -18.291 64.252 -18.541 68.874 -18.791 48.970 -19.041 45.735 -19.291 51.471 -19.541 35.820 -19.791 35.549 -20.041 35.278 -20.291 26.431 -20.541 25.123 -20.791 24.644 +12.437 100.186 +12.687 99.751 +12.937 100.044 +13.187 99.853 +13.437 99.578 +13.687 99.192 +13.937 98.994 +14.187 98.360 +14.437 97.211 +14.687 97.101 +14.937 96.189 +15.187 94.499 +15.437 94.048 +15.687 91.590 +15.937 89.435 +16.187 88.289 +16.437 83.377 +16.687 80.759 +16.937 78.836 +17.187 74.299 +17.437 69.504 +17.687 64.926 +17.937 60.867 +18.187 54.637 +18.437 51.403 +18.687 46.013 +18.937 40.818 +19.187 39.466 +19.437 31.792 +19.687 29.581 +19.937 25.191 +20.187 23.327 +20.437 20.375 +20.687 18.810 +20.937 14.970 +21.187 12.715 diff --git a/app/host/SBI/snrfiles/GALEX_FUV_magvsnr.txt b/app/host/SBI/snrfiles/GALEX_FUV_magvsnr.txt index 467ebe2b..99e60bab 100644 --- a/app/host/SBI/snrfiles/GALEX_FUV_magvsnr.txt +++ b/app/host/SBI/snrfiles/GALEX_FUV_magvsnr.txt @@ -1,35 +1,54 @@ -17.728 24.130 -17.978 25.067 -18.228 26.003 -18.478 28.711 -18.728 20.557 -18.978 18.112 -19.228 19.044 -19.478 15.839 -19.728 14.159 -19.978 16.936 -20.228 8.754 -20.478 12.591 -20.728 11.202 -20.978 11.820 -21.228 6.099 -21.478 6.566 -21.728 7.327 -21.978 4.138 -22.228 5.171 -22.478 4.367 -22.728 3.428 -22.978 2.250 -23.228 3.982 -23.478 1.970 -23.728 2.820 -23.978 5.000 -24.228 1.573 -24.478 2.968 -24.728 1.808 -24.978 2.375 -25.228 1.693 -25.478 1.010 -25.728 1.313 -25.978 1.615 -26.228 1.918 +15.090 151.154 +15.340 171.953 +15.590 121.690 +15.840 79.719 +16.090 60.147 +16.340 55.955 +16.590 63.198 +16.840 54.440 +17.090 45.327 +17.340 45.647 +17.590 31.834 +17.840 32.191 +18.090 35.202 +18.340 26.600 +18.590 21.384 +18.840 19.521 +19.090 17.663 +19.340 16.408 +19.590 14.650 +19.840 12.855 +20.090 11.273 +20.340 10.106 +20.590 9.672 +20.840 8.045 +21.090 6.667 +21.340 6.076 +21.590 5.543 +21.840 5.228 +22.090 4.649 +22.340 4.525 +22.590 4.022 +22.840 3.538 +23.090 3.099 +23.340 3.424 +23.590 2.831 +23.840 2.484 +24.090 2.987 +24.340 2.305 +24.590 2.542 +24.840 1.992 +25.090 1.884 +25.340 1.995 +25.590 1.547 +25.840 1.641 +26.090 1.456 +26.340 1.318 +26.590 1.325 +26.840 1.489 +27.090 1.206 +27.340 1.223 +27.590 1.213 +27.840 1.243 +28.090 1.003 +28.340 1.021 diff --git a/app/host/SBI/snrfiles/GALEX_NUV_magvsnr.txt b/app/host/SBI/snrfiles/GALEX_NUV_magvsnr.txt index 518a1950..59f033ab 100644 --- a/app/host/SBI/snrfiles/GALEX_NUV_magvsnr.txt +++ b/app/host/SBI/snrfiles/GALEX_NUV_magvsnr.txt @@ -1,41 +1,55 @@ -17.132 104.949 -17.382 66.782 -17.632 41.550 -17.882 87.020 -18.132 39.955 -18.382 51.707 -18.632 43.578 -18.882 38.728 -19.132 42.767 -19.382 33.679 -19.632 32.440 -19.882 33.081 -20.132 33.721 -20.382 34.662 -20.632 14.149 -20.882 14.985 -21.132 18.325 -21.382 11.576 -21.632 8.577 -21.882 8.195 -22.132 16.709 -22.382 10.025 -22.632 9.107 -22.882 14.359 -23.132 4.603 -23.382 8.216 -23.632 8.824 -23.882 5.238 -24.132 1.962 -24.382 4.152 -24.632 3.315 -24.882 2.478 -25.132 2.786 -25.382 1.187 -25.632 1.225 -25.882 1.263 -26.132 1.301 -26.382 1.340 -26.632 1.378 -26.882 1.416 -27.132 0.286 +14.055 165.610 +14.305 178.338 +14.555 169.086 +14.805 159.834 +15.055 253.169 +15.305 177.401 +15.555 157.951 +15.805 169.635 +16.055 121.446 +16.305 121.898 +16.555 123.845 +16.805 118.927 +17.055 107.128 +17.305 82.414 +17.555 72.770 +17.805 78.851 +18.055 54.661 +18.305 47.915 +18.555 44.725 +18.805 38.154 +19.055 37.944 +19.305 30.857 +19.555 29.276 +19.805 23.254 +20.055 22.481 +20.305 18.186 +20.555 15.839 +20.805 12.775 +21.055 12.197 +21.305 10.008 +21.555 9.320 +21.805 8.212 +22.055 6.845 +22.305 5.840 +22.555 5.225 +22.805 4.767 +23.055 4.278 +23.305 4.491 +23.555 3.221 +23.805 2.977 +24.055 2.500 +24.305 2.440 +24.555 2.336 +24.805 1.643 +25.055 1.728 +25.305 1.275 +25.555 1.560 +25.805 1.124 +26.055 1.138 +26.305 1.199 +26.555 1.118 +26.805 1.036 +27.055 1.007 +27.305 1.059 +27.555 1.078 diff --git a/app/host/SBI/snrfiles/PanSTARRS_g_magvsnr.txt b/app/host/SBI/snrfiles/PanSTARRS_g_magvsnr.txt index 05d6aadd..bf4856a0 100644 --- a/app/host/SBI/snrfiles/PanSTARRS_g_magvsnr.txt +++ b/app/host/SBI/snrfiles/PanSTARRS_g_magvsnr.txt @@ -1,42 +1,47 @@ -13.083 1816.397 -13.333 1804.632 -13.583 1692.624 -13.833 1580.616 -14.083 1238.591 -14.333 1113.054 -14.583 934.062 -14.833 1182.527 -15.083 946.046 -15.333 681.405 -15.583 808.538 -15.833 651.426 -16.083 572.737 -16.333 502.708 -16.583 482.651 -16.833 428.387 -17.083 356.152 -17.333 306.005 -17.583 228.385 -17.833 294.120 -18.083 230.318 -18.333 165.480 -18.583 143.292 -18.833 155.063 -19.083 114.239 -19.333 95.372 -19.583 98.135 -19.833 81.517 -20.083 69.577 -20.333 55.760 -20.583 46.804 -20.833 39.828 -21.083 34.009 -21.333 30.690 -21.583 27.400 -21.833 26.572 -22.083 15.079 -22.333 14.387 -22.583 13.695 -22.833 13.002 -23.083 12.310 -23.333 11.618 +11.752 100.095 +12.002 100.753 +12.252 100.704 +12.502 100.847 +12.752 100.708 +13.002 100.720 +13.252 100.608 +13.502 100.638 +13.752 100.110 +14.002 100.424 +14.252 100.330 +14.502 100.185 +14.752 99.869 +15.002 99.569 +15.252 99.084 +15.502 98.660 +15.752 97.933 +16.002 97.037 +16.252 96.444 +16.502 95.246 +16.752 93.309 +17.002 91.716 +17.252 89.465 +17.502 86.684 +17.752 83.139 +18.002 79.674 +18.252 73.870 +18.502 69.494 +18.752 64.875 +19.002 58.838 +19.252 54.554 +19.502 46.591 +19.752 43.093 +20.002 36.755 +20.252 32.474 +20.502 26.993 +20.752 23.187 +21.002 19.766 +21.252 15.589 +21.502 12.680 +21.752 10.986 +22.002 8.588 +22.252 7.433 +22.502 5.793 +22.752 4.509 +23.002 3.898 +23.252 3.853 diff --git a/app/host/SBI/snrfiles/PanSTARRS_i_magvsnr.txt b/app/host/SBI/snrfiles/PanSTARRS_i_magvsnr.txt index c56d88a2..8e354190 100644 --- a/app/host/SBI/snrfiles/PanSTARRS_i_magvsnr.txt +++ b/app/host/SBI/snrfiles/PanSTARRS_i_magvsnr.txt @@ -1,38 +1,48 @@ -12.265 3263.131 -12.515 2500.063 -12.765 2768.057 -13.015 2803.113 -13.265 2195.514 -13.515 2092.378 -13.765 2526.691 -14.015 1568.585 -14.265 1240.408 -14.515 1788.709 -14.765 1278.834 -15.015 1309.244 -15.265 877.523 -15.515 866.484 -15.765 837.605 -16.015 814.952 -16.265 560.307 -16.515 524.885 -16.765 501.233 -17.015 451.916 -17.265 368.273 -17.515 346.580 -17.765 249.223 -18.015 244.013 -18.265 233.799 -18.515 160.425 -18.765 177.281 -19.015 101.225 -19.265 113.575 -19.515 86.084 -19.765 79.387 -20.015 64.853 -20.265 52.716 -20.515 55.557 -20.765 38.368 -21.015 40.815 -21.265 39.449 -21.515 34.699 +11.236 100.790 +11.486 100.874 +11.736 100.829 +11.986 100.861 +12.236 100.878 +12.486 100.846 +12.736 100.848 +12.986 100.832 +13.236 100.829 +13.486 100.753 +13.736 100.682 +13.986 100.608 +14.236 100.534 +14.486 100.284 +14.736 100.167 +14.986 99.975 +15.236 99.509 +15.486 99.252 +15.736 98.677 +15.986 97.854 +16.236 97.128 +16.486 96.091 +16.736 94.390 +16.986 92.374 +17.236 89.595 +17.486 86.978 +17.736 83.472 +17.986 78.975 +18.236 74.496 +18.486 69.952 +18.736 63.806 +18.986 58.302 +19.236 52.777 +19.486 46.339 +19.736 40.869 +19.986 33.861 +20.236 30.081 +20.486 25.207 +20.736 21.348 +20.986 18.071 +21.236 15.517 +21.486 12.785 +21.736 10.272 +21.986 8.106 +22.236 7.231 +22.486 6.533 +22.736 5.395 +22.986 4.257 diff --git a/app/host/SBI/snrfiles/PanSTARRS_r_magvsnr.txt b/app/host/SBI/snrfiles/PanSTARRS_r_magvsnr.txt index 02d0d546..8aeac538 100644 --- a/app/host/SBI/snrfiles/PanSTARRS_r_magvsnr.txt +++ b/app/host/SBI/snrfiles/PanSTARRS_r_magvsnr.txt @@ -1,40 +1,49 @@ -12.358 2631.265 -12.608 2907.569 -12.858 2617.053 -13.108 2326.538 -13.358 2606.377 -13.608 1765.747 -13.858 1556.996 -14.108 1669.835 -14.358 1408.436 -14.608 1108.200 -14.858 1387.527 -15.108 992.778 -15.358 1116.654 -15.608 758.910 -15.858 639.770 -16.108 755.693 -16.358 593.008 -16.608 447.057 -16.858 382.013 -17.108 381.960 -17.358 369.867 -17.608 300.776 -17.858 231.685 -18.108 200.068 -18.358 218.117 -18.608 160.979 -18.858 149.169 -19.108 140.760 -19.358 92.559 -19.608 98.273 -19.858 75.177 -20.108 57.984 -20.358 63.477 -20.608 56.354 -20.858 35.442 -21.108 39.512 -21.358 24.827 -21.608 19.557 -21.858 36.308 -22.108 22.217 +11.028 100.857 +11.278 100.799 +11.528 100.741 +11.778 100.666 +12.028 100.840 +12.278 100.884 +12.528 100.865 +12.778 100.819 +13.028 100.714 +13.278 100.771 +13.528 100.724 +13.778 100.541 +14.028 100.596 +14.278 100.424 +14.528 100.280 +14.778 100.014 +15.028 99.727 +15.278 99.336 +15.528 98.829 +15.778 98.546 +16.028 97.615 +16.278 96.718 +16.528 94.986 +16.778 94.075 +17.028 91.390 +17.278 89.474 +17.528 86.958 +17.778 82.020 +18.028 78.999 +18.278 73.300 +18.528 68.627 +18.778 64.304 +19.028 57.889 +19.278 50.643 +19.528 45.907 +19.778 40.685 +20.028 35.122 +20.278 29.891 +20.528 25.387 +20.778 22.123 +21.028 17.351 +21.278 15.687 +21.528 11.866 +21.778 10.975 +22.028 7.641 +22.278 7.968 +22.528 5.807 +22.778 4.141 +23.028 4.276 diff --git a/app/host/SBI/snrfiles/PanSTARRS_y_magvsnr.txt b/app/host/SBI/snrfiles/PanSTARRS_y_magvsnr.txt index 953ff904..7cd7cc7c 100644 --- a/app/host/SBI/snrfiles/PanSTARRS_y_magvsnr.txt +++ b/app/host/SBI/snrfiles/PanSTARRS_y_magvsnr.txt @@ -1,44 +1,54 @@ -12.039 902.098 -12.289 823.899 -12.539 776.054 -12.789 890.464 -13.039 639.816 -13.289 728.412 -13.539 588.615 -13.789 439.420 -14.039 535.072 -14.289 407.813 -14.539 383.396 -14.789 328.718 -15.039 367.699 -15.289 238.024 -15.539 252.160 -15.789 200.699 -16.039 157.084 -16.289 167.880 -16.539 141.717 -16.789 107.414 -17.039 103.129 -17.289 82.735 -17.539 71.061 -17.789 65.141 -18.039 45.932 -18.289 52.535 -18.539 38.323 -18.789 28.730 -19.039 29.652 -19.289 22.043 -19.539 19.934 -19.789 20.146 -20.039 12.408 -20.289 13.348 -20.539 8.204 -20.789 12.074 -21.039 10.782 -21.289 9.570 -21.539 8.358 -21.789 7.147 -22.039 5.935 -22.289 4.723 -22.539 3.449 -22.789 2.175 +10.171 100.855 +10.421 100.751 +10.671 100.830 +10.921 100.909 +11.171 100.772 +11.421 100.599 +11.671 100.577 +11.921 100.490 +12.171 100.346 +12.421 100.092 +12.671 99.956 +12.921 99.703 +13.171 99.307 +13.421 98.863 +13.671 98.318 +13.921 97.615 +14.171 96.557 +14.421 95.320 +14.671 94.091 +14.921 92.214 +15.171 90.022 +15.421 87.388 +15.671 84.677 +15.921 79.527 +16.171 75.652 +16.421 71.439 +16.671 66.173 +16.921 58.636 +17.171 54.429 +17.421 47.975 +17.671 41.958 +17.921 37.210 +18.171 32.752 +18.421 28.003 +18.671 23.213 +18.921 19.934 +19.171 17.669 +19.421 14.375 +19.671 10.763 +19.921 8.721 +20.171 7.078 +20.421 6.647 +20.671 5.220 +20.921 4.648 +21.171 3.185 +21.421 2.923 +21.671 2.547 +21.921 2.175 +22.171 1.856 +22.421 1.685 +22.671 1.688 +22.921 1.584 +23.171 1.480 +23.421 1.376 diff --git a/app/host/SBI/snrfiles/PanSTARRS_z_magvsnr.txt b/app/host/SBI/snrfiles/PanSTARRS_z_magvsnr.txt index 7adeb0de..2ff5526e 100644 --- a/app/host/SBI/snrfiles/PanSTARRS_z_magvsnr.txt +++ b/app/host/SBI/snrfiles/PanSTARRS_z_magvsnr.txt @@ -1,37 +1,46 @@ -12.239 1816.051 -12.489 1579.939 -12.739 1498.990 -12.989 1771.086 -13.239 1134.047 -13.489 1366.779 -13.739 1034.712 -13.989 732.335 -14.239 1009.289 -14.489 714.963 -14.739 825.701 -14.989 634.964 -15.239 507.439 -15.489 516.615 -15.739 465.358 -15.989 403.622 -16.239 291.560 -16.489 313.410 -16.739 268.340 -16.989 230.473 -17.239 191.684 -17.489 153.529 -17.739 138.912 -17.989 119.081 -18.239 105.602 -18.489 98.028 -18.739 79.078 -18.989 62.257 -19.239 52.037 -19.489 42.552 -19.739 42.116 -19.989 33.592 -20.239 31.027 -20.489 21.277 -20.739 17.550 -20.989 24.915 -21.239 19.468 +11.216 100.842 +11.466 100.842 +11.716 100.785 +11.966 100.780 +12.216 100.781 +12.466 100.705 +12.716 100.619 +12.966 100.589 +13.216 100.424 +13.466 100.327 +13.716 100.100 +13.966 99.981 +14.216 99.606 +14.466 98.943 +14.716 98.534 +14.966 97.977 +15.216 97.197 +15.466 96.207 +15.716 94.711 +15.966 92.738 +16.216 90.892 +16.466 88.075 +16.716 85.254 +16.966 80.203 +17.216 75.828 +17.466 71.243 +17.716 65.073 +17.966 59.891 +18.216 54.283 +18.466 49.146 +18.716 42.882 +18.966 38.119 +19.216 32.312 +19.466 28.016 +19.716 22.871 +19.966 20.083 +20.216 16.514 +20.466 13.327 +20.716 11.178 +20.966 9.834 +21.216 8.436 +21.466 6.318 +21.716 5.470 +21.966 3.956 +22.216 2.724 +22.466 2.920 diff --git a/app/host/SBI/snrfiles/WISE_W1_magvsnr.txt b/app/host/SBI/snrfiles/WISE_W1_magvsnr.txt index a3c44685..1e6b6c99 100644 --- a/app/host/SBI/snrfiles/WISE_W1_magvsnr.txt +++ b/app/host/SBI/snrfiles/WISE_W1_magvsnr.txt @@ -1,46 +1,48 @@ -9.955 896.428 -10.205 868.423 -10.455 580.398 -10.705 819.889 -10.955 571.307 -11.205 477.974 -11.455 496.780 -11.705 432.305 -11.955 388.522 -12.205 318.152 -12.455 284.307 -12.705 319.957 -12.955 291.065 -13.205 170.694 -13.455 142.471 -13.705 245.832 -13.955 119.919 -14.205 139.959 -14.455 112.439 -14.705 94.710 -14.955 66.742 -15.205 86.793 -15.455 78.766 -15.705 68.093 -15.955 63.871 -16.205 48.698 -16.455 30.150 -16.705 48.499 -16.955 18.986 -17.205 27.107 -17.455 21.494 -17.705 26.835 -17.955 30.779 -18.205 17.344 -18.455 7.609 -18.705 7.996 -18.955 8.383 -19.205 10.515 -19.455 7.607 -19.705 4.653 -19.955 4.879 -20.205 5.105 -20.455 5.330 -20.705 5.556 -20.955 5.782 -21.205 3.417 +11.421 81.562 +11.671 80.036 +11.921 78.509 +12.171 76.982 +12.421 74.416 +12.671 83.074 +12.921 82.332 +13.171 83.604 +13.421 79.005 +13.671 71.284 +13.921 72.609 +14.171 71.202 +14.421 67.648 +14.671 62.358 +14.921 60.082 +15.171 53.535 +15.421 47.920 +15.671 43.430 +15.921 38.044 +16.171 34.270 +16.421 29.840 +16.671 25.689 +16.921 21.927 +17.171 19.450 +17.421 16.047 +17.671 13.588 +17.921 12.139 +18.171 10.255 +18.421 9.146 +18.671 8.007 +18.921 7.013 +19.171 6.230 +19.421 5.499 +19.671 4.488 +19.921 4.180 +20.171 3.436 +20.421 3.011 +20.671 2.676 +20.921 2.492 +21.171 2.338 +21.421 1.928 +21.671 1.697 +21.921 1.574 +22.171 1.491 +22.421 1.408 +22.671 1.329 +22.921 1.216 +23.171 1.163 diff --git a/app/host/SBI/snrfiles/WISE_W2_magvsnr.txt b/app/host/SBI/snrfiles/WISE_W2_magvsnr.txt index f5004e81..31551d25 100644 --- a/app/host/SBI/snrfiles/WISE_W2_magvsnr.txt +++ b/app/host/SBI/snrfiles/WISE_W2_magvsnr.txt @@ -1,46 +1,50 @@ -9.589 569.064 -9.839 566.647 -10.089 564.231 -10.339 476.468 -10.589 437.646 -10.839 379.485 -11.089 304.809 -11.339 302.738 -11.589 256.046 -11.839 252.251 -12.089 116.095 -12.339 204.962 -12.589 170.444 -12.839 181.098 -13.089 105.873 -13.339 93.013 -13.589 134.440 -13.839 99.905 -14.089 63.594 -14.339 72.594 -14.589 69.651 -14.839 35.510 -15.089 41.823 -15.339 53.339 -15.589 36.689 -15.839 29.656 -16.089 25.770 -16.339 26.362 -16.589 18.262 -16.839 19.280 -17.089 15.059 -17.339 18.528 -17.589 18.100 -17.839 14.429 -18.089 10.376 -18.339 3.785 -18.589 5.034 -18.839 6.282 -19.089 5.212 -19.339 4.833 -19.589 4.455 -19.839 3.528 -20.089 2.600 -20.339 2.936 -20.589 3.272 -20.839 2.582 +11.175 56.366 +11.425 64.705 +11.675 73.043 +11.925 68.559 +12.175 64.075 +12.425 62.395 +12.675 60.715 +12.925 73.092 +13.175 68.606 +13.425 74.178 +13.675 70.432 +13.925 60.447 +14.175 59.342 +14.425 54.275 +14.675 52.919 +14.925 46.988 +15.175 42.299 +15.425 38.625 +15.675 34.378 +15.925 29.311 +16.175 26.561 +16.425 22.010 +16.675 19.624 +16.925 16.404 +17.175 13.789 +17.425 12.413 +17.675 10.520 +17.925 9.091 +18.175 7.793 +18.425 6.618 +18.675 5.958 +18.925 5.110 +19.175 4.489 +19.425 3.993 +19.675 3.711 +19.925 3.208 +20.175 2.994 +20.425 2.591 +20.675 2.226 +20.925 1.876 +21.175 1.794 +21.425 1.666 +21.675 1.447 +21.925 1.428 +22.175 1.294 +22.425 1.244 +22.675 1.207 +22.925 1.170 +23.175 1.134 +23.425 1.097 diff --git a/app/host/SBI/snrfiles/WISE_W3_magvsnr.txt b/app/host/SBI/snrfiles/WISE_W3_magvsnr.txt index 7e515c3d..773f29bc 100644 --- a/app/host/SBI/snrfiles/WISE_W3_magvsnr.txt +++ b/app/host/SBI/snrfiles/WISE_W3_magvsnr.txt @@ -1,42 +1,47 @@ -6.708 123.838 -6.958 172.067 -7.208 220.297 -7.458 268.526 -7.708 718.484 -7.958 427.705 -8.208 281.304 -8.458 334.133 -8.708 137.463 -8.958 177.734 -9.208 133.900 -9.458 96.406 -9.708 155.706 -9.958 99.294 -10.208 137.089 -10.458 129.070 -10.708 48.637 -10.958 91.261 -11.208 56.861 -11.458 65.960 -11.708 54.875 -11.958 55.912 -12.208 54.285 -12.458 53.958 -12.708 22.026 -12.958 30.829 -13.208 14.193 -13.458 13.210 -13.708 17.521 -13.958 10.946 -14.208 14.874 -14.458 7.505 -14.708 6.917 -14.958 9.443 -15.208 6.776 -15.458 4.108 -15.708 5.635 -15.958 4.907 -16.208 2.644 -16.458 2.634 -16.708 2.261 -16.958 2.909 +10.270 41.967 +10.520 52.237 +10.770 62.506 +11.020 72.776 +11.270 55.592 +11.520 54.146 +11.770 60.252 +12.020 66.946 +12.270 60.385 +12.520 62.022 +12.770 57.997 +13.020 50.906 +13.270 44.363 +13.520 43.877 +13.770 38.099 +14.020 33.004 +14.270 28.200 +14.520 22.417 +14.770 19.431 +15.020 16.171 +15.270 14.212 +15.520 11.781 +15.770 9.887 +16.020 8.790 +16.270 7.160 +16.520 6.203 +16.770 5.367 +17.020 4.849 +17.270 4.361 +17.520 3.834 +17.770 3.317 +18.020 2.939 +18.270 2.728 +18.520 2.436 +18.770 2.287 +19.020 1.915 +19.270 1.871 +19.520 1.643 +19.770 1.573 +20.020 1.342 +20.270 1.336 +20.520 1.309 +20.770 1.232 +21.020 1.181 +21.270 1.127 +21.520 1.110 +21.770 1.086 diff --git a/app/host/SBI/snrfiles/WISE_W4_magvsnr.txt b/app/host/SBI/snrfiles/WISE_W4_magvsnr.txt index 8244284d..b10002e4 100644 --- a/app/host/SBI/snrfiles/WISE_W4_magvsnr.txt +++ b/app/host/SBI/snrfiles/WISE_W4_magvsnr.txt @@ -1,44 +1,49 @@ -5.363 150.200 -5.613 164.116 -5.863 178.032 -6.113 111.280 -6.363 116.695 -6.613 85.341 -6.863 90.811 -7.113 99.952 -7.363 37.822 -7.613 44.851 -7.863 25.629 -8.113 26.360 -8.363 23.568 -8.613 25.448 -8.863 26.994 -9.113 22.456 -9.363 28.704 -9.613 22.412 -9.863 13.099 -10.113 14.707 -10.363 15.735 -10.613 12.176 -10.863 8.584 -11.113 10.425 -11.363 7.485 -11.613 7.685 -11.863 6.615 -12.113 5.545 -12.363 5.060 -12.613 4.973 -12.863 4.023 -13.113 3.073 -13.363 2.698 -13.613 2.126 -13.863 4.472 -14.113 1.762 -14.363 1.467 -14.613 1.173 -14.863 1.677 -15.113 1.330 -15.363 1.101 -15.613 1.011 -15.863 0.920 -16.113 0.830 +9.008 27.814 +9.258 27.402 +9.508 26.991 +9.758 26.579 +10.008 26.168 +10.258 25.756 +10.508 25.344 +10.758 29.031 +11.008 28.147 +11.258 21.571 +11.508 22.842 +11.758 20.804 +12.008 21.796 +12.258 19.685 +12.508 15.960 +12.758 14.327 +13.008 12.180 +13.258 10.657 +13.508 8.945 +13.758 8.178 +14.008 6.936 +14.258 5.869 +14.508 5.382 +14.758 4.548 +15.008 4.081 +15.258 3.520 +15.508 3.382 +15.758 3.037 +16.008 2.756 +16.258 2.462 +16.508 2.276 +16.758 2.018 +17.008 1.875 +17.258 1.838 +17.508 1.593 +17.758 1.617 +18.008 1.376 +18.258 1.396 +18.508 1.264 +18.758 1.180 +19.008 1.172 +19.258 1.114 +19.508 1.065 +19.758 1.115 +20.008 1.042 +20.258 1.037 +20.508 1.032 +20.758 1.024 +21.008 1.016 diff --git a/app/host/SBI/snrfiles/lsst_g_magvsnr.txt b/app/host/SBI/snrfiles/lsst_g_magvsnr.txt new file mode 100644 index 00000000..b5673234 --- /dev/null +++ b/app/host/SBI/snrfiles/lsst_g_magvsnr.txt @@ -0,0 +1,35 @@ +20.774 100.000 +21.024 100.000 +21.274 100.000 +21.524 100.000 +21.774 100.000 +22.024 100.000 +22.274 100.000 +22.524 100.000 +22.774 100.000 +23.024 100.000 +23.274 100.000 +23.524 98.644 +23.774 85.937 +24.024 69.695 +24.274 57.643 +24.524 46.312 +24.774 37.435 +25.024 29.833 +25.274 24.016 +25.524 19.383 +25.774 15.463 +26.024 12.371 +26.274 9.943 +26.524 8.003 +26.774 6.498 +27.024 5.322 +27.274 4.363 +27.524 3.531 +27.774 2.938 +28.024 2.482 +28.274 2.102 +28.524 1.879 +28.774 1.725 +29.024 1.616 +29.274 1.474 diff --git a/app/host/SBI/snrfiles/lsst_i_magvsnr.txt b/app/host/SBI/snrfiles/lsst_i_magvsnr.txt new file mode 100644 index 00000000..d325a8dd --- /dev/null +++ b/app/host/SBI/snrfiles/lsst_i_magvsnr.txt @@ -0,0 +1,32 @@ +19.443 100.000 +19.693 100.000 +19.943 100.000 +20.193 100.000 +20.443 100.000 +20.693 100.000 +20.943 100.000 +21.193 100.000 +21.443 100.000 +21.693 100.000 +21.943 100.000 +22.193 100.000 +22.443 100.000 +22.693 100.000 +22.943 100.000 +23.193 99.618 +23.443 86.960 +23.693 72.218 +23.943 58.795 +24.193 47.255 +24.443 38.099 +24.693 30.442 +24.943 24.420 +25.193 19.682 +25.443 15.600 +25.693 12.620 +25.943 10.146 +26.193 8.302 +26.443 7.181 +26.693 6.745 +26.943 6.407 +27.193 5.416 diff --git a/app/host/SBI/snrfiles/lsst_r_magvsnr.txt b/app/host/SBI/snrfiles/lsst_r_magvsnr.txt new file mode 100644 index 00000000..eff0dcd0 --- /dev/null +++ b/app/host/SBI/snrfiles/lsst_r_magvsnr.txt @@ -0,0 +1,33 @@ +19.902 100.000 +20.152 100.000 +20.402 100.000 +20.652 100.000 +20.902 100.000 +21.152 100.000 +21.402 100.000 +21.652 100.000 +21.902 100.000 +22.152 100.000 +22.402 100.000 +22.652 100.000 +22.902 100.000 +23.152 100.000 +23.402 100.000 +23.652 97.907 +23.902 84.755 +24.152 68.799 +24.402 56.044 +24.652 45.597 +24.902 36.172 +25.152 29.111 +25.402 23.287 +25.652 18.654 +25.902 14.948 +26.152 12.095 +26.402 9.745 +26.652 7.879 +26.902 6.387 +27.152 5.187 +27.402 4.295 +27.652 3.480 +27.902 3.100 diff --git a/app/host/SBI/snrfiles/lsst_u_magvsnr.txt b/app/host/SBI/snrfiles/lsst_u_magvsnr.txt new file mode 100644 index 00000000..6e31665e --- /dev/null +++ b/app/host/SBI/snrfiles/lsst_u_magvsnr.txt @@ -0,0 +1,39 @@ +21.522 100.000 +21.772 99.972 +22.022 85.932 +22.272 70.884 +22.522 59.555 +22.772 46.436 +23.022 38.181 +23.272 31.417 +23.522 24.924 +23.772 20.291 +24.022 16.108 +24.272 12.812 +24.522 10.341 +24.772 8.416 +25.022 6.697 +25.272 5.495 +25.522 4.477 +25.772 3.609 +26.022 3.003 +26.272 2.556 +26.522 2.230 +26.772 1.951 +27.022 1.738 +27.272 1.650 +27.522 1.561 +27.772 1.439 +28.022 1.388 +28.272 1.317 +28.522 1.355 +28.772 1.282 +29.022 1.247 +29.272 1.310 +29.522 1.291 +29.772 1.212 +30.022 1.216 +30.272 1.247 +30.522 1.219 +30.772 1.174 +31.022 1.000 diff --git a/app/host/SBI/snrfiles/lsst_y_magvsnr.txt b/app/host/SBI/snrfiles/lsst_y_magvsnr.txt new file mode 100644 index 00000000..a810e834 --- /dev/null +++ b/app/host/SBI/snrfiles/lsst_y_magvsnr.txt @@ -0,0 +1,33 @@ +18.961 100.000 +19.211 100.000 +19.461 100.000 +19.711 100.000 +19.961 100.000 +20.211 100.000 +20.461 100.000 +20.711 100.000 +20.961 100.000 +21.211 100.000 +21.461 100.000 +21.711 98.221 +21.961 84.890 +22.211 69.394 +22.461 56.233 +22.711 45.773 +22.961 36.607 +23.211 29.023 +23.461 23.550 +23.711 18.677 +23.961 15.089 +24.211 12.154 +24.461 9.662 +24.711 7.814 +24.961 6.374 +25.211 5.196 +25.461 4.233 +25.711 3.480 +25.961 2.852 +26.211 2.517 +26.461 2.113 +26.711 1.902 +26.961 1.730 diff --git a/app/host/SBI/snrfiles/lsst_z_magvsnr.txt b/app/host/SBI/snrfiles/lsst_z_magvsnr.txt new file mode 100644 index 00000000..cd53f4c0 --- /dev/null +++ b/app/host/SBI/snrfiles/lsst_z_magvsnr.txt @@ -0,0 +1,32 @@ +19.171 100.000 +19.421 100.000 +19.671 100.000 +19.921 100.000 +20.171 100.000 +20.421 100.000 +20.671 100.000 +20.921 100.000 +21.171 100.000 +21.421 100.000 +21.671 100.000 +21.921 100.000 +22.171 100.000 +22.421 100.000 +22.671 96.243 +22.921 80.587 +23.171 65.790 +23.421 53.449 +23.671 43.420 +23.921 34.837 +24.171 27.974 +24.421 22.189 +24.671 18.074 +24.921 14.513 +25.171 11.531 +25.421 9.260 +25.671 7.553 +25.921 6.085 +26.171 4.953 +26.421 4.069 +26.671 3.505 +26.921 2.799 diff --git a/app/host/debug_utils.py b/app/host/debug_utils.py index e0daf3d4..c0c4f0c4 100644 --- a/app/host/debug_utils.py +++ b/app/host/debug_utils.py @@ -56,7 +56,10 @@ def rerun_failed_task(task_register): TNSDataIngestion(), InitializeTransientTasks(), IngestMissedTNSTransients(), - SnapshotTaskRegister() + SnapshotTaskRegister(), + LocalAperturePhotometryZPhot(task_register.transient.name), + ValidateLocalPhotometryZPhot(task_register.transient.name), + LocalHostSEDFittingZPhot(task_register.transient.name), ] diff --git a/app/host/migrations/0037_load_new_task_fixtures.py b/app/host/migrations/0037_load_new_task_fixtures.py new file mode 100644 index 00000000..2acbe0f5 --- /dev/null +++ b/app/host/migrations/0037_load_new_task_fixtures.py @@ -0,0 +1,20 @@ +from django.db import migrations + +def load_tasks(apps, schema_editor): + Task = apps.get_model("host", "Task") + for name in [ + 'Local aperture photometry photo-z', + 'Validate local photometry photo-z', + 'Local host SED inference photo-z' + ]: + Task(name=name).save() + +class Migration(migrations.Migration): + + dependencies = [ + ('host', '0036_usagemetricslog_request_user_agent'), + ] + + operations = [ + migrations.RunPython(load_tasks), + ] diff --git a/app/host/models.py b/app/host/models.py index 08606262..86c84444 100644 --- a/app/host/models.py +++ b/app/host/models.py @@ -154,6 +154,7 @@ def best_redshift(self): z = None return z + @property def best_spec_redshift(self): """get the best redshift for a transient""" if self.host is not None and self.host.redshift is not None: diff --git a/app/host/postprocess_prosp.py b/app/host/postprocess_prosp.py index fd929cc1..7f802422 100644 --- a/app/host/postprocess_prosp.py +++ b/app/host/postprocess_prosp.py @@ -47,6 +47,7 @@ def theta_index(prior="p-alpha"): "log_duste_gamma": slice(17, 18, None), } + return index @@ -267,6 +268,7 @@ def run_all( percents=[15.9, 50, 84.1], use_weights=True, obs=None, + has_specz=False, **extra ): # XXX read in prospector outputs @@ -300,6 +302,8 @@ def run_all( "duste_umin", "log_duste_gamma", ] + if not has_specz: + keys += ["zred"] percentiles, chains, sub_idx = get_all_outputs_and_chains(res, keys=keys, zred=zred) # ---------- total mass formed -> stellar mass @@ -309,7 +313,10 @@ def run_all( modspecs_all = [] for i, _subidx in enumerate(sub_idx): - modspec, modmags, sm = mod_fsps.predict(res['chain'][int(_subidx)], sps=sps, obs=obs) + if has_specz: + modspec, modmags, sm = mod_fsps.predict(res['chain'][int(_subidx)][1:], sps=sps, obs=obs) + else: + modspec, modmags, sm = mod_fsps.predict(res['chain'][int(_subidx)], sps=sps, obs=obs) modphots_all.append(modmags) # model photometry modspecs_all.append(modspec) # model spectrum _mass = res['chain'][int(_subidx)][mass_idx] diff --git a/app/host/prospector.py b/app/host/prospector.py index 85d0bfb9..e64f94b9 100644 --- a/app/host/prospector.py +++ b/app/host/prospector.py @@ -88,7 +88,7 @@ def psi_from_sfh(mass, tage, tau): ) -def build_obs(transient, aperture_type, use_mag_offset=True): +def build_obs(transient, aperture_type, use_mag_offset=True, z=None): """ This functions is required by prospector and should return a dictionary defined by @@ -111,7 +111,7 @@ def build_obs(transient, aperture_type, use_mag_offset=True): if transient.host is None: raise ValueError("No host galaxy match") - z = transient.best_redshift + if z is not None and z < 0.015 and use_mag_offset: mag_offset = cosmo.distmod(z + 0.015).value - cosmo.distmod(z).value z += 0.015 @@ -192,7 +192,7 @@ def build_obs(transient, aperture_type, use_mag_offset=True): return fix_obs(obs_data) -def build_model_nonparam(obs=None, **extras): +def build_model_nonparam(obs=None, z=None, **extras): """prospector-alpha""" fit_order = [ "zred", @@ -217,9 +217,9 @@ def build_model_nonparam(obs=None, **extras): # --- BASIC PARAMETERS --- model_params["zred"] = { "N": 1, - "isfree": True, - "init": 0.5, - "prior": priors.FastUniform(a=0, b=0.2), + "isfree": z is None, + "init": z if z is not None else 0.3, + "prior": priors.FastUniform(a=0, b=0.6), } model_params["logmass"] = { @@ -314,8 +314,8 @@ def logsfr_ratios_to_masses( model_params["agebins"] = { "N": 7, - "isfree": False, - "init": zred_to_agebins(np.atleast_1d(0.5)), + "isfree": z is None, # I think agebins should be free to vary in phot-z case? + "init": zred_to_agebins(np.atleast_1d(z if z is not None else 0.3)), "prior": None, "depends_on": zred_to_agebins, } @@ -364,273 +364,7 @@ def to_dust1(dust1_fraction=None, dust1=None, dust2=None, **extras): # --- Nebular Emission --- model_params["add_neb_emission"] = {"N": 1, "isfree": False, "init": True} model_params["add_neb_continuum"] = {"N": 1, "isfree": False, "init": True} - model_params["gas_logz"] = { - "N": 1, - "isfree": True, - "init": -0.5, - "units": r"log Z/Z_\odot", - "prior": priors.FastUniform(a=-2.0, b=0.5), - } - model_params["gas_logu"] = { - "N": 1, - "isfree": False, - "init": -1.0, - "units": r"Q_H/N_H", - "prior": priors.FastUniform(a=-4, b=-1), - } - - # --- AGN dust --- - model_params["add_agn_dust"] = {"N": 1, "isfree": False, "init": True} - - model_params["log_fagn"] = { - "N": 1, - "isfree": True, - "init": -7.0e-5, - "prior": priors.FastUniform(a=-5.0, b=-4.9), - } - - def to_fagn(log_fagn=None, **extras): - return 10**log_fagn - - model_params["fagn"] = {"N": 1, "isfree": False, "init": 0, "depends_on": to_fagn} - - model_params["log_agn_tau"] = { - "N": 1, - "isfree": True, - "init": np.log10(20.0), - "prior": priors.FastUniform(a=np.log10(15.0), b=np.log10(15.1)), - } - - def to_agn_tau(log_agn_tau=None, **extras): - return 10**log_agn_tau - - model_params["agn_tau"] = { - "N": 1, - "isfree": False, - "init": 0, - "depends_on": to_agn_tau, - } - - # --- Dust Emission --- - model_params["duste_qpah"] = { - "N": 1, - "isfree": True, - "init": 2.0, - "prior": priors.FastTruncatedNormal(a=0.9, b=1.1, mu=2.0, sig=2.0), - } - - model_params["duste_umin"] = { - "N": 1, - "isfree": True, - "init": 1.0, - "prior": priors.FastTruncatedNormal(a=0.9, b=1.1, mu=1.0, sig=10.0), - } - - model_params["log_duste_gamma"] = { - "N": 1, - "isfree": True, - "init": -2.0, - "prior": priors.FastTruncatedNormal(a=-2.1, b=-1.9, mu=-2.0, sig=1.0), - } - - def to_duste_gamma(log_duste_gamma=None, **extras): - return 10**log_duste_gamma - - model_params["duste_gamma"] = { - "N": 1, - "isfree": False, - "init": 0, - "depends_on": to_duste_gamma, - } - - # ---- Units ---- - model_params["peraa"] = {"N": 1, "isfree": False, "init": False} - - model_params["mass_units"] = {"N": 1, "isfree": False, "init": "mformed"} - - tparams = {} - for i in fit_order: - tparams[i] = model_params[i] - for i in list(model_params.keys()): - if i not in fit_order: - tparams[i] = model_params[i] - model_params = tparams - - return PolySpecModel(model_params) - - -def build_model_nonparam_bkp(obs=None, **extras): - """prospector-alpha""" - fit_order = [ - "zred", - "logmass", - "logzsol", - "logsfr_ratios", - "dust2", - "dust_index", - "dust1_fraction", - "log_fagn", - "log_agn_tau", - "gas_logz", - "duste_qpah", - "duste_umin", - "log_duste_gamma", - ] - - # ------------- - # MODEL_PARAMS - model_params = {} - - # --- BASIC PARAMETERS --- - model_params["zred"] = { - "N": 1, - "isfree": False, - "init": obs["redshift"], - # "prior": priors.FastUniform(a=0, b=0.2), - } - - model_params["logmass"] = { - "N": 1, - "isfree": True, - "init": 8.0, - "units": "Msun", - "prior": priors.FastUniform(a=7.0, b=12.5), - } - - model_params["logzsol"] = { - "N": 1, - "isfree": True, - "init": -0.5, - "units": r"$\log (Z/Z_\odot)$", - "prior": priors.FastUniform(a=-1.98, b=0.19), - } - - model_params["imf_type"] = { - "N": 1, - "isfree": False, - "init": 1, # 1 = chabrier - "units": None, - "prior": None, - } - model_params["add_igm_absorption"] = {"N": 1, "isfree": False, "init": True} - model_params["add_agb_dust_model"] = {"N": 1, "isfree": False, "init": True} - model_params["pmetals"] = {"N": 1, "isfree": False, "init": -99} - - # --- SFH --- - nbins_sfh = 7 - model_params["sfh"] = {"N": 1, "isfree": False, "init": 3} - model_params["logsfr_ratios"] = { - "N": 6, - "isfree": True, - "init": 0.0, - "prior": priors.FastTruncatedEvenStudentTFreeDeg2( - hw=np.ones(6) * 5.0, sig=np.ones(6) * 0.3 - ), - } - - # add redshift scaling to agebins, such that - # t_max = t_univ - def zred_to_agebins(zred=None, **extras): - amin = 7.1295 - nbins_sfh = 7 - tuniv = cosmo.age(zred)[0].value * 1e9 - tbinmax = tuniv * 0.9 - if zred <= 3.0: - agelims = ( - [0.0, 7.47712] - + np.linspace(8.0, np.log10(tbinmax), nbins_sfh - 2).tolist() - + [np.log10(tuniv)] - ) - else: - agelims = np.linspace(amin, np.log10(tbinmax), nbins_sfh).tolist() + [ - np.log10(tuniv) - ] - agelims[0] = 0 - agebins = np.array([agelims[:-1], agelims[1:]]) - return agebins.T - - def logsfr_ratios_to_masses( - logmass=None, logsfr_ratios=None, agebins=None, **extras - ): - """This converts from an array of log_10(SFR_j / SFR_{j+1}) and a value of - log10(\Sum_i M_i) to values of M_i. j=0 is the most recent bin in lookback - time. - """ - nbins = agebins.shape[0] - sratios = 10 ** np.clip(logsfr_ratios, -100, 100) - dt = 10 ** agebins[:, 1] - 10 ** agebins[:, 0] - coeffs = np.array( - [ - (1.0 / np.prod(sratios[:i])) - * (np.prod(dt[1 : i + 1]) / np.prod(dt[:i])) - for i in range(nbins) - ] - ) - m1 = (10**logmass) / coeffs.sum() - - return m1 * coeffs - - model_params["mass"] = { - "N": 7, - "isfree": False, - "init": 1e6, - "units": r"M$_\odot$", - "depends_on": logsfr_ratios_to_masses, - } - - model_params["agebins"] = { - "N": 7, - "isfree": False, - "init": zred_to_agebins(np.atleast_1d(0.5)), - "prior": None, - "depends_on": zred_to_agebins, - } - - # --- Dust Absorption --- - model_params["dust_type"] = { - "N": 1, - "isfree": False, - "init": 4, - "units": "FSPS index", - } - model_params["dust1_fraction"] = { - "N": 1, - "isfree": True, - "init": 1.0, - "prior": priors.FastTruncatedNormal(a=0.0, b=2.0, mu=1.0, sig=0.3), - } - - model_params["dust2"] = { - "N": 1, - "isfree": True, - "init": 0.0, - "units": "", - "prior": priors.FastTruncatedNormal(a=0.0, b=4.0, mu=0.3, sig=1.0), - } - - def to_dust1(dust1_fraction=None, dust1=None, dust2=None, **extras): - return dust1_fraction * dust2 - - model_params["dust1"] = { - "N": 1, - "isfree": False, - "depends_on": to_dust1, - "init": 0.0, - "units": "optical depth towards young stars", - "prior": None, - } - model_params["dust_index"] = { - "N": 1, - "isfree": True, - "init": 0.7, - "units": "", - "prior": priors.FastUniform(a=-1.0, b=0.4), - } - - # --- Nebular Emission --- - model_params["add_neb_emission"] = {"N": 1, "isfree": False, "init": True} - model_params["add_neb_continuum"] = {"N": 1, "isfree": False, "init": True} model_params["gas_logz"] = { "N": 1, "isfree": True, @@ -638,6 +372,7 @@ def to_dust1(dust1_fraction=None, dust1=None, dust2=None, **extras): "units": r"log Z/Z_\odot", "prior": priors.FastUniform(a=-2.0, b=0.5), } + model_params["gas_logu"] = { "N": 1, "isfree": False, @@ -725,20 +460,19 @@ def to_duste_gamma(log_duste_gamma=None, **extras): return PolySpecModel(model_params) - -def build_model(observations): +def build_model(observations,z): """ Construct all model components """ - model = build_model_nonparam(observations) + model = build_model_nonparam(observations,z) sps = FastStepBasis(zcontinuous=2, compute_vega_mags=False) noise_model = (None, None) return {"model": model, "sps": sps, "noise_model": noise_model} def fit_model( - observations, model_components, fitting_kwargs, sbipp=False, fit_type="global" + observations, model_components, fitting_kwargs, sbipp=False ): """Fit the model""" @@ -747,7 +481,7 @@ def fit_model( # actually necessary when a task requires it. from host.SBI.run_sbi_blast import fit_sbi_pp - output, errflag = fit_sbi_pp(observations, fit_type=fit_type) + output, errflag = fit_sbi_pp(observations) else: output = fit_model_prospect( observations, @@ -828,7 +562,10 @@ def prospector_result_to_blast( theta = resultpars["chain"][ np.random.choice(np.arange(np.shape(resultpars["chain"])[0])), : ] - theta[0] = observations["redshift"] + if 'zred' not in model_components['model'].theta_labels(): + theta = theta[1:] + else: + theta[0] = observations["redshift"] if i == 0: best_spec, best_phot, mfrac = model_components["model"].predict( theta, obs=observations, sps=model_components["sps"] @@ -869,6 +606,7 @@ def prospector_result_to_blast( use_weights=use_weights, sbipp=sbipp, obs=observations, + has_specz = transient.best_spec_redshift is not None ) percentiles = np.load( @@ -887,11 +625,19 @@ def prospector_result_to_blast( dust1_fraction_16, dust1_fraction_50, dust1_fraction_84 = perc['dust1_fraction'] log_fagn_16, log_fagn_50, log_fagn_84 = perc['log_fagn'] log_agn_tau_16, log_agn_tau_50, log_agn_tau_84 = perc['log_agn_tau'] + gas_logz_16, gas_logz_50, gas_logz_84 = perc['gas_logz'] duste_qpah_16, duste_qpah_50, duste_qpah_84 = perc['duste_qpah'] duste_umin_16, duste_umin_50, duste_umin_84 = perc['duste_umin'] log_duste_gamma_16, log_duste_gamma_50, log_duste_gamma_84 = perc['log_duste_gamma'] - + if 'zred' in perc.keys(): + z16, z50, z84 = perc["zred"] + photo_z = z50 + photo_z_err = ((z50-z16)+(z84-z50))/2. + z_results = (photo_z,photo_z_err) + else: + z_results = (None,None) + # just use allsfhs from postprocess_prosp # and z_to_agebins # re-work in terms of lookback time and un-log the ages @@ -992,4 +738,4 @@ def prospector_result_to_blast( s3.put_object(path=object_key, file_path=file_path) assert s3.object_exists(object_key) os.remove(file_path) - return prosp_results, sfh_results + return prosp_results, sfh_results, z_results diff --git a/app/host/prost.py b/app/host/prost.py index 9a5c8a0c..7d68ae39 100644 --- a/app/host/prost.py +++ b/app/host/prost.py @@ -93,9 +93,11 @@ def run_prost(transient, output_dir_root=settings.PROST_OUTPUT_ROOT): if hosts['host_redshift_info'][0] == 'SPEC': host.redshift = hosts["host_redshift_mean"][0] host.redshift_err = hosts["host_redshift_std"][0] - elif hosts['host_redshift_info'][0] == 'PHOT' and hosts['best_cat'][0] != 'panstarrs': - host.photometric_redshift = hosts["host_redshift_mean"][0] - host.photometric_redshift_err = hosts["host_redshift_std"][0] + + # 8/15/25: removing photo-z -- we're going to estimate from prospector directly + #elif hosts['host_redshift_info'][0] == 'PHOT' and hosts['best_cat'][0] != 'panstarrs': + # host.photometric_redshift = hosts["host_redshift_mean"][0] + # host.photometric_redshift_err = hosts["host_redshift_std"][0] finally: # Cleanup Prost file cache # TODO: Over time we may accumulate Prost temp files that are not deleted diff --git a/app/host/transient_tasks.py b/app/host/transient_tasks.py index 0b0b325d..11cb13c2 100644 --- a/app/host/transient_tasks.py +++ b/app/host/transient_tasks.py @@ -1081,7 +1081,8 @@ class HostSEDFitting(TransientTaskRunner): """Task Runner to run host galaxy inference with prospector""" def _run_process( - self, transient, aperture_type="global", mode="fast", sbipp=True, save=True + self, transient, aperture_type="global", + mode="fast", sbipp=True, save=True ): """Run the SED-fitting task""" @@ -1090,16 +1091,24 @@ def _run_process( "type__exact": aperture_type, } - if transient.best_redshift is None or transient.best_redshift > 0.2: - # training sample doesn't work here - return "redshift too high" - + if aperture_type == "global": + if transient.best_spec_redshift is not None and transient.best_spec_redshift > 1.5: + # training sample doesn't work here + return "redshift too high" + z = transient.best_spec_redshift + else: + if transient.best_redshift is not None and transient.best_redshift > 1.5: + # training sample doesn't work here + return "redshift too high" + z = transient.best_redshift + + aperture = Aperture.objects.filter(**query) if len(aperture) == 0: raise RuntimeError(f"no apertures found for transient {transient.name}") - observations = build_obs(transient, aperture_type) - model_components = build_model(observations) + observations = build_obs(transient, aperture_type, z=z) + model_components = build_model(observations,z=z) if mode == "test" and not sbipp: # garbage results but the test runs @@ -1135,8 +1144,7 @@ def _run_process( observations, model_components, fitting_settings, - sbipp=sbipp, - fit_type=aperture_type, + sbipp=sbipp ) if errflag: return "not enough filters" @@ -1151,7 +1159,7 @@ def _run_process( sed_output_root="/tmp", ) else: - prosp_results, sfh_results = prospector_result_to_blast( + prosp_results, sfh_results, z_results = prospector_result_to_blast( transient, aperture[0], posterior, @@ -1160,6 +1168,10 @@ def _run_process( sbipp=sbipp, ) if save: + if z_results[0] is not None: + transient.host.photometric_redshift = z_results[0] + transient.host.photometric_redshift_err = z_results[1] + transient.host.save() pr = SEDFittingResult.objects.filter( transient=transient, aperture__type=aperture_type ) @@ -1269,6 +1281,95 @@ def _run_process(self, transient, mode="fast", save=True): return status_message +# Photo-z versions of local +class LocalAperturePhotometryZPhot(LocalAperturePhotometry): + """Task Runner to perform local aperture photometry around host""" + + def _prerequisites(self): + """ + Need both the Cutout and Host match to be processed + """ + return { + "Cutout download": "processed", + "Transient information": "processed", + "Transient MWEBV": "processed", + "Host match": "processed", + "Host information": "processed", + # Note: + # we want local aperture phot to be either + # `not processed` or `failed`. Since `or` + # condition not part of prereqs, we can just + # rerun aperture phot and stop on the next + # step + "Validate local photometry": "not processed", + "Global host SED inference": "processed", + } + + @property + def task_name(self): + """ + Task status to be altered is Local Aperture photometry + """ + return "Local aperture photometry photo-z" + + +class ValidateLocalPhotometryZPhot(ValidateLocalPhotometry): + """ + TaskRunner to validate the local photometry. + We need to make sure image seeing is ~smaller than the aperture size + """ + + def _prerequisites(self): + """ + Prerequisites are that the validate local photometry task is + not processed and the local photometry task is processed. + """ + return { + "Cutout download": "processed", + "Transient information": "processed", + "Transient MWEBV": "processed", + "Host match": "processed", + "Host information": "processed", + "Local aperture photometry photo-z": "processed", + "Validate local photometry": "not processed", + "Global host SED inference": "processed", + } + + @property + def task_name(self): + """ + Task status to be altered is Local Aperture photometry + """ + return "Validate local photometry photo-z" + + + +class LocalHostSEDFittingZPhot(LocalHostSEDFitting): + """Task Runner to run local host galaxy inference with prospector""" + + def _prerequisites(self): + """ + Need both the Cutout and Host match to be processed + """ + return { + "Cutout download": "processed", + "Transient information": "processed", + "Transient MWEBV": "processed", + "Host match": "processed", + "Host information": "processed", + "Validate local photometry photo-z": "processed", + "Local host SED inference": "not processed", + "Global host SED inference": "processed", + } + + @property + def task_name(self): + """ + Task status to be altered is Local Aperture photometry + """ + return "Local host SED inference photo-z" + + # Transient workflow tasks @@ -1384,7 +1485,33 @@ def validate_global_photometry(transient_name): def validate_local_photometry(transient_name): ValidateLocalPhotometry(transient_name).run_process() +#### photometric redshift local tasks #### +@shared_task( + name="Validate Local Photometry Photo-z", + time_limit=task_time_limit, + soft_time_limit=task_soft_time_limit, +) +def validate_local_photometry_zphot(transient_name): + ValidateLocalPhotometryZPhot(transient_name).run_process() + +@shared_task( + name="Local Aperture Photometry Photo-z", + time_limit=task_time_limit, + soft_time_limit=task_soft_time_limit, +) +def local_aperture_photometry_zphot(transient_name): + LocalAperturePhotometryZPhot(transient_name).run_process() + + +@shared_task( + name="Local Host SED Fitting Photo-z", + time_limit=task_time_limit, + soft_time_limit=task_soft_time_limit, +) +def local_host_sed_fitting_zphot(transient_name): + LocalHostSEDFittingZPhot(transient_name).run_process() + @shared_task( name="Get Final Progress", time_limit=task_time_limit, diff --git a/app/host/workflow.py b/app/host/workflow.py index 818c6d23..77f83550 100644 --- a/app/host/workflow.py +++ b/app/host/workflow.py @@ -18,6 +18,9 @@ from host.transient_tasks import transient_information from host.transient_tasks import validate_global_photometry from host.transient_tasks import validate_local_photometry +from host.transient_tasks import local_aperture_photometry_zphot +from host.transient_tasks import validate_local_photometry_zphot +from host.transient_tasks import local_host_sed_fitting_zphot from django.urls import reverse_lazy from django.http import HttpResponseRedirect @@ -84,6 +87,38 @@ def transient_workflow(transient_name=None): initialise_all_tasks_status(transient) transient.tasks_initialized = "True" transient.save() + # Local aperture photometry chain + chain_local_aperture_photometry = chain( + local_aperture_photometry.si(transient_name), + validate_local_photometry.si(transient_name), + local_host_sed_fitting.si(transient_name), + ) + # Global aperture photometry chain + chain_global_aperture_photometry = chain( + global_aperture_construction.si(transient_name), + global_aperture_photometry.si(transient_name), + validate_global_photometry.si(transient_name), + ) + # Local aperture photometry photo-z chain + chain_local_aperture_photometry_zphot = chain( + local_aperture_photometry_zphot.si(transient_name), + validate_local_photometry_zphot.si(transient_name), + local_host_sed_fitting_zphot.si(transient_name) + ) + # Global host SED fit chord + chord_global = chord(( + mwebv_host.si(transient_name), + chain_global_aperture_photometry + ), + global_host_sed_fitting.si(transient_name), + ) + # Photo-Z chord after global SED fit and local aperture photometry + chord_photometry = chord(( + chain_local_aperture_photometry, + chord_global + ), + chain_local_aperture_photometry_zphot + ) # Execute the workflow workflow = chain( image_download.si(transient_name), @@ -91,24 +126,7 @@ def transient_workflow(transient_name=None): mwebv_transient.si(transient_name), host_match.si(transient_name), host_information.si(transient_name), - group( - chain( - local_aperture_photometry.si(transient_name), - validate_local_photometry.si(transient_name), - local_host_sed_fitting.si(transient_name), - ), - chord( - ( - mwebv_host.si(transient_name), - chain( - global_aperture_construction.si(transient_name), - global_aperture_photometry.si(transient_name), - validate_global_photometry.si(transient_name), - ), - ), - global_host_sed_fitting.si(transient_name), - ), - ), + chord_photometry, final_progress.si(transient_name) ) workflow.delay() diff --git a/data/sbipp/SBI_model_local.pt b/data/sbipp/SBI_model_blast_zfix_global.pt similarity index 63% rename from data/sbipp/SBI_model_local.pt rename to data/sbipp/SBI_model_blast_zfix_global.pt index 101707b7..1b3e135b 100644 Binary files a/data/sbipp/SBI_model_local.pt and b/data/sbipp/SBI_model_blast_zfix_global.pt differ diff --git a/data/sbipp/SBI_model_global.pt b/data/sbipp/SBI_model_blast_zfree_global.pt similarity index 61% rename from data/sbipp/SBI_model_global.pt rename to data/sbipp/SBI_model_blast_zfree_global.pt index 3596dc20..a28d58f5 100644 Binary files a/data/sbipp/SBI_model_global.pt and b/data/sbipp/SBI_model_blast_zfree_global.pt differ