comparison hess_astro_tool.xml @ 1:593c4b45eda5 draft default tip

planemo upload for repository https://github.com/esg-epfl-apc/tools-astro/tree/main/tools commit 2f23ec010eab8d33d2760f061286756e17015af7
author astroteam
date Thu, 18 Apr 2024 09:26:15 +0000
parents 02e4bb4fa10c
children
comparison
equal deleted inserted replaced
0:02e4bb4fa10c 1:593c4b45eda5
1 <tool id="hess_astro_tool" name="HESS" version="0.0.1+galaxy0" profile="23.0"> 1 <tool id="hess_astro_tool" name="HESS" version="0.0.2+galaxy0" profile="23.0">
2 <requirements> 2 <requirements>
3 <requirement type="package" version="8.21.0">ipython</requirement> 3 <requirement type="package" version="8.22.2">ipython</requirement>
4 <requirement type="package" version="5.3.4">astropy</requirement> 4 <requirement type="package" version="5.3.4">astropy</requirement>
5 <requirement type="package" version="1.11.4">scipy</requirement> 5 <requirement type="package" version="1.11.4">scipy</requirement>
6 <requirement type="package" version="1.10.13">pydantic</requirement> 6 <requirement type="package" version="1.10.14">pydantic</requirement>
7 <requirement type="package" version="4.66.2">tqdm</requirement> 7 <requirement type="package" version="4.66.2">tqdm</requirement>
8 <requirement type="package" version="1.1">gammapy</requirement> 8 <requirement type="package" version="1.1">gammapy</requirement>
9 <requirement type="package" version="3.8.3">matplotlib</requirement> 9 <requirement type="package" version="3.8.4">matplotlib</requirement>
10 <requirement type="package" version="1.2.12">oda-api</requirement> 10 <requirement type="package" version="1.2.15">oda-api</requirement>
11 <!--Requirements string 'nb2workflow[cwl,service,rdf,mmoda]>=1.3.30 11 <!--Requirements string 'nb2workflow[cwl,service,rdf,mmoda]>=1.3.30
12 ' can't be converted automatically. Please add the galaxy/conda requirement manually or modify the requirements file!--> 12 ' can't be converted automatically. Please add the galaxy/conda requirement manually or modify the requirements file!-->
13 <requirement type="package" version="7.16.0">nbconvert</requirement> 13 <requirement type="package" version="7.16.3">nbconvert</requirement>
14 <requirement type="package" version="1.20.3">wget</requirement> 14 <requirement type="package" version="1.21.4">wget</requirement>
15 </requirements> 15 </requirements>
16 <command detect_errors="exit_code">ipython '$__tool_directory__/${_data_product._selector}.py'</command> 16 <command detect_errors="exit_code">ipython '$__tool_directory__/${_data_product._selector}.py'</command>
17 <configfiles> 17 <configfiles>
18 <inputs name="inputs" filename="inputs.json" /> 18 <inputs name="inputs" filename="inputs.json" data_style="paths" />
19 </configfiles> 19 </configfiles>
20 <inputs> 20 <inputs>
21 <conditional name="_data_product"> 21 <conditional name="_data_product">
22 <param name="_selector" type="select" label="Data Product"> 22 <param name="_selector" type="select" label="Data Product">
23 <option value="Image" selected="true">Image</option> 23 <option value="Image" selected="true">Image</option>
24 <option value="Spectrum" selected="false">Spectrum</option> 24 <option value="Spectrum" selected="false">Spectrum</option>
25 <option value="Spectrum_gammapy" selected="false">Spectrum_gammapy</option>
26 <option value="Lightcurve" selected="false">Lightcurve</option> 25 <option value="Lightcurve" selected="false">Lightcurve</option>
27 </param> 26 </param>
28 <when value="Image"> 27 <when value="Image">
29 <param name="src_name" type="text" value="Crab" label="src_name" /> 28 <param name="src_name" type="text" value="Crab" label="src_name" />
30 <param name="RA" type="float" value="83.6287" label="RA Units: deg" /> 29 <param name="RA" type="float" value="83.6287" label="RA (unit: deg)" />
31 <param name="DEC" type="float" value="22.0147" label="DEC Units: deg" /> 30 <param name="DEC" type="float" value="22.0147" label="DEC (unit: deg)" />
32 <param name="T1" type="text" value="2000-10-09T13:16:00.0" label="T1" /> 31 <param name="T1" type="text" value="2000-10-09T13:16:00.0" label="T1" />
33 <param name="T2" type="text" value="2022-10-10T13:16:00.0" label="T2" /> 32 <param name="T2" type="text" value="2022-10-10T13:16:00.0" label="T2" />
34 <param name="Radius" type="float" value="2.5" label="Radius Units: deg" /> 33 <param name="Radius" type="float" value="1.0" label="Radius (unit: deg)" />
35 <param name="pixsize" type="float" value="0.1" label="Pixel size Units: deg" /> 34 <param name="pixsize" type="float" value="0.05" label="Pixel size (unit: deg)" />
36 <param name="Emin" type="float" value="100.0" label="Emin Units: GeV" /> 35 <param name="Emin" type="integer" value="1" label="Emin (unit: TeV)" />
37 <param name="Emax" type="float" value="10000.0" label="Emax Units: GeV" /> 36 <param name="Emax" type="float" value="100.0" label="Emax (unit: TeV)" />
38 </when> 37 </when>
39 <when value="Spectrum"> 38 <when value="Spectrum">
40 <param name="src_name" type="text" value="PKS 2155-304" label="src_name" /> 39 <param name="src_name" type="text" value="PKS 2155-304" label="src_name" />
41 <param name="RA" type="float" value="329.716938" label="RA Units: deg" /> 40 <param name="RA" type="float" value="329.716938" label="RA (unit: deg)" />
42 <param name="DEC" type="float" value="-30.225588" label="DEC Units: deg" /> 41 <param name="DEC" type="float" value="-30.225588" label="DEC (unit: deg)" />
43 <param name="T1" type="text" value="2000-10-09T13:16:00.0" label="T1" /> 42 <param name="T1" type="text" value="2000-10-09T13:16:00.0" label="T1" />
44 <param name="T2" type="text" value="2022-10-10T13:16:00.0" label="T2" /> 43 <param name="T2" type="text" value="2022-10-10T13:16:00.0" label="T2" />
45 <param name="Radius" type="float" value="2.5" label="Radius Units: deg" /> 44 <param name="Radius" type="float" value="2.5" label="Radius (unit: deg)" />
46 <param name="R_s" type="float" value="0.2" label="R_s Units: deg" /> 45 <param name="R_s" type="float" value="0.2" label="R_s (unit: deg)" />
47 <param name="Emin" type="float" value="100.0" label="Emin Units: GeV" /> 46 <param name="Emin" type="float" value="0.1" label="Emin (unit: TeV)" />
48 <param name="Emax" type="float" value="10000.0" label="Emax Units: GeV" /> 47 <param name="Emax" type="float" value="100.0" label="Emax (unit: TeV)" />
49 <param name="NEbins" type="integer" value="20" label="NEbins" /> 48 <param name="NEbins" type="integer" value="30" label="NEbins" />
50 </when> 49 <param name="Efit_min" type="float" value="0.2" label="Efit_min (unit: TeV)" />
51 <when value="Spectrum_gammapy"> 50 <param name="Efit_max" type="float" value="10.0" label="Efit_max (unit: TeV)" />
52 <param name="src_name" type="text" value="PKS 2155-304" label="src_name" />
53 <param name="RA" type="float" value="329.716938" label="RA Units: deg" />
54 <param name="DEC" type="float" value="-30.225588" label="DEC Units: deg" />
55 <param name="T1" type="text" value="2000-10-09T13:16:00.0" label="T1" />
56 <param name="T2" type="text" value="2022-10-10T13:16:00.0" label="T2" />
57 <param name="Radius" type="float" value="2.5" label="Radius Units: deg" />
58 <param name="R_s" type="float" value="0.5" label="R_s Units: deg" />
59 <param name="Emin" type="float" value="100.0" label="Emin Units: GeV" />
60 <param name="Emax" type="float" value="10000.0" label="Emax Units: GeV" />
61 <param name="NEbins" type="integer" value="20" label="NEbins" />
62 </when> 51 </when>
63 <when value="Lightcurve"> 52 <when value="Lightcurve">
64 <param name="src_name" type="text" value="Crab" label="src_name" /> 53 <param name="src_name" type="text" value="Crab" label="src_name" />
65 <param name="RA" type="float" value="83.6287" label="RA Units: deg" /> 54 <param name="RA" type="float" value="83.6287" label="RA (unit: deg)" />
66 <param name="DEC" type="float" value="22.0147" label="DEC Units: deg" /> 55 <param name="DEC" type="float" value="22.0147" label="DEC (unit: deg)" />
67 <param name="T1" type="text" value="2003-10-09T13:16:00.0" label="T1" /> 56 <param name="T1" type="text" value="2004-11-20T13:16:00.0" label="T1" />
68 <param name="T2" type="text" value="2005-10-10T13:16:00.0" label="T2" /> 57 <param name="T2" type="text" value="2004-12-20T13:16:00.0" label="T2" />
69 <param name="Radius" type="float" value="2.5" label="Radius Units: deg" /> 58 <param name="Radius" type="float" value="2.5" label="Radius (unit: deg)" />
70 <param name="R_s" type="float" value="0.2" label="R_s Units: deg" /> 59 <param name="R_s" type="float" value="0.2" label="R_s (unit: deg)" />
71 <param name="Emin" type="float" value="100.0" label="Emin Units: GeV" /> 60 <param name="Emin" type="integer" value="1" label="Emin (unit: TeV)" />
72 <param name="Emax" type="float" value="10000.0" label="Emax Units: GeV" /> 61 <param name="Emax" type="float" value="100.0" label="Emax (unit: TeV)" />
73 <param name="NTbins" type="integer" value="10" label="NTbins" /> 62 <param name="NTbins" type="integer" value="30" label="NTbins" />
74 </when> 63 </when>
75 </conditional> 64 </conditional>
76 </inputs> 65 </inputs>
77 <outputs> 66 <outputs>
78 <data label="${tool.name} -&gt; Image picture" name="out_Image_picture" format="auto" from_work_dir="picture_galaxy.output"> 67 <data label="${tool.name} -&gt; Image png" name="out_Image_png" format="auto" from_work_dir="png_galaxy.output">
79 <filter>_data_product['_selector'] == 'Image'</filter> 68 <filter>_data_product['_selector'] == 'Image'</filter>
80 </data> 69 </data>
81 <data label="${tool.name} -&gt; Image image" name="out_Image_image" format="auto" from_work_dir="image_galaxy.output"> 70 <data label="${tool.name} -&gt; Image fits" name="out_Image_fits" format="auto" from_work_dir="fits_galaxy.output">
82 <filter>_data_product['_selector'] == 'Image'</filter> 71 <filter>_data_product['_selector'] == 'Image'</filter>
83 </data> 72 </data>
84 <data label="${tool.name} -&gt; Spectrum picture_png" name="out_Spectrum_picture_png" format="auto" from_work_dir="picture_png_galaxy.output"> 73 <data label="${tool.name} -&gt; Spectrum png" name="out_Spectrum_png" format="auto" from_work_dir="png_galaxy.output">
85 <filter>_data_product['_selector'] == 'Spectrum'</filter> 74 <filter>_data_product['_selector'] == 'Spectrum'</filter>
86 </data> 75 </data>
87 <data label="${tool.name} -&gt; Spectrum spectrum_astropy_table" name="out_Spectrum_spectrum_astropy_table" format="auto" from_work_dir="spectrum_astropy_table_galaxy.output"> 76 <data label="${tool.name} -&gt; Spectrum table_confidence_contour" name="out_Spectrum_table_confidence_contour" format="auto" from_work_dir="table_confidence_contour_galaxy.output">
88 <filter>_data_product['_selector'] == 'Spectrum'</filter> 77 <filter>_data_product['_selector'] == 'Spectrum'</filter>
89 </data> 78 </data>
90 <data label="${tool.name} -&gt; Spectrum_gammapy picture_png" name="out_Spectrum_gammapy_picture_png" format="auto" from_work_dir="picture_png_galaxy.output"> 79 <data label="${tool.name} -&gt; Spectrum table_spectrum" name="out_Spectrum_table_spectrum" format="auto" from_work_dir="table_spectrum_galaxy.output">
91 <filter>_data_product['_selector'] == 'Spectrum_gammapy'</filter> 80 <filter>_data_product['_selector'] == 'Spectrum'</filter>
92 </data> 81 </data>
93 <data label="${tool.name} -&gt; Spectrum_gammapy spectrum_astropy_table" name="out_Spectrum_gammapy_spectrum_astropy_table" format="auto" from_work_dir="spectrum_astropy_table_galaxy.output"> 82 <data label="${tool.name} -&gt; Lightcurve png" name="out_Lightcurve_png" format="auto" from_work_dir="png_galaxy.output">
94 <filter>_data_product['_selector'] == 'Spectrum_gammapy'</filter>
95 </data>
96 <data label="${tool.name} -&gt; Lightcurve picture" name="out_Lightcurve_picture" format="auto" from_work_dir="picture_galaxy.output">
97 <filter>_data_product['_selector'] == 'Lightcurve'</filter> 83 <filter>_data_product['_selector'] == 'Lightcurve'</filter>
98 </data> 84 </data>
99 <data label="${tool.name} -&gt; Lightcurve lightcurve_astropy_table" name="out_Lightcurve_lightcurve_astropy_table" format="auto" from_work_dir="lightcurve_astropy_table_galaxy.output"> 85 <data label="${tool.name} -&gt; Lightcurve table" name="out_Lightcurve_table" format="auto" from_work_dir="table_galaxy.output">
100 <filter>_data_product['_selector'] == 'Lightcurve'</filter> 86 <filter>_data_product['_selector'] == 'Lightcurve'</filter>
101 </data> 87 </data>
102 </outputs> 88 </outputs>
103 <tests> 89 <tests>
104 <test expect_num_outputs="2"> 90 <test expect_num_outputs="2">
107 <param name="src_name" value="Crab" /> 93 <param name="src_name" value="Crab" />
108 <param name="RA" value="83.6287" /> 94 <param name="RA" value="83.6287" />
109 <param name="DEC" value="22.0147" /> 95 <param name="DEC" value="22.0147" />
110 <param name="T1" value="2000-10-09T13:16:00.0" /> 96 <param name="T1" value="2000-10-09T13:16:00.0" />
111 <param name="T2" value="2022-10-10T13:16:00.0" /> 97 <param name="T2" value="2022-10-10T13:16:00.0" />
112 <param name="Radius" value="2.5" /> 98 <param name="Radius" value="1.0" />
113 <param name="pixsize" value="0.1" /> 99 <param name="pixsize" value="0.05" />
114 <param name="Emin" value="100.0" /> 100 <param name="Emin" value="1" />
115 <param name="Emax" value="10000.0" /> 101 <param name="Emax" value="100.0" />
116 </conditional> 102 </conditional>
117 <assert_stdout> 103 <assert_stdout>
118 <has_text text="*** Job finished successfully ***" /> 104 <has_text text="*** Job finished successfully ***" />
119 </assert_stdout> 105 </assert_stdout>
120 </test> 106 </test>
121 <test expect_num_outputs="2"> 107 <test expect_num_outputs="3">
122 <conditional name="_data_product"> 108 <conditional name="_data_product">
123 <param name="_selector" value="Spectrum" /> 109 <param name="_selector" value="Spectrum" />
124 <param name="src_name" value="PKS 2155-304" /> 110 <param name="src_name" value="PKS 2155-304" />
125 <param name="RA" value="329.716938" /> 111 <param name="RA" value="329.716938" />
126 <param name="DEC" value="-30.225588" /> 112 <param name="DEC" value="-30.225588" />
127 <param name="T1" value="2000-10-09T13:16:00.0" /> 113 <param name="T1" value="2000-10-09T13:16:00.0" />
128 <param name="T2" value="2022-10-10T13:16:00.0" /> 114 <param name="T2" value="2022-10-10T13:16:00.0" />
129 <param name="Radius" value="2.5" /> 115 <param name="Radius" value="2.5" />
130 <param name="R_s" value="0.2" /> 116 <param name="R_s" value="0.2" />
131 <param name="Emin" value="100.0" /> 117 <param name="Emin" value="0.1" />
132 <param name="Emax" value="10000.0" /> 118 <param name="Emax" value="100.0" />
133 <param name="NEbins" value="20" /> 119 <param name="NEbins" value="30" />
134 </conditional> 120 <param name="Efit_min" value="0.2" />
135 <assert_stdout> 121 <param name="Efit_max" value="10.0" />
136 <has_text text="*** Job finished successfully ***" />
137 </assert_stdout>
138 </test>
139 <test expect_num_outputs="2">
140 <conditional name="_data_product">
141 <param name="_selector" value="Spectrum_gammapy" />
142 <param name="src_name" value="PKS 2155-304" />
143 <param name="RA" value="329.716938" />
144 <param name="DEC" value="-30.225588" />
145 <param name="T1" value="2000-10-09T13:16:00.0" />
146 <param name="T2" value="2022-10-10T13:16:00.0" />
147 <param name="Radius" value="2.5" />
148 <param name="R_s" value="0.5" />
149 <param name="Emin" value="100.0" />
150 <param name="Emax" value="10000.0" />
151 <param name="NEbins" value="20" />
152 </conditional> 122 </conditional>
153 <assert_stdout> 123 <assert_stdout>
154 <has_text text="*** Job finished successfully ***" /> 124 <has_text text="*** Job finished successfully ***" />
155 </assert_stdout> 125 </assert_stdout>
156 </test> 126 </test>
158 <conditional name="_data_product"> 128 <conditional name="_data_product">
159 <param name="_selector" value="Lightcurve" /> 129 <param name="_selector" value="Lightcurve" />
160 <param name="src_name" value="Crab" /> 130 <param name="src_name" value="Crab" />
161 <param name="RA" value="83.6287" /> 131 <param name="RA" value="83.6287" />
162 <param name="DEC" value="22.0147" /> 132 <param name="DEC" value="22.0147" />
163 <param name="T1" value="2003-10-09T13:16:00.0" /> 133 <param name="T1" value="2004-11-20T13:16:00.0" />
164 <param name="T2" value="2005-10-10T13:16:00.0" /> 134 <param name="T2" value="2004-12-20T13:16:00.0" />
165 <param name="Radius" value="2.5" /> 135 <param name="Radius" value="2.5" />
166 <param name="R_s" value="0.2" /> 136 <param name="R_s" value="0.2" />
167 <param name="Emin" value="100.0" /> 137 <param name="Emin" value="1" />
168 <param name="Emax" value="10000.0" /> 138 <param name="Emax" value="100.0" />
169 <param name="NTbins" value="10" /> 139 <param name="NTbins" value="30" />
170 </conditional> 140 </conditional>
171 <assert_stdout> 141 <assert_stdout>
172 <has_text text="*** Job finished successfully ***" /> 142 <has_text text="*** Job finished successfully ***" />
173 </assert_stdout> 143 </assert_stdout>
174 </test> 144 </test>
183 sky coordinates (Right Ascention and Declinaiton), in the energy range 153 sky coordinates (Right Ascention and Declinaiton), in the energy range
184 that can be set by adjusting the ``Emin`` and ``Emax`` parameters and in 154 that can be set by adjusting the ``Emin`` and ``Emax`` parameters and in
185 the time range that can be adjusted setting the ``T1`` (start time) and 155 the time range that can be adjusted setting the ``T1`` (start time) and
186 ``T2`` (stop time) parameters. 156 ``T2`` (stop time) parameters.
187 157
158 For the spectra, the analysis performs histogramming of events in
159 energy, in the number ``NEbins`` of energy bins homogeneously spaces in
160 logarithm of energy, beterrn ``Emin`` and ``Emax``. Conversion of the
161 counts to the physical flux units is done by dividing by the exposure
162 time and effective area that is extracted from the Instrument Response
163 Functions (IRF). The result is shown with black data points. This simple
164 estimate of flux in energy bins does not take into account the event
165 energy estimation errors.
166
167 The source signal is extracted from a circular region of the radius
168 ``R_s``\ (adjustable parameter) around the source posiiton. The
169 background estimate is done using the &#8220;wobble&#8221; method, from a position
170 opposite with respect to the signal extraction region in the camera,
171 with respect to the center of the telescope field-of-view.
172
173 A powerlaw fit to the spectrum is done using forward folding method,
174 properly taking into account the error of energy estimation. The results
175 of the spectral fitting include the 68% confidence contour for the
176 spectral parameters (slope and normalisaiton of the powerlaw spectrum).
177 The first entry in the &#8220;contour&#8221; table is the best-fit value of the fit.
178 The energy range of fitting can be adjusted with the ``Efit_min``,
179 ``Efit_max`` parameters.
180
188 The lightcurves are produced by hystrogramming of the events in time, in 181 The lightcurves are produced by hystrogramming of the events in time, in
189 the number ``NTbins`` of time intervals of equalt time width between 182 the number ``NTbins`` of time intervals of equalt time width between
190 ``T1`` (start time) and ``T2`` (stop time). The events are selected in a 183 ``T1`` (start time) and ``T2`` (stop time). The events are selected in a
191 desired energy range between ``Emin`` and ``Emax`` from a circular 184 desired energy range between ``Emin`` and ``Emax``. The source and
192 region of the radius ``R_s`` (in degrees) around the source position 185 backgorund counts are computed in the same way as for the spectral
193 ``RA``,\ ``DEC``. Conversion of the counts to the physical flux units is 186 fitting. Conversion of the counts to the physical flux units is done by
194 done by dividing by the exposure time and effective area that is 187 dividing by the exposure time and effective area that is extracted from
195 extracted from the Instrument Response Functions (IRF). 188 the IRF.
196
197 For the spectra, two alternative tools are considered. The service
198 ``Spectrum`` performs histogramming of the events in energy, in the
199 number ``NEbins`` of energy bins homogeneously spaces in logarithm of
200 energy, beterrn ``Emin`` and ``Emax``. Conversion of the counts to the
201 physical flux units is done by dividing by the exposure time and
202 effective area that is extracted from the IRF. This method does not take
203 into account the energy bias and can result in a wrong spectral shape at
204 the low-energy threshold where the bias is strongest.
205
206 An alternative spectral extraction is done using
207 `Gammapy &lt;https://gammapy.org/&gt;`__, following the script `Spectrum
208 Analysis &lt;https://docs.gammapy.org/0.18.2/tutorials/spectrum_analysis.html&gt;`__.
209 It performs forward folding of the spectral model (a cut-off powerlaw by
210 default) with the IRF and fits the folded model to the binned count data
211 in the energy range between ``Emin`` and ``Emax`` in ``NEbins``
212 logarithmically spaced energy bins.
213 </help> 189 </help>
214 <citations> 190 <citations>
215 <citation type="doi">10.5281/zenodo.1421098</citation> 191 <citation type="doi">10.5281/zenodo.1421098</citation>
216 </citations> 192 </citations>
217 </tool> 193 </tool>