Skip to content

Commit

Permalink
automatic update
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoda-esg-bot committed Jan 24, 2025
1 parent 0e6106a commit a74c669
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
29 changes: 16 additions & 13 deletions tools/sed/Multi-instrument_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

workdir = os.getcwd()

src_name = "Crab" # http://odahub.io/ontology#AstrophysicalObject
RA = 83.6324 # http://odahub.io/ontology#PointOfInterestRA
DEC = 22.0174 # http://odahub.io/ontology#PointOfInterestDEC
T1 = "2000-10-09T13:16:00.0" # http://odahub.io/ontology#StartTime
T2 = "2021-10-13T13:16:00.0" # http://odahub.io/ontology#EndTime
src_name = "Mrk 421" # http://odahub.io/ontology#AstrophysicalObject
RA = 166.1138083333333 # http://odahub.io/ontology#PointOfInterestRA
DEC = 38.20883277777778 # http://odahub.io/ontology#PointOfInterestDEC
T1 = "2000-03-06T13:26:48.0" # http://odahub.io/ontology#StartTime
T2 = "2024-03-06T15:32:27.0" # http://odahub.io/ontology#EndTime

do_mwa = True # http://odahub.io/ontology#Boolean ; oda:label "MWA (radio"
do_jemx = True # http://odahub.io/ontology#Boolean ; oda:label "INTEGRAL/JEM-X (X-ray)"
Expand Down Expand Up @@ -126,7 +126,7 @@ def exp_counts_jemx(A, Gam):
E_mwa = tab["Energy[eV]"] * 1e-12
F_mwa = tab["Flux[erg/cm2s]"] / 1.6
F_mwa_err = tab["Flux_error[erg/cm2s]"] / 1.6
UL_mwa = F_mwa_err < F_mwa / 2.0
UL_mwa = F_mwa_err > F_mwa / 2.0
FLAG_mwa = 1
except:
print("No MWA data")
Expand Down Expand Up @@ -314,7 +314,7 @@ def exp_counts_jemx(A, Gam):
F_jemx_all = tmp / tmp1
F_jemx_all_err = 1 / sqrt(tmp1)
F_jemx_all, F_jemx_all_err
UL_jemx = F_jemx_all_err < F_jemx_all / 2.0
UL_jemx = F_jemx_all_err > F_jemx_all / 2.0

pr.report_progress(stage="DESI Legacy Survey", progress=20)
FLAG_desi = 0
Expand All @@ -337,7 +337,7 @@ def exp_counts_jemx(A, Gam):
E_desi = tab["Energy[eV]"] / 1e12
F_desi = tab["Flux[erg/cm2s]"] / 1.6
Ferr_desi = tab["Flux_err[erg/cm2s]"] / 1.6
UL_desi = Ferr_desi < F_desi / 2.0
UL_desi = Ferr_desi > F_desi / 2.0
FLAG_desi = 1
except:
print("No Legacy Survey data")
Expand Down Expand Up @@ -367,7 +367,7 @@ def exp_counts_jemx(A, Gam):
Emax_gaia = tab["Emax[eV]"] * 1e-12
F_gaia = tab["Flux[erg/cm2s]"] / 1.6
Ferr_gaia = tab["Flux_error[erg/cm2s]"] / 1.6
UL_gaia = Ferr_gaia < F_gaia / 2.0
UL_gaia = Ferr_gaia > F_gaia / 2.0
FLAG_gaia = 1
except:
print("No GAIA data")
Expand Down Expand Up @@ -457,7 +457,7 @@ def exp_counts_jemx(A, Gam):
E_isgri = Emeans_isgri * 1e-9
Emins_isgri = Emins_isgri * 1e-9
Emaxs_isgri = Emaxs_isgri * 1e-9
UL_isgri = F_isgri_err < F_isgri / 2.0
UL_isgri = F_isgri_err > F_isgri / 2.0

pr.report_progress(stage="HESS", progress=35)
FLAG_hess = 0
Expand Down Expand Up @@ -493,7 +493,7 @@ def exp_counts_jemx(A, Gam):
Emax_hess = tab["Emax[TeV]"]
F_hess = tab["Flux[TeV/cm2s]"]
F_err_hess = tab["Flux_error[TeV/cm2s]"]
UL_hess = F_err_hess < F_hess / 2.0
UL_hess = F_err_hess > F_hess / 2.0
except:
print("No HESS data")

Expand Down Expand Up @@ -533,7 +533,7 @@ def exp_counts_jemx(A, Gam):
Emax_magic = tab["Emax[TeV]"]
Flux_magic = tab["Flux[TeV/cm2s]"]
Flux_err_magic = tab["Flux_error[TeV/cm2s]"]
UL_magic = Flux_err_magic < Flux_magic / 2.0
UL_magic = Flux_err_magic > Flux_magic / 2.0
except:
print("No MAGIC data")

Expand Down Expand Up @@ -569,7 +569,7 @@ def exp_counts_jemx(A, Gam):
Emax_fermi = tab["Emax[MeV]"] * 1e-6
F_fermi = tab["Flux[MeV/cm2s]"] * 1e-6
F_err_fermi = tab["Flux_error[MeV/cm2s]"] * 1e-6
UL_fermi = F_err_fermi < F_fermi / 2.0
UL_fermi = F_err_fermi > F_fermi / 2.0

pr.report_progress(stage="IceCube", progress=80)
FLAG_icecube = 0
Expand Down Expand Up @@ -744,6 +744,7 @@ def exp_counts_jemx(A, Gam):
yerr=F_err_fermi,
xerr=[E_fermi - Emin_fermi, Emax_fermi - E_fermi],
label="Fermi/LAT",
uplims=UL_fermi,
)
ymin_fermi = min(F_fermi / 3.0)
ymax_fermi = max(F_fermi * 3.0)
Expand Down Expand Up @@ -774,6 +775,8 @@ def exp_counts_jemx(A, Gam):
plt.title(src_name)
plt.savefig("SED.png", format="png", bbox_inches="tight")

UL_isgri, F_fermi, F_err_fermi

from oda_api.data_products import PictureProduct

bin_image = PictureProduct.from_file("SED.png")
Expand Down
20 changes: 10 additions & 10 deletions tools/sed/sed_astro_tool.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<inputs name="inputs" filename="inputs.json" data_style="paths" />
</configfiles>
<inputs>
<param name="src_name" type="text" value="Crab" label="src_name" />
<param name="RA" type="float" value="83.6324" label="RA (unit: deg)" />
<param name="DEC" type="float" value="22.0174" label="DEC (unit: deg)" />
<param name="T1" type="text" value="2000-10-09T13:16:00.0" label="T1" />
<param name="T2" type="text" value="2021-10-13T13:16:00.0" label="T2" />
<param name="src_name" type="text" value="Mrk 421" label="src_name" />
<param name="RA" type="float" value="166.1138083333333" label="RA (unit: deg)" />
<param name="DEC" type="float" value="38.20883277777778" label="DEC (unit: deg)" />
<param name="T1" type="text" value="2000-03-06T13:26:48.0" label="T1" />
<param name="T2" type="text" value="2024-03-06T15:32:27.0" label="T2" />
<param name="do_mwa" type="boolean" checked="true" label="MWA (radio" />
<param name="do_jemx" type="boolean" checked="true" label="INTEGRAL/JEM-X (X-ray)" />
<param name="do_isgri" type="boolean" checked="true" label="INTEGRAL/ISGRI (hard X-ray)" />
Expand All @@ -39,11 +39,11 @@
</outputs>
<tests>
<test expect_num_outputs="1">
<param name="src_name" value="Crab" />
<param name="RA" value="83.6324" />
<param name="DEC" value="22.0174" />
<param name="T1" value="2000-10-09T13:16:00.0" />
<param name="T2" value="2021-10-13T13:16:00.0" />
<param name="src_name" value="Mrk 421" />
<param name="RA" value="166.1138083333333" />
<param name="DEC" value="38.20883277777778" />
<param name="T1" value="2000-03-06T13:26:48.0" />
<param name="T2" value="2024-03-06T15:32:27.0" />
<param name="do_mwa" value="True" />
<param name="do_jemx" value="True" />
<param name="do_isgri" value="True" />
Expand Down

0 comments on commit a74c669

Please sign in to comment.