view xarray_metadata_info.xml @ 3:663268794710 draft

"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
author ecology
date Sun, 06 Jun 2021 08:49:43 +0000
parents e8650cdf092f
children 9bbaab36a5d4
line wrap: on
line source

<tool id="xarray_metadata_info" name="NetCDF xarray Metadata Info" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>summarize content of a Netcdf file</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="edam_ontology"/>
    <requirements>
        <requirement type="package" version="3">python</requirement>
        <requirement type="package" version="1.5.6">netcdf4</requirement>
        <requirement type="package" version="@TOOL_VERSION@">xarray</requirement>
        <requirement type="package" version="0.9.0">geopandas</requirement>
        <requirement type="package" version="1.7.1">shapely</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        python3 '$__tool_directory__/xarray_tool.py' '$input' --info '$info' --summary '$output'
    ]]></command>
    <inputs>
        <param type="data" name="input" label="Netcdf file" format="netcdf,h5" help="Netcdf file you need information about."/>
    </inputs>
    <outputs>
        <data name="output" format="tabular" label="Metadata infos from ${input.name}" from_work_dir="variables.tabular"/>
        <data name="info" label="info file" format="txt"/>
    </outputs>
    <tests>
        <test>
             <param name="input" value="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc"/>
             <param name="output" value="Metadata_infos_from_dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc.Variables.tab"/>
             <output name="info" value="info_file.txt">
                 <assert_contents>
                     <has_text_matching expression="depth\s+=\s+1"/>
                     <has_text_matching expression="latitude\s+=\s+97"/>
                     <has_text_matching expression="longitude\s+=\s+103"/>
                     <has_text_matching expression="time\s+=\s+145"/>
                 </assert_contents>
             </output>
             <output name="output" ftype="tabular" file="Metadata_infos_from_dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc.Variables.tab">
                 <assert_contents>
                     <has_text_matching expression="VariableName\tNumberOfDimensions\tDim0Name\tDim0Size\tDim1Name\tDim1Size\tDim2Name\tDim2Size\tDim3Name\tDim3Size"/>
                     <has_text_matching expression="phy\t4\ttime\t145\tdepth\t1\tlatitude\t97\tlongitude\t103"/>
                     <has_text_matching expression="chl\t4\ttime\t145\tdepth\t1\tlatitude\t97\tlongitude\t103"/>
                     <has_text_matching expression="nh4\t4\ttime\t145\tdepth\t1\tlatitude\t97\tlongitude\t103"/>
                     <has_text_matching expression="time\t1\ttime\t145"/>
                     <has_text_matching expression="longitude\t1\tlongitude\t103"/>
                     <has_text_matching expression="latitude\t1\tlatitude\t97"/>
                     <has_text_matching expression="depth\t1\tdepth\t1"/>
                 </assert_contents>
             </output>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

First the tool will give general information about the input in a 'info file' output. (command $ncdump -h inputfile)

Then, a general tabular 'variables' summarize dimensions details inside each available variable.


The summary tabular file has the general structure :


    Variable1    Var1_Number_of_Dim    Dim1    Dim1_size   ...    DimN    DimN_size

    VariableX    VarX_Number_of_Dim    DimX1   DimX1_size  ...    DimXN   DimXN_size

    ...


**Input**

A netcdf file (xxx.nc).

**Outputs**

An Information file.

A summary tabular file.


--------------------------------

The Netcdf Info tool use the netcdf functions : https://www.unidata.ucar.edu/software/netcdf/docs/index.html

Run this tool before considering using Netcdf Read.
    ]]></help>
    <expand macro="citations"/>
</tool>