view xarray_import_data.xml @ 0:f1b185fc409a draft default tip

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/xarray_import_data commit 99843e9b86bfb355026559d36e29ed5a262aa9b0
author ecology
date Thu, 14 Aug 2025 08:54:07 +0000
parents
children
line wrap: on
line source

<tool id="xarray_import_data" name="Xarray Import Data" version="0.1.0" profile="22.05">
    <description>
        Import a dataset from an OPeNDAP URL and convert it to a local NetCDF file using xarray.
    </description>
    <requirements>
        <requirement type="package" version="2025.4.0">xarray</requirement>
        <requirement type="package" version="3">python</requirement>
        <requirement type="package" version="1.6.0">netcdf4</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        python '$__tool_directory__/xarray_import_data.py' '$opendap_url' '$decode_times' '$decode_cf' '$output_dataset' 
    ]]></command>
    <inputs>
        <param name="opendap_url" type="text" format="netcdf" label="OPeNDAP URL"
            help="OPeNDAP URL to a dataset, also see https://docs.xarray.dev/en/stable/user-guide/io.html#opendap"
            optional="false">
            <validator type="regex" message="Type a valid url">^(https:|http:|\.)\S*</validator>
        </param>
        <param name="decode_times" type="boolean" label="Decode times"
            help="If true, decode time variables to datetime objects. If false, keep them as raw data."
            checked="true" />
        <param name="decode_cf" type="boolean" label="Decode CF conventions"
            help="Whether to decode according to CF conventions"
            checked="true" />
    </inputs>
    <outputs>
        <data name="output_dataset" from_work_dir="xarray_imported_data" format="netcdf"
            label="xarray dataset" />
    </outputs>
    <tests>
        <test>
            <param name="opendap_url"
                value="http://test.opendap.org:8080/opendap/catalog/data/nc/data.nc" />
            <output name="output_dataset" ftype="netcdf">
                <assert_contents>
                    <has_size min="17K" max="18K" />
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
==================
Xarray Import Data
==================

**What it does**

Open a dataset from an OPeNDAP URL and convert it to a NetCDF file using xarray and netcdf4.

|

**How to use it**

Pass a valid OPeNDAP URL to the `opendap_url` parameter. The tool will download the dataset and save it as a local NetCDF file.

For big datasets consider subsetting the dataset in the url using `<URL>?var_name1[start:step:end],var_name2[start:step:end]`

|

**Links**
 https://docs.xarray.dev/en/stable/user-guide/io.html#opendap
 https://www.opendap.org/
    ]]>
    </help>
    <citations>
        <citation type="doi">10.5334/jors.148</citation>
    </citations>
</tool>