comparison plot_tools_astro_tool.xml @ 0:2b1759ccaa8b draft default tip

planemo upload for repository https://github.com/esg-epfl-apc/tools-astro/tree/main/tools commit f28a8cb73a7f3053eac92166867a48b3d4af28fd
author astroteam
date Fri, 25 Apr 2025 21:48:27 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:2b1759ccaa8b
1 <tool id="plot_tools_astro_tool" name="Plot Tools" version="0.0.1+galaxy0" profile="24.0">
2 <requirements>
3 <requirement type="package" version="2.2.3">pandas</requirement>
4 <requirement type="package" version="3.9.2">matplotlib</requirement>
5 <requirement type="package" version="5.3">astropy</requirement>
6 <requirement type="package" version="1.2.37">oda-api</requirement>
7 <requirement type="package" version="1.2">gammapy</requirement>
8 <requirement type="package" version="9.1.0">ipython</requirement>
9 </requirements>
10 <command detect_errors="exit_code">python '$__tool_directory__/${C_data_product_.DPselector_}.py'</command>
11 <environment_variables>
12 <environment_variable name="BASEDIR">$__tool_directory__</environment_variable>
13 <environment_variable name="GALAXY_TOOL_DIR">$__tool_directory__</environment_variable>
14 </environment_variables>
15 <configfiles>
16 <inputs name="inputs" filename="inputs.json" data_style="paths" />
17 </configfiles>
18 <inputs>
19 <conditional name="C_data_product_">
20 <param name="DPselector_" type="select" label="Data Product">
21 <option value="light_curve" selected="true">light_curve</option>
22 <option value="spectrum" selected="false">spectrum</option>
23 <option value="sky_plot" selected="false">sky_plot</option>
24 </param>
25 <when value="light_curve">
26 <param name="fn" type="data" label="fn" format="data" optional="false" />
27 <param name="skiprows" type="integer" value="0" label="skiprows" optional="false" />
28 <param name="sep" type="select" label="sep" optional="false">
29 <option value="comma">comma</option>
30 <option value="semicolon">semicolon</option>
31 <option value="space">space</option>
32 <option value="tab">tab</option>
33 <option value="whitespace" selected="true">whitespace</option>
34 </param>
35 <param name="column" type="text" value="T" label="column" optional="false" />
36 <param name="weight_col" type="text" value="" label="weight_col" optional="false" />
37 <param name="binning" type="select" label="binning" optional="false">
38 <option value="linear">linear</option>
39 <option value="logarithmic" selected="true">logarithmic</option>
40 </param>
41 <param name="minval" type="float" value="0" label="minval" optional="false" />
42 <param name="maxval" type="float" value="0" label="maxval" optional="false" />
43 <param name="use_quantile_values" type="boolean" label="use_quantile_values" optional="false" />
44 <param name="nbins" type="integer" value="15" label="nbins" optional="false" />
45 <param name="xlabel" type="text" value="time, s" label="xlabel" optional="false" />
46 <param name="ylabel" type="text" value="Ncounts" label="ylabel" optional="false" />
47 <param name="plot_mode" type="select" label="plot_mode" optional="false">
48 <option value="counts">counts</option>
49 <option value="flux" selected="true">flux</option>
50 </param>
51 </when>
52 <when value="spectrum">
53 <param name="fn" type="data" label="fn" format="data" optional="false" />
54 <param name="skiprows" type="integer" value="0" label="skiprows" optional="false" />
55 <param name="sep" type="select" label="sep" optional="false">
56 <option value="auto">auto</option>
57 <option value="comma">comma</option>
58 <option value="semicolon">semicolon</option>
59 <option value="tab">tab</option>
60 <option value="whitespace" selected="true">whitespace</option>
61 </param>
62 <param name="column" type="text" value="c1" label="column" optional="false" />
63 <param name="weight_col" type="text" value="" label="weight_col" optional="false" />
64 <param name="binning" type="select" label="binning" optional="false">
65 <option value="linear">linear</option>
66 <option value="logarithmic" selected="true">logarithmic</option>
67 </param>
68 <param name="minval" type="float" value="0" label="minval" optional="false" />
69 <param name="maxval" type="float" value="0" label="maxval" optional="false" />
70 <param name="nbins" type="integer" value="15" label="nbins" optional="false" />
71 <param name="xlabel" type="text" value="Energy, [eV]" label="xlabel" optional="false" />
72 <param name="ylabel" type="text" value="Flux E^2, [eV]" label="ylabel" optional="false" />
73 <param name="spec_power" type="float" value="2.0" label="spec_power" optional="false" />
74 </when>
75 <when value="sky_plot">
76 <param name="fn" type="data" label="fn" format="data" optional="false" />
77 <param name="skiprows" type="integer" value="0" label="skiprows" optional="false" />
78 <param name="sep" type="select" label="sep" optional="false">
79 <option value="auto">auto</option>
80 <option value="comma">comma</option>
81 <option value="semicolon">semicolon</option>
82 <option value="tab">tab</option>
83 <option value="whitespace" selected="true">whitespace</option>
84 </param>
85 <param name="ra_col" type="text" value="c3" label="ra_col" optional="false" />
86 <param name="dec_col" type="text" value="c4" label="dec_col" optional="false" />
87 <param name="weight_col" type="text" value="" label="weight_col" optional="false" />
88 <param name="binsz" type="float" value="0.02" label="binsz" optional="false" />
89 <param name="window_size_RA" type="float" value="2.0" label="window_size_RA" optional="false" />
90 <param name="window_size_DEC" type="float" value="2.0" label="window_size_DEC" optional="false" />
91 </when>
92 </conditional>
93 </inputs>
94 <outputs>
95 <data label="${tool.name} -&gt; light_curve histogram_data" name="out_light_curve_histogram_data" format="auto" from_work_dir="histogram_data_galaxy.output">
96 <filter>C_data_product_['DPselector_'] == 'light_curve'</filter>
97 </data>
98 <data label="${tool.name} -&gt; light_curve histogram_picture" name="out_light_curve_histogram_picture" format="auto" from_work_dir="histogram_picture_galaxy.output">
99 <filter>C_data_product_['DPselector_'] == 'light_curve'</filter>
100 </data>
101 <data label="${tool.name} -&gt; spectrum histogram_data" name="out_spectrum_histogram_data" format="auto" from_work_dir="histogram_data_galaxy.output">
102 <filter>C_data_product_['DPselector_'] == 'spectrum'</filter>
103 </data>
104 <data label="${tool.name} -&gt; spectrum histogram_picture" name="out_spectrum_histogram_picture" format="auto" from_work_dir="histogram_picture_galaxy.output">
105 <filter>C_data_product_['DPselector_'] == 'spectrum'</filter>
106 </data>
107 <data label="${tool.name} -&gt; sky_plot plot" name="out_sky_plot_plot" format="auto" from_work_dir="plot_galaxy.output">
108 <filter>C_data_product_['DPselector_'] == 'sky_plot'</filter>
109 </data>
110 <data label="${tool.name} -&gt; sky_plot fits_image" name="out_sky_plot_fits_image" format="auto" from_work_dir="fits_image_galaxy.output">
111 <filter>C_data_product_['DPselector_'] == 'sky_plot'</filter>
112 </data>
113 </outputs>
114 <tests>
115 <test expect_num_outputs="2">
116 <conditional name="C_data_product_">
117 <param name="DPselector_" value="light_curve" />
118 <param name="fn" location="https://gitlab.renkulab.io/astronomy/mmoda/plot-tools/-/raw/57cc7b8180fa6c1a286114a9e7b903923f786631/data.tsv" />
119 <param name="skiprows" value="0" />
120 <param name="sep" value="whitespace" />
121 <param name="column" value="T" />
122 <param name="weight_col" value="" />
123 <param name="binning" value="logarithmic" />
124 <param name="minval" value="0" />
125 <param name="maxval" value="0" />
126 <param name="use_quantile_values" value="False" />
127 <param name="nbins" value="15" />
128 <param name="xlabel" value="time, s" />
129 <param name="ylabel" value="Ncounts" />
130 <param name="plot_mode" value="flux" />
131 </conditional>
132 <assert_stdout>
133 <has_text text="*** Job finished successfully ***" />
134 </assert_stdout>
135 </test>
136 <test expect_num_outputs="2">
137 <conditional name="C_data_product_">
138 <param name="DPselector_" value="spectrum" />
139 <param name="fn" location="https://gitlab.renkulab.io/astronomy/mmoda/plot-tools/-/raw/57cc7b8180fa6c1a286114a9e7b903923f786631/data.tsv" />
140 <param name="skiprows" value="0" />
141 <param name="sep" value="whitespace" />
142 <param name="column" value="c1" />
143 <param name="weight_col" value="" />
144 <param name="binning" value="logarithmic" />
145 <param name="minval" value="0" />
146 <param name="maxval" value="0" />
147 <param name="nbins" value="15" />
148 <param name="xlabel" value="Energy, [eV]" />
149 <param name="ylabel" value="Flux E^2, [eV]" />
150 <param name="spec_power" value="2.0" />
151 </conditional>
152 <assert_stdout>
153 <has_text text="*** Job finished successfully ***" />
154 </assert_stdout>
155 </test>
156 <test expect_num_outputs="2">
157 <conditional name="C_data_product_">
158 <param name="DPselector_" value="sky_plot" />
159 <param name="fn" location="https://gitlab.renkulab.io/astronomy/mmoda/plot-tools/-/raw/57cc7b8180fa6c1a286114a9e7b903923f786631/data.tsv" />
160 <param name="skiprows" value="0" />
161 <param name="sep" value="whitespace" />
162 <param name="ra_col" value="c3" />
163 <param name="dec_col" value="c4" />
164 <param name="weight_col" value="" />
165 <param name="binsz" value="0.02" />
166 <param name="window_size_RA" value="2.0" />
167 <param name="window_size_DEC" value="2.0" />
168 </conditional>
169 <assert_stdout>
170 <has_text text="*** Job finished successfully ***" />
171 </assert_stdout>
172 </test>
173 </tests>
174 <help>Plot Tools
175 ==========
176
177 Set of tools for astronomical data visualization
178
179 - sky_plot - visualize sky map using set of events as input
180 - light_cure - calculate and visualize light curve from a set of evebts
181 - spectrum - calculate energy spectrum using set of events as input
182
183 Parameters
184 ----------
185
186 common parameters
187 ~~~~~~~~~~~~~~~~~
188
189 fn - input data file
190
191 skiprows - number of rows to skip
192
193 sep - separator value
194
195 sky_plot parameters
196 ~~~~~~~~~~~~~~~~~~~
197
198 ra_col - RA column (either column name of string cXX, where XX &gt;= 1 is
199 column number)
200
201 dec_col - DEC column (either column name of string cXX, where XX &gt;= 1 is
202 column number)
203
204 weight_col - weight column (either column name of string cXX, where XX
205 &gt;= 1 is column number, or empty string if data doesn&#8217;t contain weights)
206
207 binsz - bin size in degrees
208
209 window_size_RA - size of window (RA) in degrees
210
211 window_size_DEC - size of window (DEC) in degrees
212
213 light_cure parameters
214 ~~~~~~~~~~~~~~~~~~~~~
215
216 column - time column (either column name of string cXX, where XX &gt;= 1 is
217 column number)
218
219 weight_col - weight column (either column name of string cXX, where XX
220 &gt;= 1 is column number, or empty string if data doesn&#8217;t contain weights)
221
222 binning - binning type (&#8216;logarithmic&#8217; or &#8220;linear&#8221;)
223
224 minval - minimal value (use 0 to infer from data)
225
226 maxval - maximal value (use 0 to infer from data)
227
228 use_quantile_values - interpret minval and maxval as quantiles
229
230 nbins=15 - number of bins
231
232 xlabel - plot x-label
233
234 ylabel - plot y-label
235
236 plot_mode - plotting mode (&#8220;counts&#8221; or &#8220;flux&#8221;)
237
238 spectrum parameters
239 ~~~~~~~~~~~~~~~~~~~
240
241 column - energy column (either column name of string cXX, where XX &gt;= 1
242 is column number)
243
244 weight_col- weight column (either column name of string cXX, where XX &gt;=
245 1 is column number, or empty string if data doesn&#8217;t contain weights)
246
247 binning - binning type (&#8216;logarithmic&#8217; or &#8220;linear&#8221;)
248
249 minval - minimal value (use 0 to infer from data)
250
251 maxval - maximal value (use 0 to infer from data)
252
253 nbins - number of bins
254
255 xlabel - plot x-label
256
257 ylabel - plot y-label
258
259 spec_power - multiply spectrum by energy in this power on plot
260 </help>
261 <citations>
262 <citation type="bibtex">@misc{label,
263 title = {Tool repository},
264 url = {https://renkulab.io/projects/astronomy/mmoda/plot-tools},
265 author = {Oleg Kalashev},
266 year = {2024},
267 note = {}
268 }</citation>
269 </citations>
270 </tool>