diff csv2fits.xml @ 0:7f5c597801f0 draft

planemo upload for repository https://github.com/esg-epfl-apc/tools-astro/tree/main/tools/astropytools commit b794237f7f48d27404592039d3d9ed50aed621e4
author astroteam
date Wed, 21 May 2025 14:53:34 +0000
parents
children eba50a1f228e
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/csv2fits.xml	Wed May 21 14:53:34 2025 +0000
@@ -0,0 +1,45 @@
+
+<tool id="astropy_csv2fits" name="csv2fits" version="0.1.0+galaxy0" profile="24.0">
+  <requirements>
+    <requirement type="package" version="6.1.7">astropy</requirement>
+  </requirements>
+      <command detect_errors="exit_code"><![CDATA[
+        python '$py_script_file' 
+    ]]></command>
+
+    <configfiles>
+      <configfile name="py_script_file">
+from astropy.io import ascii
+
+t = ascii.read("$input_file", delimiter='$input_file.metadata.delimiter')
+t.write("$output", format='fits', overwrite=True)
+      </configfile>
+    </configfiles>
+  <inputs>
+    <param name="input_file" type="data" label="Input File" format="csv,tsv" optional="false" />
+  </inputs>
+  <outputs>
+    <data name="output" format="fits" />
+  </outputs>
+  <tests>
+    <test expect_num_outputs="1">
+      <param name="input_file" value="fitstable.csv" />
+      <output name="output" file="fitstable.fits" />
+    </test>
+    <test expect_num_outputs="1">
+      <param name="input_file" value="fitstable.tsv" />
+      <output name="output" file="fitstable.fits" />
+    </test>
+  </tests>
+    <help><![CDATA[
+Convert a text table (CSV or TSV) to the binary table in the first extension of the FITS file.
+
+This tool is a simple script based on Astropy package. See `astropy help <https://docs.astropy.org/en/latest/io/fits/>`_
+for further documentation. 
+    ]]></help>
+    <citations>
+        <citation type="doi">
+            10.3847/1538-4357/ac7c74
+        </citation>
+    </citations>
+</tool>
\ No newline at end of file