redback 1.0.1__py3-none-any.whl → 1.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- redback/__init__.py +4 -0
- redback/constraints.py +46 -25
- redback/eos.py +1 -0
- redback/get_data/fink.py +1 -1
- redback/get_data/lasair.py +3 -4
- redback/get_data/swift.py +7 -7
- redback/interaction_processes.py +1 -4
- redback/likelihoods.py +207 -21
- redback/model_library.py +2 -2
- redback/plotting.py +10 -10
- redback/priors/bazin_sne.prior +5 -0
- redback/priors/csm_interaction.prior +6 -7
- redback/priors/csm_nickel.prior +3 -3
- redback/priors/csm_shock_and_arnett.prior +11 -0
- redback/priors/csm_shock_and_arnett_bolometric.prior +10 -0
- redback/priors/csm_shock_breakout.prior +7 -0
- redback/priors/nicholl_bns.prior +2 -1
- redback/priors/one_comp_kne_rosswog_heatingrate.prior +5 -0
- redback/priors/pwn.prior +7 -0
- redback/priors/shocked_cocoon.prior +6 -6
- redback/priors/sn_fallback.prior +8 -0
- redback/priors/stream_stream_tde.prior +10 -0
- redback/priors/stream_stream_tde_bolometric.prior +9 -0
- redback/priors/tde_analytical.prior +5 -5
- redback/priors/tde_analytical_bolometric.prior +6 -4
- redback/priors/tde_fallback.prior +9 -0
- redback/priors/tde_fallback_bolometric.prior +6 -0
- redback/priors/tde_synchrotron.prior +6 -0
- redback/priors/tophat_from_emulator.prior +9 -0
- redback/priors/two_comp_kne_rosswog_heatingrate.prior +9 -0
- redback/priors/two_layer_stratified_kilonova.prior +1 -1
- redback/priors/villar_sne.prior +7 -0
- redback/priors.py +12 -1
- redback/sed.py +194 -2
- redback/simulate_transients.py +71 -35
- redback/tables/GRBs_w_redshift.txt +430 -413
- redback/tables/LGRB_table.txt +70 -6
- redback/tables/SGRB_table.txt +139 -135
- redback/tables/filters.csv +14 -0
- redback/tables/qdot_rosswogkorobkin24.pck +0 -0
- redback/tables/ztf.tar.gz +0 -0
- redback/transient/afterglow.py +17 -7
- redback/transient/kilonova.py +6 -3
- redback/transient/prompt.py +14 -4
- redback/transient/supernova.py +7 -3
- redback/transient/tde.py +6 -3
- redback/transient/transient.py +29 -12
- redback/transient_models/afterglow_models.py +152 -146
- redback/transient_models/combined_models.py +69 -48
- redback/transient_models/extinction_models.py +6 -6
- redback/transient_models/general_synchrotron_models.py +518 -0
- redback/transient_models/integrated_flux_afterglow_models.py +2 -2
- redback/transient_models/kilonova_models.py +310 -61
- redback/transient_models/magnetar_driven_ejecta_models.py +2 -2
- redback/transient_models/magnetar_models.py +1 -1
- redback/transient_models/phenomenological_models.py +69 -1
- redback/transient_models/shock_powered_models.py +159 -110
- redback/transient_models/supernova_models.py +211 -43
- redback/transient_models/tde_models.py +975 -5
- redback/utils.py +309 -16
- {redback-1.0.1.dist-info → redback-1.0.3.dist-info}/METADATA +46 -6
- {redback-1.0.1.dist-info → redback-1.0.3.dist-info}/RECORD +65 -49
- {redback-1.0.1.dist-info → redback-1.0.3.dist-info}/WHEEL +1 -1
- redback/tables/ztf_obslog.csv +0 -106649
- {redback-1.0.1.dist-info → redback-1.0.3.dist-info}/LICENCE.md +0 -0
- {redback-1.0.1.dist-info → redback-1.0.3.dist-info}/top_level.txt +0 -0
redback/utils.py
CHANGED
|
@@ -44,7 +44,7 @@ def download_pointing_tables():
|
|
|
44
44
|
"""
|
|
45
45
|
return logger.info("Pointing tables downloaded and stored in redback/tables")
|
|
46
46
|
|
|
47
|
-
def sncosmo_bandname_from_band(bands, warning_style='
|
|
47
|
+
def sncosmo_bandname_from_band(bands, warning_style='softest'):
|
|
48
48
|
"""
|
|
49
49
|
Convert redback data band names to sncosmo compatible band names
|
|
50
50
|
|
|
@@ -65,12 +65,14 @@ def sncosmo_bandname_from_band(bands, warning_style='soft'):
|
|
|
65
65
|
try:
|
|
66
66
|
res.append(bands_to_flux[band])
|
|
67
67
|
except KeyError as e:
|
|
68
|
-
logger.info(e)
|
|
69
68
|
if warning_style == 'hard':
|
|
70
69
|
raise KeyError(f"Band {band} is not defined in filters.csv!")
|
|
71
|
-
|
|
70
|
+
elif warning_style == 'soft':
|
|
71
|
+
logger.info(e)
|
|
72
72
|
logger.info(f"Band {band} is not defined in filters.csv!")
|
|
73
73
|
res.append('r')
|
|
74
|
+
else:
|
|
75
|
+
res.append('r')
|
|
74
76
|
return np.array(res)
|
|
75
77
|
|
|
76
78
|
def check_kwargs_validity(kwargs):
|
|
@@ -374,7 +376,7 @@ def check_element(driver, id_number):
|
|
|
374
376
|
checks that an element exists on a website, and provides an exception
|
|
375
377
|
"""
|
|
376
378
|
try:
|
|
377
|
-
driver.
|
|
379
|
+
driver.find_element('id', id_number)
|
|
378
380
|
except NoSuchElementException as e:
|
|
379
381
|
print(e)
|
|
380
382
|
return False
|
|
@@ -549,7 +551,10 @@ def frequency_to_bandname(frequency):
|
|
|
549
551
|
|
|
550
552
|
def fetch_driver():
|
|
551
553
|
# open the webdriver
|
|
552
|
-
|
|
554
|
+
options = webdriver.ChromeOptions()
|
|
555
|
+
options.add_argument("--headless=new")
|
|
556
|
+
driver = webdriver.Chrome(options=options)
|
|
557
|
+
return driver
|
|
553
558
|
|
|
554
559
|
|
|
555
560
|
def calc_credible_intervals(samples, interval=0.9):
|
|
@@ -767,14 +772,17 @@ def interpolated_barnes_and_kasen_thermalisation_efficiency(mej, vej):
|
|
|
767
772
|
:param vej: initial ejecta velocity as a fraction of speed of light
|
|
768
773
|
:return: av, bv, dv constants in the thermalisation efficiency equation Eq 25 in Metzger 2017
|
|
769
774
|
"""
|
|
770
|
-
v_array = np.
|
|
771
|
-
mass_array = np.
|
|
772
|
-
a_array = np.asarray([[2.01, 4.52, 8.16], [0.81, 1.9, 3.2],
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
775
|
+
v_array = np.asarray([0.1, 0.2, 0.3, 0.4])
|
|
776
|
+
mass_array = np.asarray([1.e-3, 5.e-3, 1.e-2, 5.e-2, 1.e-1])
|
|
777
|
+
a_array = np.asarray([[2.01, 4.52, 8.16, 16.3], [0.81, 1.9, 3.2, 5.0],
|
|
778
|
+
[0.56, 1.31, 2.19, 3.0], [.27, .55, .95, 2.0],
|
|
779
|
+
[0.20, 0.39, 0.65, 0.9]])
|
|
780
|
+
b_array = np.asarray([[0.28, 0.62, 1.19, 2.4], [0.19, 0.28, 0.45, 0.65],
|
|
781
|
+
[0.17, 0.21, 0.31, 0.45], [0.10, 0.13, 0.15, 0.17],
|
|
782
|
+
[0.06, 0.11, 0.12, 0.12]])
|
|
783
|
+
d_array = np.asarray([[1.12, 1.39, 1.52, 1.65], [0.86, 1.21, 1.39, 1.5],
|
|
784
|
+
[0.74, 1.13, 1.32, 1.4], [0.6, 0.9, 1.13, 1.25],
|
|
785
|
+
[0.63, 0.79, 1.04, 1.5]])
|
|
778
786
|
a_func = RegularGridInterpolator((mass_array, v_array), a_array, bounds_error=False, fill_value=None)
|
|
779
787
|
b_func = RegularGridInterpolator((mass_array, v_array), b_array, bounds_error=False, fill_value=None)
|
|
780
788
|
d_func = RegularGridInterpolator((mass_array, v_array), d_array, bounds_error=False, fill_value=None)
|
|
@@ -785,6 +793,278 @@ def interpolated_barnes_and_kasen_thermalisation_efficiency(mej, vej):
|
|
|
785
793
|
return av, bv, dv
|
|
786
794
|
|
|
787
795
|
|
|
796
|
+
def heatinggrids():
|
|
797
|
+
# Grid of velocity and Ye
|
|
798
|
+
YE_GRID = np.array([0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5], dtype=np.float64)
|
|
799
|
+
V_GRID = np.array([0.05, 0.1, 0.2, 0.3, 0.4, 0.5], dtype=np.float64)
|
|
800
|
+
|
|
801
|
+
# Approximant coefficients on the grid
|
|
802
|
+
E0_GRID = np.array([
|
|
803
|
+
1.000, 1.000, 1.000, 1.000, 1.000, 1.000,
|
|
804
|
+
1.000, 1.000, 1.041, 1.041, 1.041, 1.041,
|
|
805
|
+
1.146, 1.000, 1.041, 1.041, 1.041, 1.041,
|
|
806
|
+
1.146, 1.000, 1.000, 1.000, 1.041, 1.041,
|
|
807
|
+
1.301, 1.398, 1.602, 1.580, 1.763, 1.845,
|
|
808
|
+
0.785, 1.255, 1.673, 1.673, 1.874, 1.874,
|
|
809
|
+
0.863, 0.845, 1.212, 1.365, 1.635, 2.176,
|
|
810
|
+
-2.495, -2.495, -2.097, -2.155, -2.046, -1.824,
|
|
811
|
+
-0.699, -0.699, -0.222, 0.176, 0.176, 0.176,
|
|
812
|
+
-0.398, 0.000, 0.301, 0.477, 0.477, 0.477], dtype=np.float64)
|
|
813
|
+
|
|
814
|
+
# Reshape GRIDs to a 2D array
|
|
815
|
+
E0_GRID = E0_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
816
|
+
|
|
817
|
+
# ALP_GRID
|
|
818
|
+
ALP_GRID = np.array([
|
|
819
|
+
1.37, 1.38, 1.41, 1.41, 1.41, 1.41,
|
|
820
|
+
1.41, 1.38, 1.37, 1.37, 1.37, 1.37,
|
|
821
|
+
1.41, 1.38, 1.37, 1.37, 1.37, 1.37,
|
|
822
|
+
1.36, 1.25, 1.32, 1.32, 1.34, 1.34,
|
|
823
|
+
1.44, 1.40, 1.46, 1.66, 1.60, 1.60,
|
|
824
|
+
1.36, 1.33, 1.33, 1.33, 1.374, 1.374,
|
|
825
|
+
1.40, 1.358, 1.384, 1.384, 1.384, 1.344,
|
|
826
|
+
1.80, 1.80, 2.10, 2.10, 1.90, 1.90,
|
|
827
|
+
8.00, 8.00, 7.00, 7.00, 7.00, 7.00,
|
|
828
|
+
1.40, 1.40, 1.40, 1.60, 1.60, 1.60
|
|
829
|
+
], dtype=np.float64)
|
|
830
|
+
|
|
831
|
+
ALP_GRID = ALP_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
832
|
+
|
|
833
|
+
# T0_GRID
|
|
834
|
+
T0_GRID = np.array([
|
|
835
|
+
1.80, 1.40, 1.20, 1.20, 1.20, 1.20,
|
|
836
|
+
1.40, 1.00, 0.85, 0.85, 0.85, 0.85,
|
|
837
|
+
1.00, 0.80, 0.65, 0.65, 0.61, 0.61,
|
|
838
|
+
0.85, 0.60, 0.45, 0.45, 0.45, 0.45,
|
|
839
|
+
0.65, 0.38, 0.22, 0.18, 0.12, 0.095,
|
|
840
|
+
0.540, 0.31, 0.18, 0.13, 0.095, 0.081,
|
|
841
|
+
0.385, 0.235, 0.1, 0.06, 0.035, 0.025,
|
|
842
|
+
26.0, 26.0, 0.4, 0.4, 0.12, -20.0,
|
|
843
|
+
0.20, 0.12, 0.05, 0.03, 0.025, 0.021,
|
|
844
|
+
0.16, 0.08, 0.04, 0.02, 0.018, 0.016
|
|
845
|
+
], dtype=np.float64)
|
|
846
|
+
|
|
847
|
+
T0_GRID = T0_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
848
|
+
|
|
849
|
+
# SIG_GRID
|
|
850
|
+
SIG_GRID = np.array([
|
|
851
|
+
0.08, 0.08, 0.095, 0.095, 0.095, 0.095,
|
|
852
|
+
0.10, 0.08, 0.070, 0.070, 0.070, 0.070,
|
|
853
|
+
0.07, 0.08, 0.070, 0.065, 0.070, 0.070,
|
|
854
|
+
0.040, 0.030, 0.05, 0.05, 0.05, 0.050,
|
|
855
|
+
0.05, 0.030, 0.025, 0.045, 0.05, 0.05,
|
|
856
|
+
0.11, 0.04, 0.021, 0.021, 0.017, 0.017,
|
|
857
|
+
0.10, 0.094, 0.068, 0.05, 0.03, 0.01,
|
|
858
|
+
45.0, 45.0, 45.0, 45.0, 25.0, 40.0,
|
|
859
|
+
0.20, 0.12, 0.05, 0.03, 0.025, 0.021,
|
|
860
|
+
0.03, 0.015, 0.007, 0.01, 0.009, 0.007
|
|
861
|
+
], dtype=np.float64)
|
|
862
|
+
|
|
863
|
+
SIG_GRID = SIG_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
864
|
+
|
|
865
|
+
# ALP1_GRID
|
|
866
|
+
ALP1_GRID = np.array([
|
|
867
|
+
7.50, 7.50, 7.50, 7.50, 7.50, 7.50,
|
|
868
|
+
9.00, 9.00, 7.50, 7.50, 7.00, 7.00,
|
|
869
|
+
8.00, 8.00, 7.50, 7.50, 7.00, 7.00,
|
|
870
|
+
8.00, 8.00, 7.50, 7.50, 7.00, 7.00,
|
|
871
|
+
8.00, 8.00, 5.00, 7.50, 7.00, 6.50,
|
|
872
|
+
4.5, 3.8, 4.0, 4.0, 4.0, 4.0,
|
|
873
|
+
2.4, 3.8, 3.8, 3.21, 2.91, 3.61,
|
|
874
|
+
-1.55, -1.55, -0.75, -0.75, -2.50, -5.00,
|
|
875
|
+
-1.55, -1.55, -1.55, -1.55, -1.55, -1.55,
|
|
876
|
+
3.00, 3.00, 3.00, 3.00, 3.00, 3.00
|
|
877
|
+
], dtype=np.float64)
|
|
878
|
+
|
|
879
|
+
ALP1_GRID = ALP1_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
880
|
+
|
|
881
|
+
# T1_GRID
|
|
882
|
+
T1_GRID = np.array([
|
|
883
|
+
0.040, 0.025, 0.014, 0.010, 0.008, 0.006,
|
|
884
|
+
0.040, 0.035, 0.020, 0.012, 0.010, 0.008,
|
|
885
|
+
0.080, 0.040, 0.020, 0.012, 0.012, 0.009,
|
|
886
|
+
0.080, 0.040, 0.030, 0.018, 0.012, 0.009,
|
|
887
|
+
0.080, 0.060, 0.065, 0.028, 0.020, 0.015,
|
|
888
|
+
0.14, 0.123, 0.089, 0.060, 0.045, 0.031,
|
|
889
|
+
0.264, 0.1, 0.07, 0.055, 0.042, 0.033,
|
|
890
|
+
1.0, 1.0, 1.0, 1.0, 0.02, 0.01,
|
|
891
|
+
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
|
|
892
|
+
0.04, 0.02, 0.01, 0.002, 0.002, 0.002
|
|
893
|
+
], dtype=np.float64)
|
|
894
|
+
|
|
895
|
+
T1_GRID = T1_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
896
|
+
|
|
897
|
+
SIG1_GRID = np.array([0.250, 0.120, 0.045, 0.028, 0.020, 0.015,
|
|
898
|
+
0.250, 0.060, 0.035, 0.020, 0.016, 0.012,
|
|
899
|
+
0.170, 0.090, 0.035, 0.020, 0.012, 0.009,
|
|
900
|
+
0.170, 0.070, 0.035, 0.015, 0.012, 0.009,
|
|
901
|
+
0.170, 0.070, 0.050, 0.025, 0.020, 0.020,
|
|
902
|
+
0.065, 0.067, 0.053, 0.032, 0.032, 0.024,
|
|
903
|
+
0.075, 0.044, 0.03, 0.02, 0.02, 0.014,
|
|
904
|
+
10.0, 10.0, 10.0, 10.0, 0.02, 0.01,
|
|
905
|
+
10.0, 10.0, 10.0, 10.0, 10.0, 10.0,
|
|
906
|
+
0.01, 0.005, 0.002, 1e-4, 1e-4, 1e-4])
|
|
907
|
+
|
|
908
|
+
SIG1_GRID = SIG1_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
909
|
+
|
|
910
|
+
C1_GRID = np.array([27.2, 27.8, 28.2, 28.2, 28.2, 28.2,
|
|
911
|
+
28.0, 27.8, 27.8, 27.8, 27.8, 27.8,
|
|
912
|
+
27.5, 27.0, 27.8, 27.8, 27.8, 27.8,
|
|
913
|
+
28.8, 28.1, 27.8, 27.8, 27.5, 27.5,
|
|
914
|
+
28.5, 28.0, 27.5, 28.5, 29.2, 29.0,
|
|
915
|
+
25.0, 27.5, 25.8, 20.9, 29.3, 1.0,
|
|
916
|
+
28.7, 27.0, 28.0, 28.0, 27.4, 25.3,
|
|
917
|
+
28.5, 29.1, 29.5, 30.1, 30.4, 29.9,
|
|
918
|
+
20.4, 20.6, 20.8, 20.9, 20.9, 21.0,
|
|
919
|
+
29.9, 30.1, 30.1, 30.2, 30.3, 30.3])
|
|
920
|
+
|
|
921
|
+
C1_GRID = C1_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
922
|
+
|
|
923
|
+
TAU1_GRID = np.array([4.07, 4.07, 4.07, 4.07, 4.07, 4.07,
|
|
924
|
+
4.07, 4.07, 4.07, 4.07, 4.07, 4.07,
|
|
925
|
+
4.07, 4.07, 4.07, 4.07, 4.07, 4.07,
|
|
926
|
+
4.07, 4.07, 4.07, 4.07, 4.07, 4.07,
|
|
927
|
+
4.77, 4.77, 4.77, 4.77, 4.07, 4.07,
|
|
928
|
+
4.77, 4.77, 28.2, 1.03, 0.613, 1.0,
|
|
929
|
+
3.4, 14.5, 11.4, 14.3, 13.3, 13.3,
|
|
930
|
+
2.52, 2.52, 2.52, 2.52, 2.52, 2.52,
|
|
931
|
+
1.02, 1.02, 1.02, 1.02, 1.02, 1.02,
|
|
932
|
+
0.22, 0.22, 0.22, 0.22, 0.22, 0.22])
|
|
933
|
+
|
|
934
|
+
TAU1_GRID = TAU1_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
935
|
+
|
|
936
|
+
C2_GRID = np.array([21.5, 21.5, 22.1, 22.1, 22.1, 22.1,
|
|
937
|
+
22.3, 21.5, 21.5, 21.8, 21.8, 21.8,
|
|
938
|
+
22.0, 21.5, 21.5, 22.0, 21.8, 21.8,
|
|
939
|
+
23.5, 22.5, 22.1, 22.0, 22.2, 22.2,
|
|
940
|
+
22.0, 22.8, 23.0, 23.0, 23.5, 23.5,
|
|
941
|
+
10.0, 0.0, 0.0, 19.8, 22.0, 21.0,
|
|
942
|
+
26.2, 14.1, 18.8, 19.1, 23.8, 19.2,
|
|
943
|
+
25.4, 25.4, 25.8, 26.0, 26.0, 25.8,
|
|
944
|
+
18.4, 18.4, 18.6, 18.6, 18.6, 18.6,
|
|
945
|
+
27.8, 28.0, 28.2, 28.2, 28.3, 28.3])
|
|
946
|
+
|
|
947
|
+
C2_GRID = C2_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
948
|
+
|
|
949
|
+
TAU2_GRID = np.array([4.62, 4.62, 4.62, 4.62, 4.62, 4.62,
|
|
950
|
+
4.62, 4.62, 4.62, 4.62, 4.62, 4.62,
|
|
951
|
+
4.62, 4.62, 4.62, 4.62, 4.62, 4.62,
|
|
952
|
+
4.62, 4.62, 4.62, 4.62, 4.62, 4.62,
|
|
953
|
+
5.62, 5.62, 5.62, 5.62, 4.62, 4.62,
|
|
954
|
+
5.62, 5.18, 5.18, 34.7, 8.38, 22.6,
|
|
955
|
+
0.15, 4.49, 95.0, 95.0, 0.95, 146.,
|
|
956
|
+
0.12, 0.12, 0.12, 0.12, 0.12, 0.14,
|
|
957
|
+
0.32, 0.32, 0.32, 0.32, 0.32, 0.32,
|
|
958
|
+
0.02, 0.02, 0.02, 0.02, 0.02, 0.02])
|
|
959
|
+
|
|
960
|
+
TAU2_GRID = TAU2_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
961
|
+
|
|
962
|
+
C3_GRID = np.array([19.4, 19.8, 20.1, 20.1, 20.1, 20.1,
|
|
963
|
+
20.0, 19.8, 19.8, 19.8, 19.8, 19.8,
|
|
964
|
+
19.9, 19.8, 19.8, 19.8, 19.8, 19.8,
|
|
965
|
+
5.9, 9.8, 23.5, 23.5, 23.5, 23.5,
|
|
966
|
+
27.3, 26.9, 26.6, 27.4, 25.8, 25.8,
|
|
967
|
+
27.8, 26.9, 18.9, 25.4, 24.8, 25.8,
|
|
968
|
+
22.8, 17.9, 18.9, 25.4, 24.8, 25.5,
|
|
969
|
+
20.6, 20.2, 19.8, 19.2, 19.5, 18.4,
|
|
970
|
+
12.6, 13.1, 14.1, 14.5, 14.5, 14.5,
|
|
971
|
+
24.3, 24.2, 24.0, 24.0, 24.0, 23.9])
|
|
972
|
+
|
|
973
|
+
C3_GRID = C3_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
974
|
+
|
|
975
|
+
TAU3_GRID = np.array([18.2, 18.2, 18.2, 18.2, 18.2, 18.2,
|
|
976
|
+
18.2, 18.2, 18.2, 18.2, 18.2, 18.2,
|
|
977
|
+
18.2, 18.2, 18.2, 18.2, 18.2, 18.2,
|
|
978
|
+
18.2, 18.2, 0.62, 0.62, 0.62, 0.62,
|
|
979
|
+
0.18, 0.18, 0.18, 0.18, 0.32, 0.32,
|
|
980
|
+
0.12, 0.18, 50.8, 0.18, 0.32, 0.32,
|
|
981
|
+
2.4, 51.8, 50.8, 0.18, 0.32, 0.32,
|
|
982
|
+
3.0, 2.5, 2.4, 2.4, 2.4, 60.4,
|
|
983
|
+
200., 200., 200., 200., 200., 200.,
|
|
984
|
+
8.76, 8.76, 8.76, 8.76, 8.76, 8.76])
|
|
985
|
+
|
|
986
|
+
TAU3_GRID = TAU3_GRID.reshape((len(V_GRID), len(YE_GRID)), order='F')
|
|
987
|
+
|
|
988
|
+
# make interpolants
|
|
989
|
+
E0_interp = RegularGridInterpolator((V_GRID, YE_GRID), E0_GRID, bounds_error=False, fill_value=None)
|
|
990
|
+
ALP_interp = RegularGridInterpolator((V_GRID, YE_GRID), ALP_GRID, bounds_error=False, fill_value=None)
|
|
991
|
+
T0_interp = RegularGridInterpolator((V_GRID, YE_GRID), T0_GRID, bounds_error=False, fill_value=None)
|
|
992
|
+
SIG_interp = RegularGridInterpolator((V_GRID, YE_GRID), SIG_GRID, bounds_error=False, fill_value=None)
|
|
993
|
+
ALP1_interp = RegularGridInterpolator((V_GRID, YE_GRID), ALP1_GRID, bounds_error=False, fill_value=None)
|
|
994
|
+
T1_interp = RegularGridInterpolator((V_GRID, YE_GRID), T1_GRID, bounds_error=False, fill_value=None)
|
|
995
|
+
SIG1_interp = RegularGridInterpolator((V_GRID, YE_GRID), SIG1_GRID, bounds_error=False, fill_value=None)
|
|
996
|
+
C1_interp = RegularGridInterpolator((V_GRID, YE_GRID), C1_GRID, bounds_error=False, fill_value=None)
|
|
997
|
+
TAU1_interp = RegularGridInterpolator((V_GRID, YE_GRID), TAU1_GRID, bounds_error=False, fill_value=None)
|
|
998
|
+
C2_interp = RegularGridInterpolator((V_GRID, YE_GRID), C2_GRID, bounds_error=False, fill_value=None)
|
|
999
|
+
TAU2_interp = RegularGridInterpolator((V_GRID, YE_GRID), TAU2_GRID, bounds_error=False, fill_value=None)
|
|
1000
|
+
C3_interp = RegularGridInterpolator((V_GRID, YE_GRID), C3_GRID, bounds_error=False, fill_value=None)
|
|
1001
|
+
TAU3_interp = RegularGridInterpolator((V_GRID, YE_GRID), TAU3_GRID, bounds_error=False, fill_value=None)
|
|
1002
|
+
|
|
1003
|
+
|
|
1004
|
+
interpolators = namedtuple('interpolators', ['E0', 'ALP', 'T0', 'SIG', 'ALP1', 'T1', 'SIG1',
|
|
1005
|
+
'C1', 'TAU1', 'C2', 'TAU2', 'C3', 'TAU3'])
|
|
1006
|
+
interpolators.E0 = E0_interp
|
|
1007
|
+
interpolators.ALP = ALP_interp
|
|
1008
|
+
interpolators.T0 = T0_interp
|
|
1009
|
+
interpolators.SIG = SIG_interp
|
|
1010
|
+
interpolators.ALP1 = ALP1_interp
|
|
1011
|
+
interpolators.T1 = T1_interp
|
|
1012
|
+
interpolators.SIG1 = SIG1_interp
|
|
1013
|
+
interpolators.C1 = C1_interp
|
|
1014
|
+
interpolators.TAU1 = TAU1_interp
|
|
1015
|
+
interpolators.C2 = C2_interp
|
|
1016
|
+
interpolators.TAU2 = TAU2_interp
|
|
1017
|
+
interpolators.C3 = C3_interp
|
|
1018
|
+
interpolators.TAU3 = TAU3_interp
|
|
1019
|
+
return interpolators
|
|
1020
|
+
|
|
1021
|
+
def get_heating_terms(ye, vel, **kwargs):
|
|
1022
|
+
ints = heatinggrids()
|
|
1023
|
+
e0 = ints.E0([vel, ye])[0]
|
|
1024
|
+
alp = ints.ALP([vel, ye])[0]
|
|
1025
|
+
t0 = ints.T0([vel, ye])[0]
|
|
1026
|
+
sig = ints.SIG([vel, ye])[0]
|
|
1027
|
+
alp1 = ints.ALP1([vel, ye])[0]
|
|
1028
|
+
t1 = ints.T1([vel, ye])[0]
|
|
1029
|
+
sig1 = ints.SIG1([vel, ye])[0]
|
|
1030
|
+
c1 = ints.C1([vel, ye])[0]
|
|
1031
|
+
tau1 = ints.TAU1([vel, ye])[0]
|
|
1032
|
+
c2 = ints.C2([vel, ye])[0]
|
|
1033
|
+
tau2 = ints.TAU2([vel, ye])[0]
|
|
1034
|
+
c3 = ints.C3([vel, ye])[0]
|
|
1035
|
+
tau3 = ints.TAU3([vel, ye])[0]
|
|
1036
|
+
heating_terms = namedtuple('heating_terms', ['e0', 'alp', 't0', 'sig', 'alp1', 't1', 'sig1', 'c1',
|
|
1037
|
+
'tau1', 'c2', 'tau2', 'c3', 'tau3'])
|
|
1038
|
+
|
|
1039
|
+
heating_rate_fudge = kwargs.get('heating_rate_fudge', 1.0)
|
|
1040
|
+
heating_terms.e0 = e0 * heating_rate_fudge
|
|
1041
|
+
heating_terms.alp = alp * heating_rate_fudge
|
|
1042
|
+
heating_terms.t0 = t0 * heating_rate_fudge
|
|
1043
|
+
heating_terms.sig = sig * heating_rate_fudge
|
|
1044
|
+
heating_terms.alp1 = alp1 * heating_rate_fudge
|
|
1045
|
+
heating_terms.t1 = t1 * heating_rate_fudge
|
|
1046
|
+
heating_terms.sig1 = sig1 * heating_rate_fudge
|
|
1047
|
+
heating_terms.c1 = c1 * heating_rate_fudge
|
|
1048
|
+
heating_terms.tau1 = tau1 * heating_rate_fudge
|
|
1049
|
+
heating_terms.c2 = c2 * heating_rate_fudge
|
|
1050
|
+
heating_terms.tau2 = tau2 * heating_rate_fudge
|
|
1051
|
+
heating_terms.c3 = c3 * heating_rate_fudge
|
|
1052
|
+
heating_terms.tau3 = tau3 * heating_rate_fudge
|
|
1053
|
+
return heating_terms
|
|
1054
|
+
|
|
1055
|
+
def _calculate_rosswogkorobkin24_qdot(time_array, ejecta_velocity, electron_fraction):
|
|
1056
|
+
import pickle
|
|
1057
|
+
import os
|
|
1058
|
+
dirname = os.path.dirname(__file__)
|
|
1059
|
+
with open(f"{dirname}/tables/qdot_rosswogkorobkin24.pck", 'rb') as file_handle:
|
|
1060
|
+
qdot_object = pickle.load(file_handle)
|
|
1061
|
+
steps = len(time_array)
|
|
1062
|
+
_ej_velocity = np.repeat(ejecta_velocity, steps)
|
|
1063
|
+
_ye = np.repeat(electron_fraction, steps)
|
|
1064
|
+
full_array = np.array([_ej_velocity, _ye, time_array]).T
|
|
1065
|
+
lum_in = qdot_object(full_array)
|
|
1066
|
+
return lum_in
|
|
1067
|
+
|
|
788
1068
|
def electron_fraction_from_kappa(kappa):
|
|
789
1069
|
"""
|
|
790
1070
|
Uses interpolation from Tanaka+19 to calculate
|
|
@@ -793,11 +1073,24 @@ def electron_fraction_from_kappa(kappa):
|
|
|
793
1073
|
:return: electron_fraction
|
|
794
1074
|
"""
|
|
795
1075
|
|
|
796
|
-
kappa_array = np.array([
|
|
797
|
-
ye_array = np.array([0.
|
|
798
|
-
kappa_func = interp1d(kappa_array, y=ye_array)
|
|
1076
|
+
kappa_array = np.array([35, 32.2, 22.3, 5.60, 5.36, 3.30, 0.96, 0.5])
|
|
1077
|
+
ye_array = np.array([0.10, 0.15, 0.2, 0.25, 0.30, 0.35, 0.4, 0.5])
|
|
1078
|
+
kappa_func = interp1d(kappa_array, y=ye_array, fill_value='extrapolate')
|
|
799
1079
|
electron_fraction = kappa_func(kappa)
|
|
800
1080
|
return electron_fraction
|
|
1081
|
+
|
|
1082
|
+
def kappa_from_electron_fraction(ye):
|
|
1083
|
+
"""
|
|
1084
|
+
Uses interpolation from Tanaka+19 to calculate
|
|
1085
|
+
the opacity based on the electron fraction
|
|
1086
|
+
:param ye: electron fraction
|
|
1087
|
+
:return: electron_fraction
|
|
1088
|
+
"""
|
|
1089
|
+
kappa_array = np.array([35, 32.2, 22.3, 5.60, 5.36, 3.30, 0.96, 0.5])
|
|
1090
|
+
ye_array = np.array([0.10, 0.15, 0.2, 0.25, 0.30, 0.35, 0.4, 0.5])
|
|
1091
|
+
func = interp1d(ye_array, y=kappa_array, fill_value='extrapolate')
|
|
1092
|
+
kappa = func(ye)
|
|
1093
|
+
return kappa
|
|
801
1094
|
|
|
802
1095
|
def lorentz_factor_from_velocity(velocity):
|
|
803
1096
|
"""
|
|
@@ -1,17 +1,54 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: redback
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: A Bayesian inference pipeline for electromagnetic transients
|
|
5
5
|
Home-page: https://github.com/nikhil-sarin/redback
|
|
6
6
|
Author: Nikhil Sarin, Moritz Huebner
|
|
7
|
-
Author-email:
|
|
7
|
+
Author-email: nsarin.astro@gmail.com
|
|
8
8
|
License: GNU General Public License v3 (GPLv3)
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
11
11
|
Classifier: Operating System :: OS Independent
|
|
12
|
-
Requires-Python: >=3.
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENCE.md
|
|
15
|
+
Requires-Dist: numpy==1.26.0
|
|
16
|
+
Requires-Dist: setuptools
|
|
17
|
+
Requires-Dist: pandas
|
|
18
|
+
Requires-Dist: scipy<1.14.0
|
|
19
|
+
Requires-Dist: selenium
|
|
20
|
+
Requires-Dist: matplotlib
|
|
21
|
+
Requires-Dist: astropy
|
|
22
|
+
Requires-Dist: extinction
|
|
23
|
+
Requires-Dist: requests
|
|
24
|
+
Requires-Dist: lxml
|
|
25
|
+
Requires-Dist: sphinx-rtd-theme
|
|
26
|
+
Requires-Dist: sphinx-tabs
|
|
27
|
+
Requires-Dist: bilby
|
|
28
|
+
Requires-Dist: regex
|
|
29
|
+
Requires-Dist: sncosmo
|
|
30
|
+
Requires-Dist: afterglowpy
|
|
31
|
+
Provides-Extra: all
|
|
32
|
+
Requires-Dist: nestle; extra == "all"
|
|
33
|
+
Requires-Dist: sherpa; extra == "all"
|
|
34
|
+
Requires-Dist: scikit-learn; extra == "all"
|
|
35
|
+
Requires-Dist: PyQt5; extra == "all"
|
|
36
|
+
Requires-Dist: lalsuite; extra == "all"
|
|
37
|
+
Requires-Dist: kilonova-heating-rate; extra == "all"
|
|
38
|
+
Requires-Dist: redback-surrogates; extra == "all"
|
|
39
|
+
Requires-Dist: kilonovanet; extra == "all"
|
|
40
|
+
Requires-Dist: astroquery; extra == "all"
|
|
41
|
+
Dynamic: author
|
|
42
|
+
Dynamic: author-email
|
|
43
|
+
Dynamic: classifier
|
|
44
|
+
Dynamic: description
|
|
45
|
+
Dynamic: description-content-type
|
|
46
|
+
Dynamic: home-page
|
|
47
|
+
Dynamic: license
|
|
48
|
+
Dynamic: provides-extra
|
|
49
|
+
Dynamic: requires-dist
|
|
50
|
+
Dynamic: requires-python
|
|
51
|
+
Dynamic: summary
|
|
15
52
|
|
|
16
53
|
[](https://redback.readthedocs.io/en/latest/?badge=latest)
|
|
17
54
|

|
|
@@ -45,9 +82,12 @@ Simulate single transients or populations or simulate a full survey including no
|
|
|
45
82
|
|
|
46
83
|
### Contributing
|
|
47
84
|
If you are interested in contributing please join the redback
|
|
48
|
-
[slack](https://join.slack.com/t/redback-group/shared_invite/zt-
|
|
85
|
+
[slack](https://join.slack.com/t/redback-group/shared_invite/zt-2503mmkaq-EMEAgz7i3mY0pg1o~VUdqw)
|
|
49
86
|
and email [Nikhil Sarin](mailto:nikhil.sarin@su.se?subject=Contributing%20to%20redback).
|
|
50
87
|
|
|
51
88
|
To make changes to redback, we require users to use a merge request system.
|
|
52
89
|
|
|
53
|
-
|
|
90
|
+
### User/Dev calls
|
|
91
|
+
We have regular calls for users and developers.
|
|
92
|
+
These include tutorials on specific redback functionality as well as discussions of new features/feature requests,
|
|
93
|
+
and Q/A. Please join the slack to get details of these calls.
|