view xarray_metadata_info.xml @ 1:7edbe5ae8b72 draft

"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit f1455c158011dc4aab0fd469cf794be6f4142992"
author ecology
date Fri, 22 May 2020 05:18:55 -0400
parents 965fcab0cd9f
children e8650cdf092f
line wrap: on
line source

<tool id="xarray_metadata_info" name="NetCDF xarray Metadata Info" version="0.15.1">
    <description>summarize content of a Netcdf file</description>
    <requirements>
        <requirement type="package" version="3">python</requirement>
        <requirement type="package" version="1.5.3">netcdf4</requirement>
        <requirement type="package" version="0.15.1">xarray</requirement>
        <requirement type="package" version="0.7.0">geopandas</requirement>
        <requirement type="package" version="1.7.0">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>

</tool>