view xarray_netcdf2netcdf.xml @ 2:e87073edecd6 draft

"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 2166974df82f97557b082a9e55135098e61640c4"
author ecology
date Thu, 20 Jan 2022 17:08:29 +0000
parents 1a91e551f3a9
children c91c27b63fb2
line wrap: on
line source

<tool id="xarray_netcdf2netcdf" name="NetCDF xarray operations" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>manipulate xarray from netCDF and save back to netCDF</description>
    <macros>
        <import>macros.xml</import>
        <import>macros_netcdf2netcdf.xml</import>
        <import>macros_tests_netcdf2netcdf.xml</import>
    </macros>
    <expand macro="edam_ontology"/>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">xarray</requirement>
        <requirement type="package" version="3">python</requirement>
        <requirement type="package" version="1.5.8">netcdf4</requirement>
        <requirement type="package" version="2021.12.0">dask</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
    mkdir output_dir &&
    python '$__tool_directory__/xarray_netcdf2netcdf.py'
          '$input'
          '$variable.var'
           --filter
    #for $i,$uc in enumerate($subset_coords.tsel.user_choice)
        #if $uc.condi_between.comparator == "sl"
            '${uc.dim}#${uc.condi_between.comparator}#${uc.condi_between.t1}#${uc.condi_between.t2}'
        #elif $subset_coords.tsel.by_click == "sel" and $uc.condi_between.method != 'None'
            '${uc.dim}#${uc.condi_between.comparator}#${uc.condi_between.value}#${uc.condi_between.method}'
        #else
            '${uc.dim}#${uc.condi_between.comparator}#${uc.condi_between.value}'
        #end if
    #end for
    #if $subset_coords.tsel.by_click == "sel"
        --selection
    #end if
    #if $variable.scale
        --scale '$variable.scale'
    #end if
    #if ($variable.write_all) or (str($variable.var) == 'None')
         --write_all
    #end if
    #if $variable.keep_attributes
         --keep_attributes
    #end if
    #if str($mask_values.mask_condi.mask_option) == 'drop'
        --drop
    #elif str($mask_values.mask_condi.mask_option) == 'other'
        --other '$mask_values.mask_condi.set_other'
    #end if
    #if str($mask_values.where_condition) != ""
        --where '$mask_values.where_condition'
    #end if
           --verbose
           --output '$output_netcdf'
    ]]>    </command>
    <inputs>
        <param type="data" name="input" multiple="true" min="1" label="Input netcdf file" format="netcdf"/>
        <param type="data" label="Metadata Infos" name="var_tab" format="tabular" help="Select the tabular file which summarize the available variables and dimensions."/>
        <expand macro="section_variables"/>
        <expand macro="section_coords"/>
        <expand macro="section_where"/>
    </inputs>
    <outputs>
        <data name="output_netcdf" format="netcdf"/>
    </outputs>
    <expand macro="section_tests"/>
    <help><![CDATA[
**What it does**

Select a variable ans can restrict over any of its dimension and apply a scaling (1 by default).
the result is stored in a new netCDF file.
One can also select the range of time (for timeseries) to apply these operations over the range only
when a range of time is selected and when scaling, one can choose to save the entire timeseries or
the selected range only.
when scaling, one can add additional filters on dimensions (typically used to filter 
over latitudes and longitudes)


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

The xarray select tool can be used after the xarray Info and xarray Coord.
    ]]>    </help>
    <expand macro="citations"/>
</tool>