view csv2fits.xml @ 1:eba50a1f228e draft default tip

planemo upload for repository https://github.com/esg-epfl-apc/tools-astro/tree/main/tools/astropytools commit 8e0f38a23e84e67d0e199a99ec318d334f928ade
author astroteam
date Fri, 04 Jul 2025 13:18:26 +0000
parents 7f5c597801f0
children
line wrap: on
line source


<tool id="astropy_csv2fits" name="csv2fits" version="0.1.0+galaxy1" 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>