Mercurial > repos > ecology > xarray_mapplot
comparison xarray_mapplot.xml @ 0:d7479b6dfbe8 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:51:12 +0000 |
| parents | |
| children | dc05bf0af58f |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:d7479b6dfbe8 |
|---|---|
| 1 <tool id="xarray_mapplot" name="NetCDF xarray map plotting" profile="20.05" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@"> | |
| 2 <description>Visualize netCDF variables on a geographical map</description> | |
| 3 <macros> | |
| 4 <import>macros.xml</import> | |
| 5 </macros> | |
| 6 <expand macro="edam_ontology"/> | |
| 7 <requirements> | |
| 8 <requirement type="package" version="3">python</requirement> | |
| 9 <requirement type="package" version="1.5.6">netcdf4</requirement> | |
| 10 <requirement type="package" version="@TOOL_VERSION@">xarray</requirement> | |
| 11 <requirement type="package" version="0.19.0">cartopy</requirement> | |
| 12 <requirement type="package" version="3.4.2">matplotlib</requirement> | |
| 13 <requirement type="package" version="1.2">cmcrameri</requirement> | |
| 14 </requirements> | |
| 15 <command detect_errors="exit_code"><![CDATA[ | |
| 16 mkdir output_dir && | |
| 17 mkdir -p `pwd`/mlp_tmpdir && | |
| 18 MPLCONFIGDIR=`pwd`/mlp_tmpdir && | |
| 19 echo "Galaxy xarray version @TOOL_VERSION@" > $version && | |
| 20 python '$__tool_directory__/xarray_mapplot.py' '$input' '$var' | |
| 21 #if $condi_datetime.datetime=="yes" | |
| 22 --time="$condi_datetime.time_values" | |
| 23 #end if | |
| 24 --latitude='$lat_dim' | |
| 25 --longitude='$lon_dim' | |
| 26 #if $colorbar_label | |
| 27 --label='$colorbar_label' | |
| 28 #end if | |
| 29 #if $title | |
| 30 --title=$title | |
| 31 #end if | |
| 32 #if $cmap | |
| 33 --cmap='$cmap' | |
| 34 #end if | |
| 35 #if $proj | |
| 36 --proj='$proj' | |
| 37 #end if | |
| 38 #if $land | |
| 39 --land='$land' | |
| 40 #end if | |
| 41 #if $ocean | |
| 42 --ocean='$ocean' | |
| 43 #end if | |
| 44 #if $coastline | |
| 45 --coastline='$coastline' | |
| 46 #end if | |
| 47 #if $borders | |
| 48 --borders='$borders' | |
| 49 #end if | |
| 50 #if $threshold | |
| 51 --threshold='$threshold' | |
| 52 #end if | |
| 53 #if $range | |
| 54 --range='$range' | |
| 55 #end if | |
| 56 #if $xlim | |
| 57 --xlim='$xlim' | |
| 58 #end if | |
| 59 #if $ylim | |
| 60 --ylim='$ylim' | |
| 61 #end if | |
| 62 #if $shift | |
| 63 --shift | |
| 64 #end if | |
| 65 --output plot.png | |
| 66 --verbose && | |
| 67 mv *.png output_dir | |
| 68 ]]></command> | |
| 69 <inputs> | |
| 70 <param type="data" name="input" label="Input netcdf file" format="netcdf"/> | |
| 71 <param type="data" label="Tabular of variables" name="var_tab" format="tabular" help="Select the tabular file which summarize the available variables and dimensions."/> | |
| 72 <param name="var" type="select" label="Choose the variable to plot"> | |
| 73 <options from_dataset="var_tab"> | |
| 74 <column name="name" index="0"/> | |
| 75 <column name="value" index="0"/> | |
| 76 </options> | |
| 77 </param> | |
| 78 <param name="lat_dim" type="select" label="Name of latitude coordinate" > | |
| 79 <options from_dataset="var_tab"> | |
| 80 <column name="value" index="0"/> | |
| 81 </options> | |
| 82 </param> | |
| 83 <param name="lon_dim" type="select" label="Name of longitude coordinate" > | |
| 84 <options from_dataset="var_tab"> | |
| 85 <column name="value" index="0"/> | |
| 86 </options> | |
| 87 </param> | |
| 88 <conditional name="condi_datetime"> | |
| 89 <param name="datetime" type="select" label="Datetime selection" help="Use this option when your dataset contains multiple times/dates"> | |
| 90 <option value="no">No</option> | |
| 91 <option value="yes">Yes</option> | |
| 92 </param> | |
| 93 <when value="no"></when> | |
| 94 <when value="yes"> | |
| 95 <param type="data" label="Tabular of time values" name="time_tab" format="tabular" help="File containing time values."/> | |
| 96 <param name="time_values" type="select" multiple="true" label="Choose the times to plot"> | |
| 97 <options from_dataset="time_tab"> | |
| 98 <column name="name" index="1"/> | |
| 99 <column name="value" index="0"/> | |
| 100 </options> | |
| 101 </param> | |
| 102 </when> | |
| 103 </conditional> | |
| 104 <param name="xlim" type="text" optional="true" label="longitudes values 'lonW,lonE' for limited geographical area (optional and only available with some projections)" /> | |
| 105 <param name="ylim" type="text" value="" optional="true" label="latitudes values 'latS,latN' for limited geographical area (optional and only available with some projections)" /> | |
| 106 <param name="shift" type="select" optional="true" display="radio" label="Shift longitudes [0,360] --> [-180,180]"> | |
| 107 <option value="" selected="true">No</option> | |
| 108 <option value="Yes">Yes</option> | |
| 109 </param> | |
| 110 <param name="range" type="text" optional="true" label="Range of values for plotting e.g. minimum value abd maximum value (minval,maxval) (optional)" /> | |
| 111 <param name="threshold" type="float" optional="true" label="Do not plot values below this threshold (optional)" /> | |
| 112 <expand macro="customize_appearance_plots" /> | |
| 113 <param name="proj" type="text" optional="true" label='Specify the projection (proj4) on which we draw e.g. {"proj":"PlateCarree"} with double quote (optional)'> | |
| 114 <sanitizer> | |
| 115 <valid initial="string.ascii_letters,string.digits,string.punctuation,string.whitespace"> | |
| 116 <add value="{" /> | |
| 117 <add value="}" /> | |
| 118 </valid> | |
| 119 </sanitizer> | |
| 120 </param> | |
| 121 | |
| 122 </inputs> | |
| 123 <outputs> | |
| 124 <data name="version" format="tabular" label="Tool version"/> | |
| 125 <collection type="list" name="output_dir" label="Map plots"> | |
| 126 <discover_datasets pattern="__name_and_ext__" directory="output_dir"/> | |
| 127 </collection> | |
| 128 </outputs> | |
| 129 <tests> | |
| 130 <test> | |
| 131 <param name="input" value="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc"/> | |
| 132 <param name="var" value="nh4"/> | |
| 133 <param name="var_tab" value="var_tab_dataset-ibi"/> | |
| 134 <param name="lat_dim" value="latitude"/> | |
| 135 <param name="lon_dim" value="longitude"/> | |
| 136 <conditional name="condi_datetime"> | |
| 137 <param name="datetime" value="yes"/> | |
| 138 <param name="time_tab" value="time.tabular"/> | |
| 139 <param name="time_values" value="50"/> | |
| 140 </conditional> | |
| 141 <param name="cmap" value="cm.devon_r"/> | |
| 142 <param name="proj" value='{"proj":"PlateCarree"}'/> | |
| 143 <param name="land" value="0.1"/> | |
| 144 <param name="ocean" value="0.1"/> | |
| 145 <param name="coastline" value="0.2"/> | |
| 146 <param name="borders" value="0.5"/> | |
| 147 <output_collection name="output_dir" type="list" count="1"> | |
| 148 <element name="plot_time50" ftype='png' file="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time50.png"/> | |
| 149 </output_collection> | |
| 150 <output name="version" ftype='tabular' file="version.tabular"/> | |
| 151 </test> | |
| 152 <test> | |
| 153 <param name="input" value="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc"/> | |
| 154 <param name="var" value="chl"/> | |
| 155 <param name="var_tab" value="var_tab_dataset-ibi"/> | |
| 156 <param name="lat_dim" value="latitude"/> | |
| 157 <param name="lon_dim" value="longitude"/> | |
| 158 <conditional name="condi_datetime"> | |
| 159 <param name="datetime" value="yes"/> | |
| 160 <param name="time_tab" value="time.tabular"/> | |
| 161 <param name="time_values" value="0,1"/> | |
| 162 </conditional> | |
| 163 <param name="cmap" value="Greens"/> | |
| 164 <param name="proj" value='{"proj":"PlateCarree"}'/> | |
| 165 <param name="land" value="0.1"/> | |
| 166 <param name="ocean" value="0.1"/> | |
| 167 <param name="coastline" value="0.2"/> | |
| 168 <param name="borders" value="0.5"/> | |
| 169 <output_collection name="output_dir" type="list" count="2"> | |
| 170 <element name="plot_time0" ftype="png" file="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time0.png"/> | |
| 171 <element name="plot_time1" ftype="png" file="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time1.png"/> | |
| 172 </output_collection> | |
| 173 <output name="version" ftype="tabular" file="version.tabular"/> | |
| 174 </test> | |
| 175 </tests> | |
| 176 <help><![CDATA[ | |
| 177 **What it does** | |
| 178 | |
| 179 This tool plots a variable on a geographical map. It must be a 2D variable (latitude, longitude) and eventually with | |
| 180 and additional time dimension (specific time to plot should then be selected). | |
| 181 | |
| 182 The appearance of plots can be customized with options as well at the projection. | |
| 183 The projection needs to be given as a PROJ dictionary such as: | |
| 184 - {"proj":"EquidistantConic", "central_longitude": 20.0, "central_latitude": 70.0 } | |
| 185 - {"proj":"AlbersEqualArea", "central_longitude": 20.0, "central_latitude": 70.0 } | |
| 186 - {"proj":"EuroPP"} | |
| 187 | |
| 188 The output is a collection of plots (png format); one per selected times. | |
| 189 | |
| 190 ------------------------------------------------- | |
| 191 | |
| 192 The xarray select tool can be used after the xarray Info and xarray coord. | |
| 193 ]]></help> | |
| 194 <expand macro="citations"/> | |
| 195 </tool> |
