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 Jul 2, 2024
1 parent 23acb24 commit dd48e12
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<tool id="analyse_short_astro_text_astro_tool" name="analyse-short-astro-text" version="0.0.1+galaxy0" profile="23.0">
<requirements>
<requirement type="package" version="8.25.0">ipython</requirement>
<requirement type="package" version="0.4.7">astroquery</requirement>
<requirement type="package" version="2.2.2">pandas</requirement>
<requirement type="package" version="1.2.20">oda-api</requirement>
<requirement type="package" version="3.9.0">matplotlib</requirement>
<requirement type="package" version="2.32.3">requests</requirement>
<requirement type="package" version="0.4.7">astroquery</requirement>
<requirement type="package" version="7.0.0">rdflib</requirement>
<!--Requirements string 'user_agent
' can't be converted automatically. Please add the galaxy/conda requirement manually or modify the requirements file!-->
<requirement type="package" version="4.12.3">beautifulsoup4</requirement>
<requirement type="package" version="2.0.0">sparqlwrapper</requirement>
<requirement type="package" version="3.3">networkx</requirement>
<requirement type="package" version="3.8.4">matplotlib</requirement>
<requirement type="package" version="1.13.1">scipy</requirement>
<requirement type="package" version="1.14.0">scipy</requirement>
<!--Requirements string 'oda_api
' can't be converted automatically. Please add the galaxy/conda requirement manually or modify the requirements file!-->
<!--Requirements string 'nb2workflow
Expand All @@ -23,20 +24,21 @@
<inputs name="inputs" filename="inputs.json" data_style="paths" />
</configfiles>
<inputs>
<param name="text" type="text" value="The TeV-detected BL Lac object 1ES 1218+304 (z0.184) Swift" label="text" />
<param name="number" type="text" value="ATEL16" label="number" />
<param name="text" type="text" value="We received an alert about a candidate fast transient from the FINK broker (Peloton, Ishida &amp; Moller et al.) on 2024-06-22 09:58:42.001 UTC, named ZTF24aasjjkf (https://fink-portal.org/ZTF24aasjjkf). This transient was classified by FINK on the same day with a 17 percent probability of being a fast transient. We triggered the TAROT-TCA and TRT-SRO telescopes for further investigation, observing in the R, r', and i' bands, and collecting data from 2024-06-23 around 04:55:14 UTC to 2024-06-24 01:00:00 UTC. Our results, along with public ZTF data, can be found here: https://skyportal-icare.ijclab.in2p3.fr/public/sources/ZTF24aasjjkf/version/07cf393bb53513abe80d3b7863938d8f TAROT-TCA telescope observations can be also labeled as generic in the plot. We utilized STDWeb (Karpov et al.) to perform our photometry, using the Pan-STARRS DR1 (PS1) catalog and subtracting the constant flux of background with a reference PS1 image. We note that in the TAROT-TCA data, we have slight contamination from other stars. However, we mitigated this effect by subtracting the PS1 reference image. According to the ZTF data in the r' band, both before and after our observations, as well as ATLAS data (in the orange band) and the Gaia Alert (2024LXA), the source might be 10 days old or more. Its multi-band light curve is not consistent with a fast transient like a kilonova (a decay rate of 0.15 per day in r-band) but resembles a supernova (also classified by FINK on 2024-06-24 at 08:00 UTC). The source has been independently classified by Jianlin Xu et al. as a CV. We thank the FINK team for their valuable collaboration with GRANDMA. GRANDMA is a worldwide telescope network (https://grandma.lal.in2p3.fr/) devoted to the observation of transients in the context of multi-messenger astrophysics (Antier et al. 2020 MNRAS 497, 5518). Kilonova-Catcher (KNC) is the citizen science program of GRANDMA (http://kilonovacatcher.in2p3.fr/)." label="text" />
<param name="number" type="text" value="ATel #16672" label="number" />
</inputs>
<outputs>
<data label="${tool.name} -&gt; telescope_type_prediction telescope_astropy_table" name="out_telescope_type_prediction_telescope_astropy_table" format="auto" from_work_dir="telescope_astropy_table_galaxy.output" />
<data label="${tool.name} -&gt; telescope_type_prediction source_astropy_table" name="out_telescope_type_prediction_source_astropy_table" format="auto" from_work_dir="source_astropy_table_galaxy.output" />
<data label="${tool.name} -&gt; telescope_type_prediction source_class_astropy_table" name="out_telescope_type_prediction_source_class_astropy_table" format="auto" from_work_dir="source_class_astropy_table_galaxy.output" />
<data label="${tool.name} -&gt; telescope_type_prediction input_sensitivity_astropy_table" name="out_telescope_type_prediction_input_sensitivity_astropy_table" format="auto" from_work_dir="input_sensitivity_astropy_table_galaxy.output" />
<data label="${tool.name} -&gt; telescope_type_prediction pred_sensitivity_astropy_table" name="out_telescope_type_prediction_pred_sensitivity_astropy_table" format="auto" from_work_dir="pred_sensitivity_astropy_table_galaxy.output" />
<data label="${tool.name} -&gt; telescope_type_prediction table_telescopes" name="out_telescope_type_prediction_table_telescopes" format="auto" from_work_dir="table_telescopes_galaxy.output" />
<data label="${tool.name} -&gt; telescope_type_prediction table_sources" name="out_telescope_type_prediction_table_sources" format="auto" from_work_dir="table_sources_galaxy.output" />
<data label="${tool.name} -&gt; telescope_type_prediction table_source_classes" name="out_telescope_type_prediction_table_source_classes" format="auto" from_work_dir="table_source_classes_galaxy.output" />
<data label="${tool.name} -&gt; telescope_type_prediction table_atel_sensitivity" name="out_telescope_type_prediction_table_atel_sensitivity" format="auto" from_work_dir="table_atel_sensitivity_galaxy.output" />
<data label="${tool.name} -&gt; telescope_type_prediction table_predicted_sensitivity" name="out_telescope_type_prediction_table_predicted_sensitivity" format="auto" from_work_dir="table_predicted_sensitivity_galaxy.output" />
<data label="${tool.name} -&gt; telescope_type_prediction table_suggested_workflows" name="out_telescope_type_prediction_table_suggested_workflows" format="auto" from_work_dir="table_suggested_workflows_galaxy.output" />
</outputs>
<tests>
<test expect_num_outputs="5">
<param name="text" value="The TeV-detected BL Lac object 1ES 1218+304 (z0.184) Swift" />
<param name="number" value="ATEL16" />
<test expect_num_outputs="6">
<param name="text" value="We received an alert about a candidate fast transient from the FINK broker (Peloton, Ishida &amp; Moller et al.) on 2024-06-22 09:58:42.001 UTC, named ZTF24aasjjkf (https://fink-portal.org/ZTF24aasjjkf). This transient was classified by FINK on the same day with a 17 percent probability of being a fast transient. We triggered the TAROT-TCA and TRT-SRO telescopes for further investigation, observing in the R, r', and i' bands, and collecting data from 2024-06-23 around 04:55:14 UTC to 2024-06-24 01:00:00 UTC. Our results, along with public ZTF data, can be found here: https://skyportal-icare.ijclab.in2p3.fr/public/sources/ZTF24aasjjkf/version/07cf393bb53513abe80d3b7863938d8f TAROT-TCA telescope observations can be also labeled as generic in the plot. We utilized STDWeb (Karpov et al.) to perform our photometry, using the Pan-STARRS DR1 (PS1) catalog and subtracting the constant flux of background with a reference PS1 image. We note that in the TAROT-TCA data, we have slight contamination from other stars. However, we mitigated this effect by subtracting the PS1 reference image. According to the ZTF data in the r' band, both before and after our observations, as well as ATLAS data (in the orange band) and the Gaia Alert (2024LXA), the source might be 10 days old or more. Its multi-band light curve is not consistent with a fast transient like a kilonova (a decay rate of 0.15 per day in r-band) but resembles a supernova (also classified by FINK on 2024-06-24 at 08:00 UTC). The source has been independently classified by Jianlin Xu et al. as a CV. We thank the FINK team for their valuable collaboration with GRANDMA. GRANDMA is a worldwide telescope network (https://grandma.lal.in2p3.fr/) devoted to the observation of transients in the context of multi-messenger astrophysics (Antier et al. 2020 MNRAS 497, 5518). Kilonova-Catcher (KNC) is the citizen science program of GRANDMA (http://kilonovacatcher.in2p3.fr/)." />
<param name="number" value="ATel #16672" />
<assert_stdout>
<has_text text="*** Job finished successfully ***" />
</assert_stdout>
Expand Down
67 changes: 40 additions & 27 deletions tools/analyse-short-astro-text/telescope_type_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
from oda_api.data_products import ODAAstropyTable
from oda_api.json import CustomJSONEncoder
from pipeline_predict_sensitivity import predict_sensitivity
from pipeline_provide_workflows import provide_workflows
from pipeline_source_classes import detect_source_classes
from pipeline_sources import rule_based_source_detector
from pipeline_telescope import rule_based_telescope_detector

text = "The TeV-detected BL Lac object 1ES 1218+304 (z0.184) Swift" # http://odahub.io/ontology#LongString
number = "ATEL16" # http://odahub.io/ontology#LongString
text = "We received an alert about a candidate fast transient from the FINK broker (Peloton, Ishida & Moller et al.) on 2024-06-22 09:58:42.001 UTC, named ZTF24aasjjkf (https://fink-portal.org/ZTF24aasjjkf). This transient was classified by FINK on the same day with a 17 percent probability of being a fast transient. We triggered the TAROT-TCA and TRT-SRO telescopes for further investigation, observing in the R, r', and i' bands, and collecting data from 2024-06-23 around 04:55:14 UTC to 2024-06-24 01:00:00 UTC. Our results, along with public ZTF data, can be found here: https://skyportal-icare.ijclab.in2p3.fr/public/sources/ZTF24aasjjkf/version/07cf393bb53513abe80d3b7863938d8f TAROT-TCA telescope observations can be also labeled as generic in the plot. We utilized STDWeb (Karpov et al.) to perform our photometry, using the Pan-STARRS DR1 (PS1) catalog and subtracting the constant flux of background with a reference PS1 image. We note that in the TAROT-TCA data, we have slight contamination from other stars. However, we mitigated this effect by subtracting the PS1 reference image. According to the ZTF data in the r' band, both before and after our observations, as well as ATLAS data (in the orange band) and the Gaia Alert (2024LXA), the source might be 10 days old or more. Its multi-band light curve is not consistent with a fast transient like a kilonova (a decay rate of 0.15 per day in r-band) but resembles a supernova (also classified by FINK on 2024-06-24 at 08:00 UTC). The source has been independently classified by Jianlin Xu et al. as a CV. We thank the FINK team for their valuable collaboration with GRANDMA. GRANDMA is a worldwide telescope network (https://grandma.lal.in2p3.fr/) devoted to the observation of transients in the context of multi-messenger astrophysics (Antier et al. 2020 MNRAS 497, 5518). Kilonova-Catcher (KNC) is the citizen science program of GRANDMA (http://kilonovacatcher.in2p3.fr/)." # http://odahub.io/ontology#LongString
number = "ATel #16672" # http://odahub.io/ontology#LongString

_galaxy_wd = os.getcwd()

Expand All @@ -35,13 +36,14 @@
atel_ = number
### Settings
data_path = f"data/"
model_file = (
f"{data_path}/probabilistic_models/first_single_second_single.dat.npy"
)
model_file = f"{data_path}/probabilistic_models/first_single_second_single_with_tel_repetition.dat.npy"

### Required files
telescope_ontology = f"{data_path}/telescope_observatory_survey.ttl"
file_dict_uri_int = f"{data_path}/dictionary_telescope_uri_int_id.json"
file_dict_sens_inst = (
f"{data_path}/dictionary_telescope_type_2_instrument.json"
)

dict_path = f"{data_path}/dictionary_names_otypes.json"
simbad_node_file = f"{data_path}/simbad_otypes_nodes.csv"
Expand All @@ -57,65 +59,76 @@
atel_, atel_text.lower(), df_sor, simbad_node_file
)
df_in, df_pred = predict_sensitivity(model_file, df_tel, first_type="single")
df_workflows = provide_workflows(df_in, df_pred, df_sor, file_dict_sens_inst)

t_tel = ODAAstropyTable(Table.from_pandas(df_tel.map(str)))
t_sor = ODAAstropyTable(Table.from_pandas(df_sor.map(str)))
t_cla = ODAAstropyTable(Table.from_pandas(df_cla.map(str)))
t_in = ODAAstropyTable(Table.from_pandas(df_in.map(str)))
t_pred = ODAAstropyTable(Table.from_pandas(df_pred.map(str)))
t_workflows = ODAAstropyTable(Table.from_pandas(df_workflows.map(str)))

print(t_sor)
print(t_tel)
print(t_cla)
print(t_in)
print(t_pred)
print(t_workflows)

telescope_astropy_table = t_tel # http://odahub.io/ontology#ODAAstropyTable
source_astropy_table = t_sor # http://odahub.io/ontology#ODAAstropyTable
source_class_astropy_table = t_cla # http://odahub.io/ontology#ODAAstropyTable
input_sensitivity_astropy_table = (
t_in # http://odahub.io/ontology#ODAAstropyTable
)
pred_sensitivity_astropy_table = (
table_telescopes = t_tel # http://odahub.io/ontology#ODAAstropyTable
table_sources = t_sor # http://odahub.io/ontology#ODAAstropyTable
table_source_classes = t_cla # http://odahub.io/ontology#ODAAstropyTable
table_atel_sensitivity = t_in # http://odahub.io/ontology#ODAAstropyTable
table_predicted_sensitivity = (
t_pred # http://odahub.io/ontology#ODAAstropyTable
)
table_suggested_workflows = (
t_workflows # http://odahub.io/ontology#ODAAstropyTable
)

# output gathering
_galaxy_meta_data = {}
_oda_outs = []
_oda_outs.append(
(
"out_telescope_type_prediction_telescope_astropy_table",
"telescope_astropy_table_galaxy.output",
telescope_astropy_table,
"out_telescope_type_prediction_table_telescopes",
"table_telescopes_galaxy.output",
table_telescopes,
)
)
_oda_outs.append(
(
"out_telescope_type_prediction_table_sources",
"table_sources_galaxy.output",
table_sources,
)
)
_oda_outs.append(
(
"out_telescope_type_prediction_source_astropy_table",
"source_astropy_table_galaxy.output",
source_astropy_table,
"out_telescope_type_prediction_table_source_classes",
"table_source_classes_galaxy.output",
table_source_classes,
)
)
_oda_outs.append(
(
"out_telescope_type_prediction_source_class_astropy_table",
"source_class_astropy_table_galaxy.output",
source_class_astropy_table,
"out_telescope_type_prediction_table_atel_sensitivity",
"table_atel_sensitivity_galaxy.output",
table_atel_sensitivity,
)
)
_oda_outs.append(
(
"out_telescope_type_prediction_input_sensitivity_astropy_table",
"input_sensitivity_astropy_table_galaxy.output",
input_sensitivity_astropy_table,
"out_telescope_type_prediction_table_predicted_sensitivity",
"table_predicted_sensitivity_galaxy.output",
table_predicted_sensitivity,
)
)
_oda_outs.append(
(
"out_telescope_type_prediction_pred_sensitivity_astropy_table",
"pred_sensitivity_astropy_table_galaxy.output",
pred_sensitivity_astropy_table,
"out_telescope_type_prediction_table_suggested_workflows",
"table_suggested_workflows_galaxy.output",
table_suggested_workflows,
)
)

Expand Down

0 comments on commit dd48e12

Please sign in to comment.