Commit message:
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit fd8ad4d97db7b1fd3876ff63e14280474e06fdf7 |
added:
macros.xml macros_mapplot.xml macros_netcdf2netcdf.xml macros_tests_netcdf2netcdf.xml macros_timeseries.xml test-data/Metadata_infos_from_dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc.Variables.tab test-data/Test1.tabular test-data/Test2.tabular test-data/all.netcdf test-data/chl_alltimes.nc test-data/chl_nh4.netcdf test-data/chl_phy_where.netcdf test-data/chl_where_drop.netcdf test-data/data_from_20040615.nc test-data/data_to_20040615.nc test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time0.png test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time0_title.png test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time1.png test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time50.png test-data/depth.tabular test-data/info_file.txt test-data/latitude.tabular test-data/longitude.tabular test-data/select_by_values.netcdf test-data/small.netcdf test-data/small_all_variables.netcdf test-data/time.tabular test-data/time_series.png test-data/time_series.tabular test-data/time_series_customized.png test-data/time_series_customized.tabular test-data/var_tab_dataset-ibi test-data/version.tabular test-data/where_condition.txt test-data/where_condition_simple.txt timeseries.py timeseries_plot.xml xarray_info.py xarray_mapplot.py xarray_netcdf2netcdf.py xarray_select.py |
b |
diff -r 000000000000 -r 810820a0d45c macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,28 @@ +<macros> + <token name="@TOOL_VERSION@">2022.3.0</token> + <token name="@VERSION_SUFFIX@">0</token> + <token name="@PROFILE@">20.05</token> + <xml name="edam_ontology"> + <edam_topics> + <edam_topic>topic_0610</edam_topic> + <edam_topic>topic_3050</edam_topic> + </edam_topics> + </xml> + <xml name="citations"> + <citations> + <citation type="bibtex"> + @article{hoyer2017xarray, + title = {xarray: {N-D} labeled arrays and datasets in {Python}}, + author = {Hoyer, S. and J. Hamman}, + journal = {Journal of Open Research Software}, + volume = {5}, + number = {1}, + year = {2017}, + publisher = {Ubiquity Press}, + doi = {10.5334/jors.148}, + url = {http://doi.org/10.5334/jors.148} + } + </citation> + </citations> + </xml> +</macros> |
b |
diff -r 000000000000 -r 810820a0d45c macros_mapplot.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros_mapplot.xml Sun Jul 31 21:23:21 2022 +0000 |
[ |
b'@@ -0,0 +1,213 @@\n+<macros>\r\n+ <xml name="config_map">\r\n+ <configfiles>\r\n+ <configfile name="map_customization"><![CDATA[\r\n+{\r\n+#if $condi_datetime.datetime=="yes"\r\n+"time":"$condi_datetime.time_values",\r\n+#end if\r\n+"latitude":\'$lat_dim\',\r\n+"longitude":\'$lon_dim\',\r\n+#if $colorbar_label\r\n+"label":\'$colorbar_label\',\r\n+#end if\r\n+#if $title\r\n+"title":"$title",\r\n+#end if\r\n+#if $cmap\r\n+"cmap":\'$cmap\',\r\n+#end if\r\n+#if $land\r\n+"land":\'$land\',\r\n+#end if\r\n+#if $ocean\r\n+"ocean":\'$ocean\',\r\n+#end if\r\n+#if $coastline\r\n+"coastline":\'$coastline\',\r\n+#end if\r\n+#if $borders\r\n+"borders":\'$borders\',\r\n+#end if\r\n+#if $threshold\r\n+"threshold":\'$threshold\',\r\n+#end if\r\n+#if $range\r\n+"range":\'$range\',\r\n+#end if\r\n+#if $xlim\r\n+"xlim":\'$xlim\',\r\n+#end if\r\n+#if $ylim\r\n+"ylim":\'$ylim\',\r\n+#end if\r\n+}\r\n+ ]]>\r\n+ </configfile>\r\n+ <configfile name="map_projection"><![CDATA[\r\n+#if $proj\r\n+\'$proj\'\r\n+#end if \r\n+ ]]>\r\n+ </configfile>\r\n+ </configfiles>\r\n+ </xml>\r\n+ <xml name="customize_appearance_plots">\r\n+ <param name="borders" type="float" optional="true" label="Add country borders with alpha value [0-1] (optional)" />\r\n+ <param name="coastline" type="float" optional="true" label="Add coastline with alpha value [0-1] (optional)" />\r\n+ <param name="ocean" type="float" optional="true" label="Add ocean with alpha value [0-1] (optional)" />\r\n+ <param name="land" type="float" optional="true" label="Add land with alpha value [0-1] (optional)" />\r\n+ <param name="title" type="text" optional="true" label="Specify plot title (optional)" />\r\n+ <param name="colorbar_label" type="text" optional="true" label="Set a label for colormap (optional)" />\r\n+ <param name="cmap" type="select" optional="true" label="Specify which colormap to use for plotting (optional)">\r\n+ <option value="cm.batlow">batlow</option>\r\n+ <option value="cm.batlowW">batlowW</option>\r\n+ <option value="cm.batlowK">batlowK</option>\r\n+ <option value="cm.devon">devon</option>\r\n+ <option value="cm.davos">davos</option>\r\n+ <option value="cm.oslo">oslo</option>\r\n+ <option value="cm.lapaz">lapaz</option>\r\n+ <option value="cm.acton">acton</option>\r\n+ <option value="cm.lajolla">lajolla</option>\r\n+ <option value="cm.bilbao">bilbao</option>\r\n+ <option value="cm.grayC">grayC</option>\r\n+ <option value="cm.tokyo">tokyo</option>\r\n+ <option value="cm.turku">turku</option>\r\n+ <option value="cm.bamako">bamako</option>\r\n+ <option value="cm.nuuk">nuuk</option>\r\n+ <option value="cm.hawaii">hawaii</option>\r\n+ <option value="cm.buda">buda</option>\r\n+ <option value="cm.imola">imola</option>\r\n+ <option value="cm.broc">broc</option>\r\n+ <option value="cm.lisbon">lisbon</option>\r\n+ <option value="cm.roma">roma</option>\r\n+ <option value="cm.cork">cork</option>\r\n+ <option value="cm.tofino">tofino</option>\r\n+ <option value="cm.bam">bam</option>\r\n+ <option value="cm.vik">vik</option>\r\n+ <option value="cm.berlin">berlin</option>\r\n+ <option value="cm.vanimo">vanimo</option>\r\n+ <option value="cm.oleron">oleron</option>\r\n+ <option value="cm.bukavu">bukavu</option>\r\n+ <option value="cm.fes">fes</option>\r\n+ <option value="cm.romaO">romaO</option>\r\n+ <option value="cm.bamO">bamO</option>\r\n+ <option value="cm.brocO">brocO</option>\r\n+ <option value="cm.corkO">corkO</option>\r\n+ <option value="cm.vikO">vikO</option>\r\n+ <option value="cm.batlow_r">batlow_r</option>\r\n+ <option value="cm.batlowW_r">batlowW_r</option>\r\n+ <option value="cm.batlowK_r">batlowK_r</option>\r\n+ <option value="cm.devon_r">devon'..b' <option value="BuGn">BuGn</option>\r\n+ <option value="BuPu">BuPu</option>\r\n+ <option value="CMRmap">CMRmap</option>\r\n+ <option value="Dark2">Dark2</option>\r\n+ <option value="GnBu">GnBu</option>\r\n+ <option value="Greens">Greens</option>\r\n+ <option value="Greys">Greys</option>\r\n+ <option value="OrRd">OrRd</option>\r\n+ <option value="Oranges">Oranges</option>\r\n+ <option value="PRGn">PRGn</option>\r\n+ <option value="Paired">Paired</option>\r\n+ <option value="Pastel1">Pastel1</option>\r\n+ <option value="Pastel2">Pastel2</option>\r\n+ <option value="PiYG">PiYG</option>\r\n+ <option value="PuBu">PuBu</option>\r\n+ <option value="PuBuGn">PuBuGn</option>\r\n+ <option value="PuOr">PuOr</option>\r\n+ <option value="PuRd">PuRd</option>\r\n+ <option value="Purples">Purples</option>\r\n+ <option value="RdBu">RdBu</option>\r\n+ <option value="RdGy">RdGy</option>\r\n+ <option value="RdPu">RdPu</option>\r\n+ <option value="RdBu_r">RdBu_r</option>\r\n+ <option value="RdGy_r">RdGy_r</option>\r\n+ <option value="RdPu_r">RdPu_r</option>\r\n+ <option value="RdYlBu">RdYlBu</option>\r\n+ <option value="RdYlGn">RdYlGn</option>\r\n+ <option value="Reds">Reds</option>\r\n+ <option value="Set1">Set1</option>\r\n+ <option value="Set2">Set2</option>\r\n+ <option value="Set3">Set3</option>\r\n+ <option value="Spectral">Spectral</option>\r\n+ <option value="Wistia">Wistia</option>\r\n+ <option value="YlGn">YlGn</option>\r\n+ <option value="YlGnBu">YlGnBu</option>\r\n+ <option value="YlOrBr">YlOrBr</option>\r\n+ <option value="YlOrRd">YlOrRd</option>\r\n+ <option value="afmhot">afmhot</option>\r\n+ <option value="autumn">autumn</option>\r\n+ <option value="binary">binary</option>\r\n+ <option value="bone">bone</option>\r\n+ <option value="brg">brg</option>\r\n+ <option value="bwr">bwr</option>\r\n+ <option value="cool">cool</option>\r\n+ <option value="coolwarm" selected="true">coolwarm</option>\r\n+ <option value="copper">copper</option>\r\n+ <option value="cubehelix">cubehelix</option>\r\n+ <option value="flag">flag</option>\r\n+ <option value="gist_earth">gist_earth</option>\r\n+ <option value="gist_gray">gist_gray</option>\r\n+ <option value="gist_heat">gist_heat</option>\r\n+ <option value="gist_ncar">gist_ncar</option>\r\n+ <option value="gist_rainbow">gist_rainbow</option>\r\n+ <option value="gist_stern">gist_stern</option>\r\n+ <option value="gist_yarg">gist_yarg</option>\r\n+ <option value="gnuplot">gnuplot</option>\r\n+ <option value="gnuplot2">gnuplot2</option>\r\n+ <option value="gray">gray</option>\r\n+ <option value="hot">hot</option>\r\n+ <option value="hsv">hsv</option>\r\n+ <option value="jet">jet</option>\r\n+ <option value="nipy_spectral">nipy_spectral</option>\r\n+ <option value="ocean">ocean</option>\r\n+ <option value="pink">pink</option>\r\n+ <option value="prism">prism</option>\r\n+ <option value="rainbow">rainbow</option>\r\n+ <option value="seismic">seismic</option>\r\n+ <option value="spring">spring</option>\r\n+ <option value="summer">summer</option>\r\n+ <option value="tab10">tab10</option>\r\n+ <option value="tab20">tab20</option>\r\n+ <option value="tab20b">tab20b</option>\r\n+ <option value="tab20c">tab20c</option>\r\n+ <option value="terrain">terrain</option>\r\n+ <option value="winter">winter</option>\r\n+ </param>\r\n+ </xml>\r\n+</macros>\r\n' |
b |
diff -r 000000000000 -r 810820a0d45c macros_netcdf2netcdf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros_netcdf2netcdf.xml Sun Jul 31 21:23:21 2022 +0000 |
b |
b'@@ -0,0 +1,143 @@\n+<macros>\r\n+ <xml name="coord_range">\r\n+ <repeat name="user_choice" title="Filter by coordinate values" min="0" max="20" help="Use this option to filter on the values of the selected coordinate">\r\n+ <param name="dim" type="select" label="Dimensions">\r\n+ <options from_dataset="var_tab">\r\n+ <column name="value" index="0"/>\r\n+ </options>\r\n+ </param>\r\n+ <conditional name="condi_between">\r\n+ <param name="comparator" type="select" label="Comparator">\r\n+ <option value="is">is</option>\r\n+ <option value="from">from</option>\r\n+ <option value="to">to</option>\r\n+ <option value="sl">slice(threshold1,threshold2)</option>\r\n+ </param>\r\n+ <when value="sl">\r\n+ <param name="t1" type="text" value="" label="Choose the start value for slice"/>\r\n+ <param name="t2" type="text" value="" label="Choose the end value for slice"/>\r\n+ </when>\r\n+ <when value="to">\r\n+ <param name="value" type="text" value="" label="Choose the end value"/>\r\n+ </when>\r\n+ <when value="from">\r\n+ <param name="value" type="text" value="" label="Choose the start value"/>\r\n+ </when>\r\n+ <when value="is">\r\n+ <param name="value" type="text" value="" label="Choose the value to select"/>\r\n+ <yield />\r\n+ </when>\r\n+ </conditional>\r\n+ </repeat>\r\n+ </xml>\r\n+ <xml name="section_variables">\r\n+ <section name="variable" title="Select variables">\r\n+ <param name="var" type="select" multiple="true" label="Choose variables to extract">\r\n+ <options from_dataset="var_tab">\r\n+ <column name="name" index="0"/>\r\n+ <column name="value" index="0"/>\r\n+ </options>\r\n+ </param>\r\n+ <param type="float" name="scale" optional="true" help="scale factor (float) to apply to the selected variable (optional and only if a variable is selected)"/>\r\n+ <param name="write_all" type="boolean" checked="false" label="Write all variables to new netCDF file (only if a variable is selected)"/>\r\n+ <param name="keep_attributes" type="boolean" checked="true" label="Keep all attributes (only if a variable is selected)"/>\r\n+ </section>\r\n+ </xml>\r\n+ <xml name="section_coords">\r\n+ <section name="subset_coords" title="Subset by coordinates">\r\n+ <conditional name="tsel">\r\n+ <param name="by_click" type="select" optional="true" label="Coordinate values">\r\n+ <option value="sel">Coordinate values (sel)</option>\r\n+ <option value="isel">Coordinate indices (isel)</option>\r\n+ <option value="isel_list" selected="true">Coordinate values from list</option>\r\n+ </param>\r\n+ <when value="sel">\r\n+ <expand macro="coord_range">\r\n+ <param name="method" type="select" multiple="false" label="Choose selection method">\r\n+ <option value="None">only exact matches</option>\r\n+ <option value="nearest">use nearest valid index value</option>\r\n+ <option value="pad">propagate last valid index value forward</option>\r\n+ <option value="backfill">propagate next valid index value backward</option>\r\n+ </param>\r\n+ </expand>\r\n+ </when>\r\n+ <when value="isel">\r\n+ <expand macro="coord_range"/>\r\n+ </when>\r\n+ <when value="isel_list">\r\n+ <repeat name="user_choice" title="Filte'..b'>\r\n+ <option value="is">is</option>\r\n+ <option value="from">from</option>\r\n+ <option value="to">to</option>\r\n+ <option value="sl">slice(threshold1,threshold2)</option>\r\n+ </param>\r\n+ <when value="sl">\r\n+ <param name="t1" type="select" multiple="false" label="Choose the start value for slice">\r\n+ <options from_dataset="dim_tab">\r\n+ <column name="name" index="1"/>\r\n+ <column name="value" index="0"/>\r\n+ </options>\r\n+ </param>\r\n+ <param name="t2" type="select" multiple="false" label="Choose the end value for slice">\r\n+ <options from_dataset="dim_tab">\r\n+ <column name="name" index="1"/>\r\n+ <column name="value" index="0"/>\r\n+ </options>\r\n+ </param>\r\n+ </when>\r\n+ <when value="is">\r\n+ <param name="value" type="select" multiple="false" label="Choose the value to select">\r\n+ <options from_dataset="dim_tab">\r\n+ <column name="name" index="1"/>\r\n+ <column name="value" index="0"/>\r\n+ </options>\r\n+ </param>\r\n+ </when>\r\n+ <when value="to">\r\n+ <param name="value" type="select" multiple="false" label="Choose the end value">\r\n+ <options from_dataset="dim_tab">\r\n+ <column name="name" index="1"/>\r\n+ <column name="value" index="0"/>\r\n+ </options>\r\n+ </param>\r\n+ </when>\r\n+ <when value="from">\r\n+ <param name="value" type="select" multiple="false" label="Choose the start value">\r\n+ <options from_dataset="dim_tab">\r\n+ <column name="name" index="1"/>\r\n+ <column name="value" index="0"/>\r\n+ </options>\r\n+ </param>\r\n+ </when>\r\n+ </conditional>\r\n+ </repeat>\r\n+ </when>\r\n+ </conditional>\r\n+ </section>\r\n+ </xml>\r\n+ <xml name="section_where">\r\n+ <section name="mask_values" title="Advanced options to mask by values">\r\n+ <conditional name="mask_condi">\r\n+ <param name="mask_option" type="select" multiple="false" label="Option for masked values">\r\n+ <option value="keep" selected="true">Fill with NA</option>\r\n+ <option value="drop">Drop values</option>\r\n+ <option value="other">Set constant</option>\r\n+ </param>\r\n+ <when value="keep"/>\r\n+ <when value="drop"/>\r\n+ <when value="other">\r\n+ <param name="set_other" type="float" value="0" label="Value to use for locations in this object where cond is False." />\r\n+ </when>\r\n+ </conditional>\r\n+ <param name="where_condition" type="data" optional="true" format="txt" label="file containing a where expression" />\r\n+ </section>\r\n+ </xml>\r\n+</macros>\r\n' |
b |
diff -r 000000000000 -r 810820a0d45c macros_tests_netcdf2netcdf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros_tests_netcdf2netcdf.xml Sun Jul 31 21:23:21 2022 +0000 |
b |
b'@@ -0,0 +1,263 @@\n+<macros>\r\n+ <xml name="section_tests">\r\n+ <tests>\r\n+ <test>\r\n+ <param name="input" value="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc"/>\r\n+ <param name="var_tab" value="var_tab_dataset-ibi"/>\r\n+ <section name="variable">\r\n+ <param name="var" value="chl"/>\r\n+ <param name="scale" value="1000.5"/>\r\n+ </section>\r\n+ <section name="subset_coords">\r\n+ <conditional name="tsel">\r\n+ <param name="by_click" value="isel_list"/>\r\n+ <repeat name="user_choice">\r\n+ <param name="dim" value="time"/>\r\n+ <conditional name="condi_between">\r\n+ <param name="comparator" value="sl"/>\r\n+ <param name="t1" value="10"/>\r\n+ <param name="t2" value="12"/>\r\n+ </conditional>\r\n+ </repeat>\r\n+ <repeat name="user_choice">\r\n+ <param name="dim" value="latitude"/>\r\n+ <param name="dim_tab" value="latitude.tabular"/>\r\n+ <conditional name="condi_between">\r\n+ <param name="comparator" value="sl"/>\r\n+ <param name="t1" value="5"/>\r\n+ <param name="t2" value="10"/>\r\n+ </conditional>\r\n+ </repeat>\r\n+ <repeat name="user_choice">\r\n+ <param name="dim" value="longitude"/>\r\n+ <param name="dim_tab" value="longitude.tabular"/>\r\n+ <conditional name="condi_between">\r\n+ <param name="comparator" value="sl"/>\r\n+ <param name="t1" value="4"/>\r\n+ <param name="t2" value="10"/>\r\n+ </conditional>\r\n+ </repeat>\r\n+ </conditional>\r\n+ </section>\r\n+ <output name="output_netcdf" file="small.netcdf" compare="sim_size" delta="1000"/>\r\n+ </test>\r\n+ <test>\r\n+ <param name="input" value="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc"/>\r\n+ <param name="var_tab" value="var_tab_dataset-ibi"/>\r\n+ <section name="variable">\r\n+ <param name="var" value="chl"/>\r\n+ <param name="scale" value="1000.5"/>\r\n+ <param name="write_all" value="true"/>\r\n+ <param name="keep_attribute" value="false"/>\r\n+ </section>\r\n+ <section name="subset_coords">\r\n+ <conditional name="tsel">\r\n+ <param name="by_click" value="isel_list"/>\r\n+ <repeat name="user_choice">\r\n+ <param name="dim" value="time"/>\r\n+ <conditional name="condi_between">\r\n+ <param name="comparator" value="sl"/>\r\n+ <param name="t1" value="10"/>\r\n+ <param name="t2" value="12"/>\r\n+ </conditional>\r\n+ </repeat>\r\n+ <repeat name="user_choice">\r\n+ <param name="dim" value="latitude"/>\r\n+ <param name="dim_tab" value="latitude.tabular"/>\r\n+ <conditional name="condi_between">\r\n+ <param name="comparator" value="sl"/>\r\n+ <param name="t1" value="5"/>\r\n+ <param name="t2" value="1'..b'ame="method" value="nearest"/>\r\n+ </conditional>\r\n+ </repeat>\r\n+ </conditional>\r\n+ </section>\r\n+ <output name="output_netcdf" file="select_by_values.netcdf" compare="sim_size" delta="500"/>\r\n+ </test>\r\n+ <test>\r\n+ <param name="input" value="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc"/>\r\n+ <param name="var_tab" value="var_tab_dataset-ibi"/>\r\n+ <section name="variable">\r\n+ <param name="var" value="chl,phy"/>\r\n+ </section>\r\n+ <section name="mask_values">\r\n+ <conditional name="mask_condi">\r\n+ <param name="mask_option" value="other"/>\r\n+ <param name="set_other" value="1000"/>\r\n+ </conditional>\r\n+ <param name="where_condition" ftype="txt" value="where_condition.txt"/>\r\n+ </section>\r\n+ <output name="output_netcdf" file="chl_phy_where.netcdf" compare="sim_size" delta="500"/>\r\n+ </test>\r\n+ <test>\r\n+ <param name="input" value="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc"/>\r\n+ <param name="var_tab" value="var_tab_dataset-ibi"/>\r\n+ <section name="variable">\r\n+ <param name="var" value="chl"/>\r\n+ <param name="scale" value="1000.5"/>\r\n+ <param name="write_all" value="true"/>\r\n+ <param name="keep_attribute" value="true"/>\r\n+ </section>\r\n+ <section name="subset_coords">\r\n+ <conditional name="tsel">\r\n+ <param name="by_click" value="isel_list"/>\r\n+ <repeat name="user_choice">\r\n+ <param name="dim" value="time"/>\r\n+ <conditional name="condi_between">\r\n+ <param name="comparator" value="sl"/>\r\n+ <param name="t1" value="10"/>\r\n+ <param name="t2" value="12"/>\r\n+ </conditional>\r\n+ </repeat>\r\n+ <repeat name="user_choice">\r\n+ <param name="dim" value="latitude"/>\r\n+ <param name="dim_tab" value="latitude.tabular"/>\r\n+ <conditional name="condi_between">\r\n+ <param name="comparator" value="sl"/>\r\n+ <param name="t1" value="0"/>\r\n+ <param name="t2" value="10"/>\r\n+ </conditional>\r\n+ </repeat>\r\n+ <repeat name="user_choice">\r\n+ <param name="dim" value="longitude"/>\r\n+ <param name="dim_tab" value="longitude.tabular"/>\r\n+ <conditional name="condi_between">\r\n+ <param name="comparator" value="sl"/>\r\n+ <param name="t1" value="1"/>\r\n+ <param name="t2" value="20"/>\r\n+ </conditional>\r\n+ </repeat>\r\n+ </conditional>\r\n+ </section>\r\n+ <section name="mask_values">\r\n+ <conditional name="mask_condi">\r\n+ <param name="mask_option" value="drop"/>\r\n+ </conditional>\r\n+ <param name="where_condition" ftype="txt" value="where_condition_simple.txt"/>\r\n+ </section>\r\n+ <output name="output_netcdf" file="chl_where_drop.netcdf" compare="sim_size" delta="500"/>\r\n+ </test>\r\n+ </tests>\r\n+ </xml>\r\n+</macros>\r\n' |
b |
diff -r 000000000000 -r 810820a0d45c macros_timeseries.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros_timeseries.xml Sun Jul 31 21:23:21 2022 +0000 |
[ |
@@ -0,0 +1,47 @@ +<macros> + <xml name="config_series"> + <configfiles> + <configfile name="series_customization"><![CDATA[ +{ +#if $condi_datetime.datetime=="yes" +#if str($condi_datetime.time_name).strip() +"time_name":'$condi_datetime.time_name', +#end if +#if str($condi_datetime.time_start_value).strip() +"time_start_value":"$condi_datetime.time_start_value", +#end if +#if str($condi_datetime.time_end_value).strip() +"time_end_value":"$condi_datetime.time_end_value", +#end if +#end if +#if str($lon_value).strip() +"lon_value":'$lon_value', +#end if +#if str($lat_value).strip() +"lat_value":'$lat_value', +#end if +#if $lon_name +"lon_name":'$lon_name', +#end if +#if $lat_name +"lat_name":'$lat_name', +#end if +#if str($adv.format_date).strip() +"format_date":'$adv.format_date', +#end if +#if str($adv.plot_title).strip() +"title":'$adv.plot_title', +#end if +#if str($adv.xlabel).strip() +"xlabel":'$adv.xlabel', +#end if +#if str($adv.ylabel).strip() +"ylabel":'$adv.ylabel', +#end if +} + ]]> + </configfile> + </configfiles> + + </xml> +</macros> |
b |
diff -r 000000000000 -r 810820a0d45c test-data/Metadata_infos_from_dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc.Variables.tab --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/Metadata_infos_from_dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc.Variables.tab Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,8 @@ +VariableName NumberOfDimensions Dim0Name Dim0Size Dim1Name Dim1Size Dim2Name Dim2Size Dim3Name Dim3Size +phy 4 time 145 depth 1 latitude 97 longitude 103 +chl 4 time 145 depth 1 latitude 97 longitude 103 +nh4 4 time 145 depth 1 latitude 97 longitude 103 +time 1 time 145 +longitude 1 longitude 103 +latitude 1 latitude 97 +depth 1 depth 1 |
b |
diff -r 000000000000 -r 810820a0d45c test-data/Test1.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/Test1.tabular Sun Jul 31 21:23:21 2022 +0000 |
b |
b'@@ -0,0 +1,146 @@\n+\ttime\tdepth\tlongitude\tlatitude\tphy\n+0\t2002-12-15\t0.5057600140571594\t-2.0000007\t44.0\t1.0500183\n+1\t2003-01-15\t0.5057600140571594\t-2.0000007\t44.0\t1.25\n+2\t2003-02-15\t0.5057600140571594\t-2.0000007\t44.0\t1.3000183\n+3\t2003-03-15\t0.5057600140571594\t-2.0000007\t44.0\t6.0599976\n+4\t2003-04-15\t0.5057600140571594\t-2.0000007\t44.0\t2.25\n+5\t2003-05-15\t0.5057600140571594\t-2.0000007\t44.0\t0.6499939\n+6\t2003-06-15\t0.5057600140571594\t-2.0000007\t44.0\t0.42999268\n+7\t2003-07-15\t0.5057600140571594\t-2.0000007\t44.0\t0.42999268\n+8\t2003-08-15\t0.5057600140571594\t-2.0000007\t44.0\t0.480011\n+9\t2003-09-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+10\t2003-10-15\t0.5057600140571594\t-2.0000007\t44.0\t0.5\n+11\t2003-11-15\t0.5057600140571594\t-2.0000007\t44.0\t0.9299927\n+12\t2003-12-15\t0.5057600140571594\t-2.0000007\t44.0\t1.3900146\n+13\t2004-01-15\t0.5057600140571594\t-2.0000007\t44.0\t1.7400208\n+14\t2004-02-15\t0.5057600140571594\t-2.0000007\t44.0\t4.5\n+15\t2004-03-15\t0.5057600140571594\t-2.0000007\t44.0\t5.5500183\n+16\t2004-04-15\t0.5057600140571594\t-2.0000007\t44.0\t5.3099976\n+17\t2004-05-15\t0.5057600140571594\t-2.0000007\t44.0\t3.75\n+18\t2004-06-15\t0.5057600140571594\t-2.0000007\t44.0\t0.77001953\n+19\t2004-07-15\t0.5057600140571594\t-2.0000007\t44.0\t0.5\n+20\t2004-08-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+21\t2004-09-15\t0.5057600140571594\t-2.0000007\t44.0\t0.4500122\n+22\t2004-10-15\t0.5057600140571594\t-2.0000007\t44.0\t0.480011\n+23\t2004-11-15\t0.5057600140571594\t-2.0000007\t44.0\t0.83999634\n+24\t2004-12-15\t0.5057600140571594\t-2.0000007\t44.0\t1.7400208\n+25\t2005-01-15\t0.5057600140571594\t-2.0000007\t44.0\t1.7700195\n+26\t2005-02-15\t0.5057600140571594\t-2.0000007\t44.0\t1.5500183\n+27\t2005-03-15\t0.5057600140571594\t-2.0000007\t44.0\t7.149994\n+28\t2005-04-15\t0.5057600140571594\t-2.0000007\t44.0\t3.649994\n+29\t2005-05-15\t0.5057600140571594\t-2.0000007\t44.0\t2.5200195\n+30\t2005-06-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+31\t2005-07-15\t0.5057600140571594\t-2.0000007\t44.0\t0.6700134\n+32\t2005-08-15\t0.5057600140571594\t-2.0000007\t44.0\t0.4500122\n+33\t2005-09-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+34\t2005-10-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+35\t2005-11-15\t0.5057600140571594\t-2.0000007\t44.0\t0.6199951\n+36\t2005-12-15\t0.5057600140571594\t-2.0000007\t44.0\t1.1499939\n+37\t2006-01-15\t0.5057600140571594\t-2.0000007\t44.0\t3.5299988\n+38\t2006-02-15\t0.5057600140571594\t-2.0000007\t44.0\t7.1799927\n+39\t2006-03-15\t0.5057600140571594\t-2.0000007\t44.0\t6.5599976\n+40\t2006-04-15\t0.5057600140571594\t-2.0000007\t44.0\t3.8000183\n+41\t2006-05-15\t0.5057600140571594\t-2.0000007\t44.0\t0.95999146\n+42\t2006-06-15\t0.5057600140571594\t-2.0000007\t44.0\t1.5\n+43\t2006-07-15\t0.5057600140571594\t-2.0000007\t44.0\t1.0299988\n+44\t2006-08-15\t0.5057600140571594\t-2.0000007\t44.0\t0.480011\n+45\t2006-09-15\t0.5057600140571594\t-2.0000007\t44.0\t0.49002075\n+46\t2006-10-15\t0.5057600140571594\t-2.0000007\t44.0\t0.480011\n+47\t2006-11-15\t0.5057600140571594\t-2.0000007\t44.0\t0.9299927\n+48\t2006-12-15\t0.5057600140571594\t-2.0000007\t44.0\t1.2099915\n+49\t2007-01-15\t0.5057600140571594\t-2.0000007\t44.0\t1.1499939\n+50\t2007-02-15\t0.5057600140571594\t-2.0000007\t44.0\t1.7000122\n+51\t2007-03-15\t0.5057600140571594\t-2.0000007\t44.0\t5.230011\n+52\t2007-04-15\t0.5057600140571594\t-2.0000007\t44.0\t3.8600159\n+53\t2007-05-15\t0.5057600140571594\t-2.0000007\t44.0\t0.83999634\n+54\t2007-06-15\t0.5057600140571594\t-2.0000007\t44.0\t0.6799927\n+55\t2007-07-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+56\t2007-08-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+57\t2007-09-15\t0.5057600140571594\t-2.0000007\t44.0\t0.5\n+58\t2007-10-15\t0.5057600140571594\t-2.0000007\t44.0\t0.89001465\n+59\t2007-11-15\t0.5057600140571594\t-2.0000007\t44.0\t2.0299988\n+60\t2007-12-15\t0.5057600140571594\t-2.0000007\t44.0\t1.8399963\n+61\t2008-01-15\t0.5057600140571594\t-2.0000007\t44.0\t1.3399963\n+62\t2008-02-15\t0.5057600140571594\t-2.0000007\t44.0\t3.149994\n+63\t2008-03-15\t0.5057600140571594\t-2.0000007\t44.0\t4.5899963\n+64\t2008-04-15\t0.5057600140571594\t-2.0000007\t44.0\t5.080017\n+65\t2008-05-15\t0.5057600140571594\t-2.0000007\t44.0\t1.0\n+66\t2008-06-15\t0.5057600140571594\t-2.000'..b'2.0000007\t44.0\t1.4900208\n+79\t2009-07-15\t0.5057600140571594\t-2.0000007\t44.0\t0.5\n+80\t2009-08-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+81\t2009-09-15\t0.5057600140571594\t-2.0000007\t44.0\t0.5800171\n+82\t2009-10-15\t0.5057600140571594\t-2.0000007\t44.0\t0.6499939\n+83\t2009-11-15\t0.5057600140571594\t-2.0000007\t44.0\t0.8999939\n+84\t2009-12-15\t0.5057600140571594\t-2.0000007\t44.0\t1.3099976\n+85\t2010-01-15\t0.5057600140571594\t-2.0000007\t44.0\t1.5299988\n+86\t2010-02-15\t0.5057600140571594\t-2.0000007\t44.0\t2.9599915\n+87\t2010-03-15\t0.5057600140571594\t-2.0000007\t44.0\t5.450012\n+88\t2010-04-15\t0.5057600140571594\t-2.0000007\t44.0\t7.5899963\n+89\t2010-05-15\t0.5057600140571594\t-2.0000007\t44.0\t1.8000183\n+90\t2010-06-15\t0.5057600140571594\t-2.0000007\t44.0\t0.480011\n+91\t2010-07-15\t0.5057600140571594\t-2.0000007\t44.0\t0.5\n+92\t2010-08-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+93\t2010-09-15\t0.5057600140571594\t-2.0000007\t44.0\t0.49002075\n+94\t2010-10-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+95\t2010-11-15\t0.5057600140571594\t-2.0000007\t44.0\t0.9299927\n+96\t2010-12-15\t0.5057600140571594\t-2.0000007\t44.0\t1.1499939\n+97\t2011-01-15\t0.5057600140571594\t-2.0000007\t44.0\t2.4900208\n+98\t2011-02-15\t0.5057600140571594\t-2.0000007\t44.0\t5.1799927\n+99\t2011-03-15\t0.5057600140571594\t-2.0000007\t44.0\t7.029999\n+100\t2011-04-15\t0.5057600140571594\t-2.0000007\t44.0\t2.4900208\n+101\t2011-05-15\t0.5057600140571594\t-2.0000007\t44.0\t0.6499939\n+102\t2011-06-15\t0.5057600140571594\t-2.0000007\t44.0\t0.52001953\n+103\t2011-07-15\t0.5057600140571594\t-2.0000007\t44.0\t0.5\n+104\t2011-08-15\t0.5057600140571594\t-2.0000007\t44.0\t0.75\n+105\t2011-09-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+106\t2011-10-15\t0.5057600140571594\t-2.0000007\t44.0\t0.480011\n+107\t2011-11-15\t0.5057600140571594\t-2.0000007\t44.0\t0.730011\n+108\t2011-12-15\t0.5057600140571594\t-2.0000007\t44.0\t1.0299988\n+109\t2012-01-15\t0.5057600140571594\t-2.0000007\t44.0\t3.149994\n+110\t2012-02-15\t0.5057600140571594\t-2.0000007\t44.0\t2.3099976\n+111\t2012-03-15\t0.5057600140571594\t-2.0000007\t44.0\t5.5200195\n+112\t2012-04-15\t0.5057600140571594\t-2.0000007\t44.0\t3.399994\n+113\t2012-05-15\t0.5057600140571594\t-2.0000007\t44.0\t3.7000122\n+114\t2012-06-15\t0.5057600140571594\t-2.0000007\t44.0\t2.5899963\n+115\t2012-07-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+116\t2012-08-15\t0.5057600140571594\t-2.0000007\t44.0\t0.4500122\n+117\t2012-09-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+118\t2012-10-15\t0.5057600140571594\t-2.0000007\t44.0\t0.61001587\n+119\t2012-11-15\t0.5057600140571594\t-2.0000007\t44.0\t2.0299988\n+120\t2012-12-15\t0.5057600140571594\t-2.0000007\t44.0\t1.4200134\n+121\t2013-01-15\t0.5057600140571594\t-2.0000007\t44.0\t2.2700195\n+122\t2013-02-15\t0.5057600140571594\t-2.0000007\t44.0\t7.0\n+123\t2013-03-15\t0.5057600140571594\t-2.0000007\t44.0\t10.550018\n+124\t2013-04-15\t0.5057600140571594\t-2.0000007\t44.0\t5.8399963\n+125\t2013-05-15\t0.5057600140571594\t-2.0000007\t44.0\t1.2400208\n+126\t2013-06-15\t0.5057600140571594\t-2.0000007\t44.0\t4.1700134\n+127\t2013-07-15\t0.5057600140571594\t-2.0000007\t44.0\t3.2099915\n+128\t2013-08-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+129\t2013-09-15\t0.5057600140571594\t-2.0000007\t44.0\t0.480011\n+130\t2013-10-15\t0.5057600140571594\t-2.0000007\t44.0\t0.49002075\n+131\t2013-11-15\t0.5057600140571594\t-2.0000007\t44.0\t0.7799988\n+132\t2013-12-15\t0.5057600140571594\t-2.0000007\t44.0\t1.4500122\n+133\t2014-01-15\t0.5057600140571594\t-2.0000007\t44.0\t0.95999146\n+134\t2014-02-15\t0.5057600140571594\t-2.0000007\t44.0\t1.3900146\n+135\t2014-03-15\t0.5057600140571594\t-2.0000007\t44.0\t5.779999\n+136\t2014-04-15\t0.5057600140571594\t-2.0000007\t44.0\t5.4299927\n+137\t2014-05-15\t0.5057600140571594\t-2.0000007\t44.0\t1.1799927\n+138\t2014-06-15\t0.5057600140571594\t-2.0000007\t44.0\t0.730011\n+139\t2014-07-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+140\t2014-08-15\t0.5057600140571594\t-2.0000007\t44.0\t0.45999146\n+141\t2014-09-15\t0.5057600140571594\t-2.0000007\t44.0\t0.5\n+142\t2014-10-15\t0.5057600140571594\t-2.0000007\t44.0\t0.6199951\n+143\t2014-11-15\t0.5057600140571594\t-2.0000007\t44.0\t0.480011\n+144\t2014-12-15\t0.5057600140571594\t-2.0000007\t44.0\t0.55999756\n' |
b |
diff -r 000000000000 -r 810820a0d45c test-data/Test2.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/Test2.tabular Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,25 @@ + time depth latitude longitude nh4 +0 2003-12-15 0.5057600140571594 45.166664123535156 -0.6666674017906189 81.27 +1 2003-12-15 0.5057600140571594 45.416664123535156 -0.8333340883255005 78.08 +2 2003-12-15 0.5057600140571594 45.5 -0.9166674017906189 55.149998 +3 2004-01-15 0.5057600140571594 45.166664123535156 -0.6666674017906189 65.2 +4 2004-01-15 0.5057600140571594 45.416664123535156 -0.8333340883255005 64.11 +5 2004-02-15 0.5057600140571594 45.166664123535156 -0.6666674017906189 51.0 +6 2004-02-15 0.5057600140571594 45.416664123535156 -0.8333340883255005 51.32 +7 2004-05-15 0.5057600140571594 45.166664123535156 -0.6666674017906189 54.53 +8 2004-06-15 0.5057600140571594 45.166664123535156 -0.6666674017906189 79.79 +9 2004-06-15 0.5057600140571594 45.416664123535156 -0.8333340883255005 61.52 +10 2004-07-15 0.5057600140571594 45.166664123535156 -0.6666674017906189 99.159996 +11 2004-07-15 0.5057600140571594 45.416664123535156 -0.8333340883255005 77.93 +12 2004-08-15 0.5057600140571594 45.166664123535156 -0.6666674017906189 110.149994 +13 2004-08-15 0.5057600140571594 45.416664123535156 -0.8333340883255005 86.759995 +14 2004-09-15 0.5057600140571594 45.166664123535156 -0.6666674017906189 112.369995 +15 2004-09-15 0.5057600140571594 45.416664123535156 -0.8333340883255005 91.979996 +16 2004-10-15 0.5057600140571594 45.166664123535156 -0.6666674017906189 109.63 +17 2004-10-15 0.5057600140571594 45.416664123535156 -0.8333340883255005 95.509995 +18 2004-11-15 0.5057600140571594 45.166664123535156 -0.6666674017906189 98.45 +19 2004-11-15 0.5057600140571594 45.416664123535156 -0.8333340883255005 93.11 +20 2004-11-15 0.5057600140571594 45.5 -0.9166674017906189 56.78 +21 2004-12-15 0.5057600140571594 45.166664123535156 -0.6666674017906189 84.25 +22 2004-12-15 0.5057600140571594 45.416664123535156 -0.8333340883255005 81.83 +23 2004-12-15 0.5057600140571594 45.5 -0.9166674017906189 57.07 |
b |
diff -r 000000000000 -r 810820a0d45c test-data/all.netcdf |
b |
Binary file test-data/all.netcdf has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/chl_alltimes.nc |
b |
Binary file test-data/chl_alltimes.nc has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/chl_nh4.netcdf |
b |
Binary file test-data/chl_nh4.netcdf has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/chl_phy_where.netcdf |
b |
Binary file test-data/chl_phy_where.netcdf has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/chl_where_drop.netcdf |
b |
Binary file test-data/chl_where_drop.netcdf has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/data_from_20040615.nc |
b |
Binary file test-data/data_from_20040615.nc has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/data_to_20040615.nc |
b |
Binary file test-data/data_to_20040615.nc has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc |
b |
Binary file test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time0.png |
b |
Binary file test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time0.png has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time0_title.png |
b |
Binary file test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time0_title.png has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time1.png |
b |
Binary file test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time1.png has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time50.png |
b |
Binary file test-data/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133_time50.png has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/depth.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/depth.tabular Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,1 @@ +0 0.50576 |
b |
diff -r 000000000000 -r 810820a0d45c test-data/info_file.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/info_file.txt Sun Jul 31 21:23:21 2022 +0000 |
[ |
@@ -0,0 +1,74 @@ +xarray.Dataset { +dimensions: + time = 145 ; + depth = 1 ; + latitude = 97 ; + longitude = 103 ; + +variables: + float32 phy(time, depth, latitude, longitude) ; + phy:_CoordinateAxes = time depth latitude longitude ; + phy:long_name = Mole Concentration of Phytoplankton expressed as carbon in sea water ; + phy:standard_name = mole_concentration_of_phytoplankton_expressed_as_carbon_in_sea_water ; + phy:units = mmol.m-3 ; + phy:unit_long = mole_concentration_of_phytoplankton_expressed_as_carbon_in_sea_water ; + datetime64[ns] time(time) ; + time:standard_name = time ; + time:long_name = time ; + time:_CoordinateAxisType = Time ; + time:axis = T ; + float32 chl(time, depth, latitude, longitude) ; + chl:_CoordinateAxes = time depth latitude longitude ; + chl:long_name = Mass Concentration of Chlorophyll in Sea Water ; + chl:standard_name = mass_concentration_of_chlorophyll_in_sea_water ; + chl:units = mg.m-3 ; + chl:unit_long = milligram of chlorophyll per cubic meter ; + float32 nh4(time, depth, latitude, longitude) ; + nh4:_CoordinateAxes = time depth latitude longitude ; + nh4:long_name = Mole Concentration of Ammonium in Sea Water ; + nh4:standard_name = mole_concentration_of_ammonium_in_sea_water ; + nh4:units = mmol.m-3 ; + nh4:unit_long = millimoles of Ammonium per cubic meter ; + float32 longitude(longitude) ; + longitude:long_name = Longitude ; + longitude:units = degrees_east ; + longitude:standard_name = longitude ; + longitude:axis = X ; + longitude:unit_long = Degrees East ; + longitude:step = 0.08333f ; + longitude:_CoordinateAxisType = Lon ; + float32 latitude(latitude) ; + latitude:long_name = Latitude ; + latitude:units = degrees_north ; + latitude:standard_name = latitude ; + latitude:axis = Y ; + latitude:unit_long = Degrees North ; + latitude:step = 0.08333f ; + latitude:_CoordinateAxisType = Lat ; + float32 depth(depth) ; + depth:long_name = Depth ; + depth:units = m ; + depth:axis = Z ; + depth:positive = down ; + depth:unit_long = Meters ; + depth:standard_name = depth ; + depth:_CoordinateAxisType = Height ; + depth:_CoordinateZisPositive = down ; + +// global attributes: + :title = CMEMS IBI REANALYSIS: MONTHLY BIOGEOCHEMICAL PRODUCTS (REGULAR GRID) ; + :institution = Puertos del Estado (PdE) - Mercator-Ocean (MO) ; + :references = http://marine.copernicus.eu ; + :source = CMEMS IBI-MFC ; + :Conventions = CF-1.0 ; + :history = Data extracted from dataset http://puertos2.cesga.es:8080/thredds/dodsC/dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid ; + :time_min = 7272.0 ; + :time_max = 112464.0 ; + :julian_day_unit = Hours since 2002-02-15 ; + :z_min = 0.5057600140571594 ; + :z_max = 0.5057600140571594 ; + :latitude_min = 43.0 ; + :latitude_max = 51.0 ; + :longitude_min = -6.000000476837158 ; + :longitude_max = 2.4999990463256836 ; +} \ No newline at end of file |
b |
diff -r 000000000000 -r 810820a0d45c test-data/latitude.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/latitude.tabular Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,97 @@ +0 43.0 +1 43.083332 +2 43.166664 +3 43.25 +4 43.333332 +5 43.416664 +6 43.5 +7 43.583332 +8 43.666664 +9 43.75 +10 43.833332 +11 43.916664 +12 44.0 +13 44.083332 +14 44.166664 +15 44.25 +16 44.333332 +17 44.416664 +18 44.5 +19 44.583332 +20 44.666664 +21 44.75 +22 44.833332 +23 44.916664 +24 45.0 +25 45.083332 +26 45.166664 +27 45.25 +28 45.333332 +29 45.416664 +30 45.5 +31 45.583332 +32 45.666664 +33 45.75 +34 45.833332 +35 45.916664 +36 46.0 +37 46.083332 +38 46.166664 +39 46.25 +40 46.333332 +41 46.416664 +42 46.5 +43 46.583332 +44 46.666664 +45 46.75 +46 46.833332 +47 46.916664 +48 47.0 +49 47.083332 +50 47.166664 +51 47.25 +52 47.333332 +53 47.416664 +54 47.5 +55 47.583332 +56 47.666664 +57 47.75 +58 47.833332 +59 47.916664 +60 48.0 +61 48.083332 +62 48.166664 +63 48.25 +64 48.333332 +65 48.416664 +66 48.5 +67 48.583332 +68 48.666664 +69 48.75 +70 48.833332 +71 48.916664 +72 49.0 +73 49.083332 +74 49.166664 +75 49.25 +76 49.333332 +77 49.416664 +78 49.5 +79 49.583332 +80 49.666664 +81 49.75 +82 49.833332 +83 49.916664 +84 50.0 +85 50.083332 +86 50.166664 +87 50.25 +88 50.333332 +89 50.416664 +90 50.5 +91 50.583332 +92 50.666664 +93 50.75 +94 50.833332 +95 50.916664 +96 51.0 |
b |
diff -r 000000000000 -r 810820a0d45c test-data/longitude.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/longitude.tabular Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,103 @@ +0 -6.0000005 +1 -5.916667 +2 -5.833334 +3 -5.7500005 +4 -5.666667 +5 -5.583334 +6 -5.5000005 +7 -5.416667 +8 -5.333334 +9 -5.2500005 +10 -5.166667 +11 -5.083334 +12 -5.0000005 +13 -4.9166675 +14 -4.833334 +15 -4.7500005 +16 -4.6666675 +17 -4.583334 +18 -4.5000005 +19 -4.4166675 +20 -4.333334 +21 -4.2500005 +22 -4.1666675 +23 -4.083334 +24 -4.0000005 +25 -3.9166672 +26 -3.833334 +27 -3.7500007 +28 -3.6666672 +29 -3.583334 +30 -3.5000007 +31 -3.4166672 +32 -3.333334 +33 -3.2500007 +34 -3.1666672 +35 -3.083334 +36 -3.0000007 +37 -2.9166672 +38 -2.833334 +39 -2.7500007 +40 -2.6666672 +41 -2.583334 +42 -2.5000007 +43 -2.4166672 +44 -2.333334 +45 -2.2500007 +46 -2.1666672 +47 -2.083334 +48 -2.0000007 +49 -1.9166673 +50 -1.833334 +51 -1.7500007 +52 -1.6666673 +53 -1.5833341 +54 -1.5000007 +55 -1.4166673 +56 -1.3333341 +57 -1.2500007 +58 -1.1666673 +59 -1.0833341 +60 -1.0000007 +61 -0.9166674 +62 -0.8333341 +63 -0.7500007 +64 -0.6666674 +65 -0.5833341 +66 -0.5000007 +67 -0.4166674 +68 -0.3333341 +69 -0.25000075 +70 -0.16666742 +71 -0.08333409 +72 -7.6e-07 +73 0.08333257 +74 0.1666659 +75 0.24999923 +76 0.33333257 +77 0.41666588 +78 0.49999923 +79 0.58333254 +80 0.66666585 +81 0.7499992 +82 0.83333254 +83 0.91666585 +84 0.9999992 +85 1.0833325 +86 1.1666659 +87 1.2499992 +88 1.3333325 +89 1.4166658 +90 1.4999992 +91 1.5833325 +92 1.6666658 +93 1.7499992 +94 1.8333325 +95 1.9166658 +96 1.9999992 +97 2.0833325 +98 2.1666658 +99 2.249999 +100 2.3333325 +101 2.4166658 +102 2.499999 |
b |
diff -r 000000000000 -r 810820a0d45c test-data/select_by_values.netcdf |
b |
Binary file test-data/select_by_values.netcdf has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/small.netcdf |
b |
Binary file test-data/small.netcdf has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/small_all_variables.netcdf |
b |
Binary file test-data/small_all_variables.netcdf has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/time.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/time.tabular Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,145 @@ +0 2002-12-15 +1 2003-01-15 +2 2003-02-15 +3 2003-03-15 +4 2003-04-15 +5 2003-05-15 +6 2003-06-15 +7 2003-07-15 +8 2003-08-15 +9 2003-09-15 +10 2003-10-15 +11 2003-11-15 +12 2003-12-15 +13 2004-01-15 +14 2004-02-15 +15 2004-03-15 +16 2004-04-15 +17 2004-05-15 +18 2004-06-15 +19 2004-07-15 +20 2004-08-15 +21 2004-09-15 +22 2004-10-15 +23 2004-11-15 +24 2004-12-15 +25 2005-01-15 +26 2005-02-15 +27 2005-03-15 +28 2005-04-15 +29 2005-05-15 +30 2005-06-15 +31 2005-07-15 +32 2005-08-15 +33 2005-09-15 +34 2005-10-15 +35 2005-11-15 +36 2005-12-15 +37 2006-01-15 +38 2006-02-15 +39 2006-03-15 +40 2006-04-15 +41 2006-05-15 +42 2006-06-15 +43 2006-07-15 +44 2006-08-15 +45 2006-09-15 +46 2006-10-15 +47 2006-11-15 +48 2006-12-15 +49 2007-01-15 +50 2007-02-15 +51 2007-03-15 +52 2007-04-15 +53 2007-05-15 +54 2007-06-15 +55 2007-07-15 +56 2007-08-15 +57 2007-09-15 +58 2007-10-15 +59 2007-11-15 +60 2007-12-15 +61 2008-01-15 +62 2008-02-15 +63 2008-03-15 +64 2008-04-15 +65 2008-05-15 +66 2008-06-15 +67 2008-07-15 +68 2008-08-15 +69 2008-09-15 +70 2008-10-15 +71 2008-11-15 +72 2008-12-15 +73 2009-01-15 +74 2009-02-15 +75 2009-03-15 +76 2009-04-15 +77 2009-05-15 +78 2009-06-15 +79 2009-07-15 +80 2009-08-15 +81 2009-09-15 +82 2009-10-15 +83 2009-11-15 +84 2009-12-15 +85 2010-01-15 +86 2010-02-15 +87 2010-03-15 +88 2010-04-15 +89 2010-05-15 +90 2010-06-15 +91 2010-07-15 +92 2010-08-15 +93 2010-09-15 +94 2010-10-15 +95 2010-11-15 +96 2010-12-15 +97 2011-01-15 +98 2011-02-15 +99 2011-03-15 +100 2011-04-15 +101 2011-05-15 +102 2011-06-15 +103 2011-07-15 +104 2011-08-15 +105 2011-09-15 +106 2011-10-15 +107 2011-11-15 +108 2011-12-15 +109 2012-01-15 +110 2012-02-15 +111 2012-03-15 +112 2012-04-15 +113 2012-05-15 +114 2012-06-15 +115 2012-07-15 +116 2012-08-15 +117 2012-09-15 +118 2012-10-15 +119 2012-11-15 +120 2012-12-15 +121 2013-01-15 +122 2013-02-15 +123 2013-03-15 +124 2013-04-15 +125 2013-05-15 +126 2013-06-15 +127 2013-07-15 +128 2013-08-15 +129 2013-09-15 +130 2013-10-15 +131 2013-11-15 +132 2013-12-15 +133 2014-01-15 +134 2014-02-15 +135 2014-03-15 +136 2014-04-15 +137 2014-05-15 +138 2014-06-15 +139 2014-07-15 +140 2014-08-15 +141 2014-09-15 +142 2014-10-15 +143 2014-11-15 +144 2014-12-15 |
b |
diff -r 000000000000 -r 810820a0d45c test-data/time_series.png |
b |
Binary file test-data/time_series.png has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/time_series.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/time_series.tabular Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,38 @@ +time longitude latitude depth chl +2010-12-15 00:00:00 -6.0000005 44.75 0.50576 0.31 +2011-01-15 00:00:00 -6.0000005 44.75 0.50576 0.37 +2011-02-15 00:00:00 -6.0000005 44.75 0.50576 0.81 +2011-03-15 00:00:00 -6.0000005 44.75 0.50576 1.41 +2011-04-15 00:00:00 -6.0000005 44.75 0.50576 1.8399999 +2011-05-15 00:00:00 -6.0000005 44.75 0.50576 0.099999994 +2011-06-15 00:00:00 -6.0000005 44.75 0.50576 0.03 +2011-07-15 00:00:00 -6.0000005 44.75 0.50576 0.03 +2011-08-15 00:00:00 -6.0000005 44.75 0.50576 0.01 +2011-09-15 00:00:00 -6.0000005 44.75 0.50576 0.01 +2011-10-15 00:00:00 -6.0000005 44.75 0.50576 0.02 +2011-11-15 00:00:00 -6.0000005 44.75 0.50576 0.07 +2011-12-15 00:00:00 -6.0000005 44.75 0.50576 0.34 +2012-01-15 00:00:00 -6.0000005 44.75 0.50576 0.35 +2012-02-15 00:00:00 -6.0000005 44.75 0.50576 0.37 +2012-03-15 00:00:00 -6.0000005 44.75 0.50576 1.5799999 +2012-04-15 00:00:00 -6.0000005 44.75 0.50576 1.12 +2012-05-15 00:00:00 -6.0000005 44.75 0.50576 1.16 +2012-06-15 00:00:00 -6.0000005 44.75 0.50576 0.07 +2012-07-15 00:00:00 -6.0000005 44.75 0.50576 0.01 +2012-08-15 00:00:00 -6.0000005 44.75 0.50576 0.02 +2012-09-15 00:00:00 -6.0000005 44.75 0.50576 0.03 +2012-10-15 00:00:00 -6.0000005 44.75 0.50576 0.22 +2012-11-15 00:00:00 -6.0000005 44.75 0.50576 0.34 +2012-12-15 00:00:00 -6.0000005 44.75 0.50576 0.29 +2013-01-15 00:00:00 -6.0000005 44.75 0.50576 0.37 +2013-02-15 00:00:00 -6.0000005 44.75 0.50576 0.38 +2013-03-15 00:00:00 -6.0000005 44.75 0.50576 1.15 +2013-04-15 00:00:00 -6.0000005 44.75 0.50576 1.9 +2013-05-15 00:00:00 -6.0000005 44.75 0.50576 0.5 +2013-06-15 00:00:00 -6.0000005 44.75 0.50576 0.12 +2013-07-15 00:00:00 -6.0000005 44.75 0.50576 0.01 +2013-08-15 00:00:00 -6.0000005 44.75 0.50576 0.0 +2013-09-15 00:00:00 -6.0000005 44.75 0.50576 0.01 +2013-10-15 00:00:00 -6.0000005 44.75 0.50576 0.01 +2013-11-15 00:00:00 -6.0000005 44.75 0.50576 0.12 +2013-12-15 00:00:00 -6.0000005 44.75 0.50576 0.34 |
b |
diff -r 000000000000 -r 810820a0d45c test-data/time_series_customized.png |
b |
Binary file test-data/time_series_customized.png has changed |
b |
diff -r 000000000000 -r 810820a0d45c test-data/time_series_customized.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/time_series_customized.tabular Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,146 @@ +time longitude latitude depth chl +2002-12-15 00:00:00 -5.0000005 43.5 0.50576 0.34 +2003-01-15 00:00:00 -5.0000005 43.5 0.50576 0.41 +2003-02-15 00:00:00 -5.0000005 43.5 0.50576 0.55 +2003-03-15 00:00:00 -5.0000005 43.5 0.50576 1.0699999 +2003-04-15 00:00:00 -5.0000005 43.5 0.50576 0.89 +2003-05-15 00:00:00 -5.0000005 43.5 0.50576 0.14 +2003-06-15 00:00:00 -5.0000005 43.5 0.50576 0.02 +2003-07-15 00:00:00 -5.0000005 43.5 0.50576 0.02 +2003-08-15 00:00:00 -5.0000005 43.5 0.50576 0.02 +2003-09-15 00:00:00 -5.0000005 43.5 0.50576 0.04 +2003-10-15 00:00:00 -5.0000005 43.5 0.50576 0.08 +2003-11-15 00:00:00 -5.0000005 43.5 0.50576 0.39 +2003-12-15 00:00:00 -5.0000005 43.5 0.50576 0.31 +2004-01-15 00:00:00 -5.0000005 43.5 0.50576 0.38 +2004-02-15 00:00:00 -5.0000005 43.5 0.50576 0.57 +2004-03-15 00:00:00 -5.0000005 43.5 0.50576 1.05 +2004-04-15 00:00:00 -5.0000005 43.5 0.50576 1.43 +2004-05-15 00:00:00 -5.0000005 43.5 0.50576 1.27 +2004-06-15 00:00:00 -5.0000005 43.5 0.50576 0.81 +2004-07-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2004-08-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2004-09-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2004-10-15 00:00:00 -5.0000005 43.5 0.50576 0.19999999 +2004-11-15 00:00:00 -5.0000005 43.5 0.50576 0.41 +2004-12-15 00:00:00 -5.0000005 43.5 0.50576 0.37 +2005-01-15 00:00:00 -5.0000005 43.5 0.50576 0.42 +2005-02-15 00:00:00 -5.0000005 43.5 0.50576 0.59 +2005-03-15 00:00:00 -5.0000005 43.5 0.50576 1.37 +2005-04-15 00:00:00 -5.0000005 43.5 0.50576 1.4399999 +2005-05-15 00:00:00 -5.0000005 43.5 0.50576 0.34 +2005-06-15 00:00:00 -5.0000005 43.5 0.50576 0.22999999 +2005-07-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2005-08-15 00:00:00 -5.0000005 43.5 0.50576 0.75 +2005-09-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2005-10-15 00:00:00 -5.0000005 43.5 0.50576 0.22999999 +2005-11-15 00:00:00 -5.0000005 43.5 0.50576 0.5 +2005-12-15 00:00:00 -5.0000005 43.5 0.50576 0.42 +2006-01-15 00:00:00 -5.0000005 43.5 0.50576 0.51 +2006-02-15 00:00:00 -5.0000005 43.5 0.50576 0.81 +2006-03-15 00:00:00 -5.0000005 43.5 0.50576 1.78 +2006-04-15 00:00:00 -5.0000005 43.5 0.50576 1.87 +2006-05-15 00:00:00 -5.0000005 43.5 0.50576 0.37 +2006-06-15 00:00:00 -5.0000005 43.5 0.50576 0.87 +2006-07-15 00:00:00 -5.0000005 43.5 0.50576 0.04 +2006-08-15 00:00:00 -5.0000005 43.5 0.50576 0.04 +2006-09-15 00:00:00 -5.0000005 43.5 0.50576 0.03 +2006-10-15 00:00:00 -5.0000005 43.5 0.50576 0.22 +2006-11-15 00:00:00 -5.0000005 43.5 0.50576 0.51 +2006-12-15 00:00:00 -5.0000005 43.5 0.50576 0.41 +2007-01-15 00:00:00 -5.0000005 43.5 0.50576 0.39999998 +2007-02-15 00:00:00 -5.0000005 43.5 0.50576 0.61 +2007-03-15 00:00:00 -5.0000005 43.5 0.50576 1.24 +2007-04-15 00:00:00 -5.0000005 43.5 0.50576 1.09 +2007-05-15 00:00:00 -5.0000005 43.5 0.50576 0.28 +2007-06-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2007-07-15 00:00:00 -5.0000005 43.5 0.50576 0.01 +2007-08-15 00:00:00 -5.0000005 43.5 0.50576 0.02 +2007-09-15 00:00:00 -5.0000005 43.5 0.50576 1.6899999 +2007-10-15 00:00:00 -5.0000005 43.5 0.50576 0.71999997 +2007-11-15 00:00:00 -5.0000005 43.5 0.50576 1.25 +2007-12-15 00:00:00 -5.0000005 43.5 0.50576 0.68 +2008-01-15 00:00:00 -5.0000005 43.5 0.50576 0.57 +2008-02-15 00:00:00 -5.0000005 43.5 0.50576 0.95 +2008-03-15 00:00:00 -5.0000005 43.5 0.50576 1.1 +2008-04-15 00:00:00 -5.0000005 43.5 0.50576 1.35 +2008-05-15 00:00:00 -5.0000005 43.5 0.50576 0.34 +2008-06-15 00:00:00 -5.0000005 43.5 0.50576 0.01 +2008-07-15 00:00:00 -5.0000005 43.5 0.50576 0.04 +2008-08-15 00:00:00 -5.0000005 43.5 0.50576 0.02 +2008-09-15 00:00:00 -5.0000005 43.5 0.50576 0.31 +2008-10-15 00:00:00 -5.0000005 43.5 0.50576 0.17 +2008-11-15 00:00:00 -5.0000005 43.5 0.50576 0.21 +2008-12-15 00:00:00 -5.0000005 43.5 0.50576 0.34 +2009-01-15 00:00:00 -5.0000005 43.5 0.50576 0.42999998 +2009-02-15 00:00:00 -5.0000005 43.5 0.50576 0.55 +2009-03-15 00:00:00 -5.0000005 43.5 0.50576 1.0 +2009-04-15 00:00:00 -5.0000005 43.5 0.50576 0.71999997 +2009-05-15 00:00:00 -5.0000005 43.5 0.50576 0.14 +2009-06-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2009-07-15 00:00:00 -5.0000005 43.5 0.50576 0.02 +2009-08-15 00:00:00 -5.0000005 43.5 0.50576 0.01 +2009-09-15 00:00:00 -5.0000005 43.5 0.50576 0.29 +2009-10-15 00:00:00 -5.0000005 43.5 0.50576 0.90999997 +2009-11-15 00:00:00 -5.0000005 43.5 0.50576 0.45 +2009-12-15 00:00:00 -5.0000005 43.5 0.50576 0.34 +2010-01-15 00:00:00 -5.0000005 43.5 0.50576 0.42999998 +2010-02-15 00:00:00 -5.0000005 43.5 0.50576 0.56 +2010-03-15 00:00:00 -5.0000005 43.5 0.50576 1.35 +2010-04-15 00:00:00 -5.0000005 43.5 0.50576 1.63 +2010-05-15 00:00:00 -5.0000005 43.5 0.50576 0.41 +2010-06-15 00:00:00 -5.0000005 43.5 0.50576 0.099999994 +2010-07-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2010-08-15 00:00:00 -5.0000005 43.5 0.50576 0.03 +2010-09-15 00:00:00 -5.0000005 43.5 0.50576 0.14 +2010-10-15 00:00:00 -5.0000005 43.5 0.50576 0.099999994 +2010-11-15 00:00:00 -5.0000005 43.5 0.50576 0.34 +2010-12-15 00:00:00 -5.0000005 43.5 0.50576 0.37 +2011-01-15 00:00:00 -5.0000005 43.5 0.50576 0.55 +2011-02-15 00:00:00 -5.0000005 43.5 0.50576 0.96999997 +2011-03-15 00:00:00 -5.0000005 43.5 0.50576 1.65 +2011-04-15 00:00:00 -5.0000005 43.5 0.50576 1.16 +2011-05-15 00:00:00 -5.0000005 43.5 0.50576 0.32 +2011-06-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2011-07-15 00:00:00 -5.0000005 43.5 0.50576 0.089999996 +2011-08-15 00:00:00 -5.0000005 43.5 0.50576 0.03 +2011-09-15 00:00:00 -5.0000005 43.5 0.50576 0.02 +2011-10-15 00:00:00 -5.0000005 43.5 0.50576 0.25 +2011-11-15 00:00:00 -5.0000005 43.5 0.50576 0.34 +2011-12-15 00:00:00 -5.0000005 43.5 0.50576 0.37 +2012-01-15 00:00:00 -5.0000005 43.5 0.50576 0.45 +2012-02-15 00:00:00 -5.0000005 43.5 0.50576 0.68 +2012-03-15 00:00:00 -5.0000005 43.5 0.50576 1.81 +2012-04-15 00:00:00 -5.0000005 43.5 0.50576 1.75 +2012-05-15 00:00:00 -5.0000005 43.5 0.50576 1.03 +2012-06-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2012-07-15 00:00:00 -5.0000005 43.5 0.50576 0.01 +2012-08-15 00:00:00 -5.0000005 43.5 0.50576 0.01 +2012-09-15 00:00:00 -5.0000005 43.5 0.50576 0.099999994 +2012-10-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2012-11-15 00:00:00 -5.0000005 43.5 0.50576 0.14 +2012-12-15 00:00:00 -5.0000005 43.5 0.50576 0.34 +2013-01-15 00:00:00 -5.0000005 43.5 0.50576 0.5 +2013-02-15 00:00:00 -5.0000005 43.5 0.50576 1.09 +2013-03-15 00:00:00 -5.0000005 43.5 0.50576 1.62 +2013-04-15 00:00:00 -5.0000005 43.5 0.50576 1.4 +2013-05-15 00:00:00 -5.0000005 43.5 0.50576 0.37 +2013-06-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2013-07-15 00:00:00 -5.0000005 43.5 0.50576 0.48 +2013-08-15 00:00:00 -5.0000005 43.5 0.50576 0.08 +2013-09-15 00:00:00 -5.0000005 43.5 0.50576 0.21 +2013-10-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2013-11-15 00:00:00 -5.0000005 43.5 0.50576 0.37 +2013-12-15 00:00:00 -5.0000005 43.5 0.50576 0.59 +2014-01-15 00:00:00 -5.0000005 43.5 0.50576 0.56 +2014-02-15 00:00:00 -5.0000005 43.5 0.50576 0.90999997 +2014-03-15 00:00:00 -5.0000005 43.5 0.50576 1.3299999 +2014-04-15 00:00:00 -5.0000005 43.5 0.50576 1.09 +2014-05-15 00:00:00 -5.0000005 43.5 0.50576 0.37 +2014-06-15 00:00:00 -5.0000005 43.5 0.50576 0.11 +2014-07-15 00:00:00 -5.0000005 43.5 0.50576 0.02 +2014-08-15 00:00:00 -5.0000005 43.5 0.50576 0.02 +2014-09-15 00:00:00 -5.0000005 43.5 0.50576 0.11 +2014-10-15 00:00:00 -5.0000005 43.5 0.50576 0.02 +2014-11-15 00:00:00 -5.0000005 43.5 0.50576 0.07 +2014-12-15 00:00:00 -5.0000005 43.5 0.50576 0.17 |
b |
diff -r 000000000000 -r 810820a0d45c test-data/var_tab_dataset-ibi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/var_tab_dataset-ibi Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,7 @@ +time 1 time 145 +chl 4 time 145 depth 1 latitude 97 longitude 103 +nh4 4 time 145 depth 1 latitude 97 longitude 103 +longitude 1 longitude 103 +latitude 1 latitude 97 +depth 1 depth 1 +phy 4 time 145 depth 1 latitude 97 longitude 103 |
b |
diff -r 000000000000 -r 810820a0d45c test-data/version.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/version.tabular Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,1 @@ +Galaxy xarray version 2022.3.0 |
b |
diff -r 000000000000 -r 810820a0d45c test-data/where_condition.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/where_condition.txt Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,1 @@ +((chl > 1) | (chl < 45)) & (nh4 > 1) |
b |
diff -r 000000000000 -r 810820a0d45c test-data/where_condition_simple.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/where_condition_simple.txt Sun Jul 31 21:23:21 2022 +0000 |
b |
@@ -0,0 +1,1 @@ +nh4 > 5.15 |
b |
diff -r 000000000000 -r 810820a0d45c timeseries.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/timeseries.py Sun Jul 31 21:23:21 2022 +0000 |
[ |
@@ -0,0 +1,182 @@ +#!/usr/bin/env python3 +# +# +# usage: netCDF_timeseries.py [-h] [--output output.png] +# [--save timeseries.tabular] +# [--config config-file] +# [-v] +# input varname +# positional arguments: +# input input filename with geographical coordinates (netCDF +# format) +# varname Specify which variable to extract (case sensitive) +# +# optional arguments: +# -h, --help show this help message and exit +# --output output.png filename to store image (png format) +# --save timeseries.tabular filename to store timeseries (tabular format) +# --config config file extract parameters +# -v, --verbose switch on verbose mode +# +import argparse +import ast +import warnings + +import cftime # noqa: F401 + +import matplotlib as mpl +mpl.use('Agg') + +import matplotlib.pyplot as plt # noqa: I202,E402 +from matplotlib.dates import DateFormatter # noqa: I202,E402 + +import xarray as xr # noqa: I202,E402 + + +class TimeSeries (): + def __init__(self, input, varname, output, save, verbose=False, + config_file=""): + + li = list(input.split(",")) + if len(li) > 1: + self.input = li + else: + self.input = input + + self.varname = varname + self.xylim_supported = True + if output == "" or output is None: + self.output = "Timeseries.png" + else: + self.output = output + if save == "" or save is None: + self.save = "Timeseries.tabular" + else: + self.save = save + self.verbose = verbose + self.time_start_value = "" + self.time_end_value = "" + self.lon_value = "" + self.lat_value = "" + self.lat_name = 'lat' + self.lon_name = 'lon' + self.time_name = 'time' + self.title = '' + self.xlabel = '' + self.ylabel = '' + self.format_date = '' + if config_file != "" and config_file is not None: + with open(config_file) as f: + sdict = ''.join( + f.read().replace("\n", "").split('{')[1].split('}')[0] + ) + tmp = ast.literal_eval('{' + sdict.strip() + '}') + for key in tmp: + if key == 'time_start_value': + self.time_start_value = tmp[key] + if key == 'time_end_value': + self.time_end_value = tmp[key] + if key == 'lon_value': + self.lon_value = tmp[key] + if key == 'lat_value': + self.lat_value = tmp[key] + if key == 'lon_name': + self.lon_name = tmp[key] + if key == 'lat_name': + self.lat_name = tmp[key] + if key == 'time_name': + self.time_name = tmp[key] + if key == 'title': + self.title = tmp[key] + if key == 'xlabel': + self.xlabel = tmp[key] + if key == 'ylabel': + self.ylabel = tmp[key] + if key == 'format_date': + self.format_date = tmp[key] + self.format_date = self.format_date.replace('X', '%') + + if type(self.input) is list: + self.dset = xr.open_mfdataset(self.input, use_cftime=True) + else: + self.dset = xr.open_dataset(self.input, use_cftime=True) + + if verbose: + print("input: ", self.input) + print("varname: ", self.varname) + if self.time_start_value: + print("time_start_value: ", self.time_start_value) + if self.time_end_value: + print("time_end_value: ", self.time_end_value) + print("output: ", self.output) + if self.lon_value: + print(self.lon_name, self.lon_value) + if self.lat_value: + print(self.lat_name, self.lat_value) + + def plot(self): + if self.lon_value: + lon_c = float(self.lon_value) + if self.lat_value: + lat_c = float(self.lat_value) + if self.lat_value and self.lon_value: + self.df = self.dset.sel({self.lat_name: lat_c, + self.lon_name: lon_c}, + method='nearest') + else: + self.df = self.dset + if self.time_start_value or self.time_end_value: + self.df = self.df.sel({self.time_name: slice(self.time_start_value, + self.time_end_value)}) + # Saving the time series into a tabular + self.df = self.df[self.varname].squeeze().to_dataframe() + self.df.dropna().to_csv(self.save, sep='\t') + # Plot the time series into png image + fig = plt.figure(figsize=(15, 5)) + ax = plt.subplot(111) + self.df[self.varname].plot(ax=ax) + if self.title: + plt.title(self.title) + if self.xlabel: + plt.xlabel(self.xlabel) + if self.ylabel: + plt.ylabel(self.ylabel) + if self.format_date: + ax.xaxis.set_major_formatter(DateFormatter(self.format_date)) + fig.tight_layout() + fig.savefig(self.output) + + +if __name__ == '__main__': + warnings.filterwarnings("ignore") + parser = argparse.ArgumentParser() + parser.add_argument( + 'input', + help='input filename with geographical coordinates (netCDF format)' + ) + parser.add_argument( + 'varname', + help='Specify which variable to plot (case sensitive)' + ) + parser.add_argument( + '--output', + help='output filename to store resulting image (png format)' + ) + parser.add_argument( + '--save', + help='save resulting tabular file (tabular format) into filename' + ) + parser.add_argument( + '--config', + help='pass timeseries parameters via a config file' + ) + parser.add_argument( + "-v", "--verbose", + help="switch on verbose mode", + action="store_true") + args = parser.parse_args() + + dset = TimeSeries(input=args.input, varname=args.varname, + output=args.output, save=args.save, verbose=args.verbose, + config_file=args.config) + dset.plot() |
b |
diff -r 000000000000 -r 810820a0d45c timeseries_plot.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/timeseries_plot.xml Sun Jul 31 21:23:21 2022 +0000 |
[ |
@@ -0,0 +1,120 @@ +<tool id="timeseries_extraction" name="NetCDF timeseries Extractor" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" python_template_version="3.5" profile="@PROFILE@"> + <description>Extract and plot time series</description> + <macros> + <import>macros.xml</import> + <import>macros_timeseries.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.6.0">netcdf4</requirement> + <requirement type="package" version="3.5.2">matplotlib</requirement> + <requirement type="package" version="2022.7.0">dask</requirement> + <requirement type="package" version="1.4.3">pandas</requirement> + <requirement type="package" version="1.6.1">cftime</requirement> + </requirements> + <command detect_errors="exit_code"><![CDATA[ + mkdir output_dir && + mkdir -p `pwd`/mlp_tmpdir && + MPLCONFIGDIR=`pwd`/mlp_tmpdir && + python '$__tool_directory__/timeseries.py' '$input' '$var' + --config '$series_customization' + --output timeseries.png + --save $timeseries_tabular + --verbose && + mv timeseries.png $timeseries_plot + ]]></command> + <expand macro="config_series"/> + <inputs> + <param type="data" name="input" label="Input netcdf file" format="netcdf" help="Select the input netCDF file."/> + <param type="data" label="Tabular of variables" name="var_tab" format="tabular" help="Select the tabular file which summarize the available variables and dimensions."/> + <param name="var" type="select" label="Choose the variable to plot"> + <options from_dataset="var_tab"> + <column name="name" index="0"/> + <column name="value" index="0"/> + </options> + </param> + <conditional name="condi_datetime"> + <param name="datetime" type="select" label="Datetime selection" help="Use this option to set the start and end values for plotting."> + <option value="no">No</option> + <option value="yes">Yes</option> + </param> + <when value="no"></when> + <when value="yes"> + <param name="time_name" type="select" label="Choose the name for date and time values"> + <options from_dataset="var_tab"> + <column name="name" index="0"/> + <column name="value" index="0"/> + </options> + </param> + <param name="time_start_value" type="text" value="" label="Choose the beginning date/time to plot (YYY-MM-DD)"/> + <param name="time_end_value" type="text" value="" label="Choose the ending date/time to plot (YYYY-MM-DD)"/> + </when> + </conditional> + <param name="lat_value" type="float" optional="true" label="latitude value for limited geographical area" /> + <param name="lat_name" type="select" label="Choose the name for latitudes" optional="true"> + <options from_dataset="var_tab"> + <column name="name" index="0"/> + <column name="value" index="0"/> + </options> + </param> + <param name="lon_value" type="float" optional="true" label="longitude value for limited geographical area " /> + <param name="lon_name" type="select" label="Choose the name for longitudes" optional="true"> + <options from_dataset="var_tab"> + <column name="name" index="0"/> + <column name="value" index="0"/> + </options> + </param> + <section name="adv" title="Advanced Plotting Options" expanded="false"> + <param name="plot_title" type="text" value="" label="Plot title" /> + <param name="xlabel" type="text" value="" label="Label for x-axis" /> + <param name="ylabel" type="text" value="" label="Label for y-axis" /> + <param name="format_date" type="text" value="" label="format date/time for plotting" /> + </section> + </inputs> + <outputs> + <data name="timeseries_tabular" format="tabular" label="Timeseries table"/> + <data name="timeseries_plot" format="png" label="Timeseries plot"/> + </outputs> + <tests> + <test> + <param name="input" value="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc"/> + <param name="var" value="chl"/> + <param name="var_tab" value="var_tab_dataset-ibi"/> + <param name="lon_value" value="-5.0"/> + <param name="lat_value" value="43.50"/> + <param name="lon_name" value="longitude"/> + <param name="lat_name" value="latitude"/> + <conditional name="condi_datetime"> + <param name="datetime" value="no"/> + </conditional> + <section name="adv"> + <param name="plot_title" value="Timeseries of Chlorophyll concentration"/> + <param name="format_date" value="%Y"/> + <param name="xlabel" value="Year"/> + <param name="ylabel" value="Chl"/> + </section> + <output name="timeseries_tabular" ftype="tabular" file="time_series_customized.tabular"/> + <output name="timeseries_plot" ftype="png" file="time_series_customized.png"/> + </test> + <test> + <param name="input" value="dataset-ibi-reanalysis-bio-005-003-monthly-regulargrid_1510914389133.nc"/> + <param name="var" value="chl"/> + <param name="var_tab" value="var_tab_dataset-ibi"/> + <param name="lon_value" value="-7.0"/> + <param name="lat_value" value="44.75"/> + <param name="lon_name" value="longitude"/> + <param name="lat_name" value="latitude"/> + <conditional name="condi_datetime"> + <param name="datetime" value="yes"/> + <param name="time_start_value" value="2010-12-15"/> + <param name="time_end_value" value="2013-12-31"/> + </conditional> + <output name="timeseries_tabular" ftype="tabular" file="time_series.tabular"/> + <output name="timeseries_plot" ftype="png" file="time_series.png"/> + </test> + </tests> + <help><![CDATA[ Extracts time series for a given variable in a .csv format file. This file can be used to plot the timeseries easily. ]]></help> + <expand macro="citations"/> +</tool> |
b |
diff -r 000000000000 -r 810820a0d45c xarray_info.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xarray_info.py Sun Jul 31 21:23:21 2022 +0000 |
[ |
@@ -0,0 +1,107 @@ +# xarray tool for: +# - getting metadata information +# - select data and save results in csv file for further post-processing + +import argparse +import csv +import os +import warnings + +import xarray as xr + + +class XarrayInfo (): + def __init__(self, infile, outfile_info="", outfile_summary="", + verbose=False, coords_info=None): + self.infile = infile + self.outfile_info = outfile_info + self.outfile_summary = outfile_summary + self.coords_info = coords_info + self.verbose = verbose + # initialization + self.dset = None + self.gset = None + if self.verbose: + print("infile: ", self.infile) + print("outfile_info: ", self.outfile_info) + print("outfile_summary: ", self.outfile_summary) + print("coords_info: ", self.coords_info) + + def info(self): + f = open(self.outfile_info, 'w') + ds = xr.open_dataset(self.infile) + ds.info(f) + f.close() + + def summary(self): + f = open(self.outfile_summary, 'w') + ds = xr.open_dataset(self.infile) + writer = csv.writer(f, delimiter='\t') + header = ['VariableName', 'NumberOfDimensions'] + for idx, val in enumerate(ds.dims.items()): + header.append('Dim' + str(idx) + 'Name') + header.append('Dim' + str(idx) + 'Size') + writer.writerow(header) + for name, da in ds.data_vars.items(): + line = [name] + line.append(len(ds[name].shape)) + for d, s in zip(da.shape, da.sizes): + line.append(s) + line.append(d) + writer.writerow(line) + for name, da in ds.coords.items(): + line = [name] + line.append(len(ds[name].shape)) + for d, s in zip(da.shape, da.sizes): + line.append(s) + line.append(d) + writer.writerow(line) + f.close() + + def get_coords_info(self): + ds = xr.open_dataset(self.infile) + for c in ds.coords: + filename = os.path.join(self.coords_info, + c.strip() + + '.tabular') + pd = ds.coords[c].to_pandas() + pd.index = range(len(pd)) + pd.to_csv(filename, header=False, sep='\t') + + +if __name__ == '__main__': + warnings.filterwarnings("ignore") + parser = argparse.ArgumentParser() + + parser.add_argument( + 'infile', + help='netCDF input filename' + ) + parser.add_argument( + '--info', + help='Output filename where metadata information is stored' + ) + parser.add_argument( + '--summary', + help='Output filename where data summary information is stored' + ) + parser.add_argument( + '--coords_info', + help='output-folder where for each coordinate, coordinate values ' + ' are being printed in the corresponding outputfile' + ) + parser.add_argument( + "-v", "--verbose", + help="switch on verbose mode", + action="store_true" + ) + args = parser.parse_args() + + p = XarrayInfo(args.infile, args.info, args.summary, + args.verbose, args.coords_info) + if args.info: + p.info() + elif args.coords_info: + p.get_coords_info() + if args.summary: + p.summary() |
b |
diff -r 000000000000 -r 810820a0d45c xarray_mapplot.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xarray_mapplot.py Sun Jul 31 21:23:21 2022 +0000 |
[ |
b'@@ -0,0 +1,411 @@\n+#!/usr/bin/env python3\r\n+#\r\n+#\r\n+# usage: xarray_mapplot.py [-h] [--proj PROJ]\r\n+# [--cmap CMAP]\r\n+# [--output OUTPUT]\r\n+# [--time TIMES]\r\n+# [--nrow NROW]\r\n+# [--ncol NCOL]\r\n+# [--title title]\r\n+# [--latitude LATITUDE]\r\n+# [--longitude LONGITUDE]\r\n+# [--land ALPHA-LAND]\r\n+# [--ocean ALPHA-OCEAN]\r\n+# [--coastline ALPHA-COASTLINE]\r\n+# [--borders ALPHA-BORDERS]\r\n+# [--xlim "x1,x2"]\r\n+# [--ylim "y1,y2"]\r\n+# [--range "valmin,valmax"]\r\n+# [--threshold VAL]\r\n+# [--label label-colorbar]\r\n+# [--config config-file]\r\n+# [--shift]\r\n+# [-v]\r\n+# input varname\r\n+#\r\n+# positional arguments:\r\n+# input input filename with geographical coordinates (netCDF\r\n+# format)\r\n+# varname Specify which variable to plot (case sensitive)\r\n+#\r\n+# optional arguments:\r\n+# -h, --help show this help message and exit\r\n+# --proj PROJ Specify the projection on which we draw\r\n+# --cmap CMAP Specify which colormap to use for plotting\r\n+# --output OUTPUT output filename to store resulting image (png format)\r\n+# --time TIMES time index from the file for multiple plots ("0 1 2 3")\r\n+# --title plot or subplot title\r\n+# --latitude variable name for latitude\r\n+# --longitude variable name for longitude\r\n+# --land add land on plot with alpha value [0-1]\r\n+# --ocean add oceans on plot with alpha value [0-1]\r\n+# --coastline add coastline with alpha value [0-1]\r\n+# --borders add country borders with alpha value [0-1]\r\n+# --xlim limited geographical area longitudes "x1,x2"\r\n+# --ylim limited geographical area latitudes "y1,y2"\r\n+# --range "valmin,valmax" for plotting\r\n+# --threshold do not plot values below threshold\r\n+# --label set a label for colormap\r\n+# --config plotting parameters are passed via a config file\r\n+# (overwrite other plotting options)\r\n+# --shift shift longitudes if specified\r\n+# -v, --verbose switch on verbose mode\r\n+#\r\n+\r\n+import argparse\r\n+import ast\r\n+import warnings\r\n+from pathlib import Path\r\n+\r\n+import cartopy.crs as ccrs\r\n+import cartopy.feature as feature\r\n+\r\n+from cmcrameri import cm\r\n+\r\n+import matplotlib as mpl\r\n+mpl.use(\'Agg\')\r\n+from matplotlib import pyplot # noqa: I202,E402\r\n+\r\n+import xarray as xr # noqa: E402\r\n+\r\n+\r\n+class MapPlotXr ():\r\n+ def __init__(self, input, varname, output, verbose=False,\r\n+ config_file="", proj="", shift=False):\r\n+\r\n+ li = list(input.split(","))\r\n+ if len(li) > 1:\r\n+ self.input = li\r\n+ else:\r\n+ self.input = input\r\n+\r\n+ if proj != "" and proj is not None and Path(proj).exists():\r\n+ f = open(proj)\r\n+ sdict = \'\'.join(\r\n+ f.read().replace("\\n", "").split(\'{\')[1].split(\'}\')[0]\r\n+ )\r\n+ self.proj = \'{\' + sdict.strip() + \'}\'\r\n+ else:\r\n+ self.proj = None\r\n+ self.varname = varname\r\n+ self.shift = shift\r\n+ self.xylim_supported = False\r\n+ self.colorbar = True\r\n+ if output is None:\r\n+ if type(self.input) is list:\r\n+ self.output = Path(self.input[0]).stem + \'.png\'\r\n+ else:\r\n+ self.output = Path(self.input).stem + \'.png\'\r\n+ else:\r\n'..b'd)\r\n+\r\n+ if self.range == []:\r\n+ minval = self.dset[self.varname].min()\r\n+ maxval = self.dset[self.varname].max()\r\n+ else:\r\n+ minval = self.range[0]\r\n+ maxval = self.range[1]\r\n+\r\n+ if self.verbose:\r\n+ print("minval: ", minval)\r\n+ print("maxval: ", maxval)\r\n+\r\n+ # pass extent with vmin and vmax parameters\r\n+ proj_t = ccrs.PlateCarree()\r\n+ if ts is None:\r\n+ self.dset.where(\r\n+ self.dset[self.varname] > threshold\r\n+ )[self.varname].plot(ax=ax,\r\n+ vmin=minval,\r\n+ vmax=maxval,\r\n+ transform=proj_t,\r\n+ cmap=self.cmap,\r\n+ cbar_kwargs=self.label\r\n+ )\r\n+ if self.title != "" and self.title is not None:\r\n+ pyplot.title(self.title)\r\n+ pyplot.savefig(self.output)\r\n+ else:\r\n+ if self.colorbar:\r\n+ self.dset.where(\r\n+ self.dset[self.varname] > threshold\r\n+ )[self.varname].isel(time=ts).plot(ax=ax,\r\n+ vmin=minval,\r\n+ vmax=maxval,\r\n+ transform=proj_t,\r\n+ cmap=self.cmap,\r\n+ cbar_kwargs=self.label\r\n+ )\r\n+ else:\r\n+ self.dset.where(\r\n+ self.dset[self.varname] > minval\r\n+ )[self.varname].isel(time=ts).plot(ax=ax,\r\n+ vmin=minval,\r\n+ vmax=maxval,\r\n+ transform=proj_t,\r\n+ cmap=self.cmap,\r\n+ add_colorbar=False)\r\n+ if self.title != "" and self.title is not None:\r\n+ pyplot.title(self.title + "(time = " + str(ts) + \')\')\r\n+ pyplot.savefig(self.output[:-4] + "_time" + str(ts) +\r\n+ self.output[-4:]) # assume png format\r\n+\r\n+\r\n+if __name__ == \'__main__\':\r\n+ warnings.filterwarnings("ignore")\r\n+ parser = argparse.ArgumentParser()\r\n+ parser.add_argument(\r\n+ \'input\',\r\n+ help=\'input filename with geographical coordinates (netCDF format)\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--proj\',\r\n+ help=\'Config file with the projection on which we draw\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'varname\',\r\n+ help=\'Specify which variable to plot (case sensitive)\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--output\',\r\n+ help=\'output filename to store resulting image (png format)\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--config\',\r\n+ help=\'pass plotting parameters via a config file\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--shift\',\r\n+ help=\'shift longitudes if specified\',\r\n+ action="store_true"\r\n+ )\r\n+ parser.add_argument(\r\n+ "-v", "--verbose",\r\n+ help="switch on verbose mode",\r\n+ action="store_true")\r\n+ args = parser.parse_args()\r\n+\r\n+ dset = MapPlotXr(input=args.input, varname=args.varname,\r\n+ output=args.output, verbose=args.verbose,\r\n+ config_file=args.config, proj=args.proj,\r\n+ shift=args.shift)\r\n+\r\n+ if dset.time == []:\r\n+ dset.plot()\r\n+ else:\r\n+ for t in dset.time:\r\n+ dset.plot(t)\r\n+ dset.shift = False # only shift once\r\n+ dset.colorbar = True\r\n' |
b |
diff -r 000000000000 -r 810820a0d45c xarray_netcdf2netcdf.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xarray_netcdf2netcdf.py Sun Jul 31 21:23:21 2022 +0000 |
[ |
b'@@ -0,0 +1,268 @@\n+#!/usr/bin/env python3\r\n+#\r\n+# Apply operations on selected variables\r\n+# - scale\r\n+# one can also select the range of time (for timeseries)\r\n+# to apply these operations over the range only\r\n+# when a range of time is selected and when scaling, one\r\n+# can choose to save the entire timeseries or\r\n+# the selected range only.\r\n+# when scaling, one can add additional filters on dimensions\r\n+# (typically used to filter over latitudes and longitudes)\r\n+\r\n+\r\n+import argparse\r\n+import re\r\n+import warnings\r\n+from pathlib import Path\r\n+\r\n+import xarray as xr # noqa: E402\r\n+\r\n+\r\n+class netCDF2netCDF ():\r\n+ def __init__(self, infile, varname, scale="",\r\n+ output="output.netcdf",\r\n+ write_all=False,\r\n+ keep_attributes=True,\r\n+ filter_list="",\r\n+ where_config="",\r\n+ other="",\r\n+ sel=False,\r\n+ drop=False,\r\n+ verbose=False):\r\n+ self.drop = drop\r\n+ if Path(where_config).exists():\r\n+ f = open(where_config)\r\n+ self.where = f.read().replace("\\n", "")\r\n+ else:\r\n+ self.where = ""\r\n+ self.other = other\r\n+ self.sel = sel\r\n+ li = list(infile.split(","))\r\n+ if len(li) > 1:\r\n+ self.infile = li\r\n+ else:\r\n+ self.infile = infile\r\n+ self.verbose = verbose\r\n+ if varname == \'None\' or varname is None:\r\n+ self.varname = varname\r\n+ else:\r\n+ li = list(varname.split(","))\r\n+ self.varname = li\r\n+ self.write_all = write_all\r\n+ self.keep_attributes = keep_attributes\r\n+ if self.keep_attributes:\r\n+ xr.set_options(keep_attrs=True)\r\n+ self.filter = filter_list\r\n+ self.selection = {}\r\n+ self.method = {}\r\n+ if scale == "" or scale is None:\r\n+ self.scale = 1\r\n+ else:\r\n+ self.scale = float(scale)\r\n+ if output is None:\r\n+ self.output = "output.netcdf"\r\n+ else:\r\n+ self.output = output\r\n+ # initialization\r\n+ self.dset = None\r\n+ self.subset = None\r\n+ if self.verbose:\r\n+ print("infile: ", self.infile)\r\n+ print("varname: ", self.varname)\r\n+ print("filter_list: ", self.filter)\r\n+ print("scale: ", self.scale)\r\n+ print("write_all: ", self.write_all)\r\n+ print("keep_attributes: ", self.keep_attributes)\r\n+ print("sel: ", self.sel)\r\n+ print("output: ", self.output)\r\n+\r\n+ def apply_selection(self):\r\n+ self.dset = self.ds\r\n+ for key in self.selection:\r\n+ if \'slice\' in str(self.selection[key]):\r\n+ self.dset = self.dset.sel(\r\n+ {key: self.selection[key]}\r\n+ )\r\n+ else:\r\n+ self.dset = self.dset.sel(\r\n+ {key: self.selection[key]},\r\n+ method=self.method[key]\r\n+ )\r\n+\r\n+ def dimension_selection(self, single_filter):\r\n+ split_filter = single_filter.split(\'#\')\r\n+ dimension_varname = split_filter[0]\r\n+ op = split_filter[1]\r\n+ if self.sel:\r\n+ ll = float(split_filter[2])\r\n+ else:\r\n+ ll = int(split_filter[2])\r\n+ if (op == \'sl\'):\r\n+ if self.sel:\r\n+ rl = float(split_filter[3])\r\n+ else:\r\n+ rl = int(split_filter[3])\r\n+ self.selection[dimension_varname] = slice(ll, rl)\r\n+ elif (op == \'to\'):\r\n+ self.selection[dimension_varname] = slice(None, ll)\r\n+ elif (op == \'from\'):\r\n+ self.selection[dimension_varname] = slice(ll, None)\r\n+ elif (op == \'is\'):\r\n+ self.selection[dimension_varname] = ll\r\n+ if self.sel:\r\n+ rl = split_filter[3]\r\n+ if \'None\' in rl:\r\n+ '..b'here(\r\n+ self.eval_where(self.where),\r\n+ other=float(self.other)\r\n+ )\r\n+ else:\r\n+ self.ds = self.ds.where(\r\n+ self.eval_where(self.where)\r\n+ )\r\n+ self.filter_selection()\r\n+ if self.verbose:\r\n+ print(self.selection)\r\n+\r\n+ def save(self):\r\n+ if self.varname != \'None\' and \\\r\n+ self.varname is not None and \\\r\n+ not self.write_all:\r\n+ self.dset[self.varname].to_netcdf(self.output)\r\n+ else:\r\n+ self.dset.to_netcdf(self.output)\r\n+\r\n+ def is_float(self, element) -> bool:\r\n+ try:\r\n+ float(element)\r\n+ return True\r\n+ except ValueError:\r\n+ return False\r\n+\r\n+ def eval_where(self, where_condition):\r\n+ eval_cond = None\r\n+ list_names = list(set(\r\n+ list(self.ds.keys()) +\r\n+ list(self.ds.coords.keys()))\r\n+ )\r\n+ wcond = where_condition\r\n+ check_cond = where_condition\r\n+ for var in list_names:\r\n+ wcond = wcond.replace(var, \' self.ds.\' + var + \' \')\r\n+ check_cond = check_cond.replace(var, \'\')\r\n+ to_remove = "[><=&|()]"\r\n+ check_cond = re.sub(to_remove, "", check_cond).replace("!", "")\r\n+ check_cond = re.sub(\' +\', \' \', check_cond).strip()\r\n+ list_flt = check_cond.split(" ")\r\n+ no_convert = False\r\n+ for num in list_flt:\r\n+ if not self.is_float(num):\r\n+ no_convert = True\r\n+ if not no_convert:\r\n+ eval_cond = eval(wcond)\r\n+ return eval_cond\r\n+\r\n+\r\n+if __name__ == \'__main__\':\r\n+ warnings.filterwarnings("ignore")\r\n+ parser = argparse.ArgumentParser()\r\n+ parser.add_argument(\r\n+ \'input\',\r\n+ help=\'input filename in netCDF format\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'varname\',\r\n+ help=\'Specify which variable to plot (case sensitive)\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--filter\',\r\n+ nargs="*",\r\n+ help=\'Filter list variable#operator#value_s#value_e\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--where\',\r\n+ help=\'filename with where condition to be evaluated\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--output\',\r\n+ help=\'Output filename to store the resulting netCDF file\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--scale\',\r\n+ help=\'scale factor to apply to selection (float)\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--other\',\r\n+ help=\'Value to use for locations where condition is False (float)\'\r\n+ )\r\n+ parser.add_argument(\r\n+ "--write_all",\r\n+ help="write all data to netCDF",\r\n+ action="store_true")\r\n+ parser.add_argument(\r\n+ "--keep_attributes",\r\n+ help="Keep all attributes",\r\n+ action="store_true")\r\n+ parser.add_argument(\r\n+ "-v", "--verbose",\r\n+ help="switch on verbose mode",\r\n+ action="store_true")\r\n+ parser.add_argument(\r\n+ "--selection",\r\n+ help="select by values",\r\n+ action="store_true")\r\n+ parser.add_argument(\r\n+ "--drop",\r\n+ help="drop values where condition is not met",\r\n+ action="store_true")\r\n+ args = parser.parse_args()\r\n+\r\n+ print("args.selection", args.selection)\r\n+ dset = netCDF2netCDF(infile=args.input, varname=args.varname,\r\n+ scale=args.scale, output=args.output,\r\n+ write_all=args.write_all,\r\n+ sel=args.selection,\r\n+ keep_attributes=args.keep_attributes,\r\n+ filter_list=args.filter,\r\n+ where_config=args.where,\r\n+ drop=args.drop, other=args.other,\r\n+ verbose=args.verbose)\r\n+ dset.compute()\r\n+ dset.save()\r\n' |
b |
diff -r 000000000000 -r 810820a0d45c xarray_select.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xarray_select.py Sun Jul 31 21:23:21 2022 +0000 |
[ |
b'@@ -0,0 +1,294 @@\n+# xarray tool for:\r\n+# - getting metadata information\r\n+# - select data and save results in csv file for further post-processing\r\n+\r\n+import argparse\r\n+import os\r\n+import warnings\r\n+\r\n+import geopandas as gdp\r\n+\r\n+import pandas as pd\r\n+\r\n+from shapely.geometry import Point\r\n+from shapely.ops import nearest_points\r\n+\r\n+import xarray as xr\r\n+\r\n+\r\n+class XarraySelect ():\r\n+ def __init__(self, infile, select="", outfile="", outputdir="",\r\n+ latname="", latvalN="", latvalS="", lonname="",\r\n+ lonvalE="", lonvalW="", filter_list="", coords="",\r\n+ time="", verbose=False, no_missing=False,\r\n+ tolerance=None):\r\n+ self.infile = infile\r\n+ self.select = select\r\n+ self.outfile = outfile\r\n+ self.outputdir = outputdir\r\n+ self.latname = latname\r\n+ if tolerance != "" and tolerance is not None:\r\n+ self.tolerance = float(tolerance)\r\n+ else:\r\n+ self.tolerance = -1\r\n+ if latvalN != "" and latvalN is not None:\r\n+ self.latvalN = float(latvalN)\r\n+ else:\r\n+ self.latvalN = ""\r\n+ if latvalS != "" and latvalS is not None:\r\n+ self.latvalS = float(latvalS)\r\n+ else:\r\n+ self.latvalS = ""\r\n+ self.lonname = lonname\r\n+ if lonvalE != "" and lonvalE is not None:\r\n+ self.lonvalE = float(lonvalE)\r\n+ else:\r\n+ self.lonvalE = ""\r\n+ if lonvalW != "" and lonvalW is not None:\r\n+ self.lonvalW = float(lonvalW)\r\n+ else:\r\n+ self.lonvalW = ""\r\n+ self.filter = filter_list\r\n+ self.time = time\r\n+ self.coords = coords\r\n+ self.verbose = verbose\r\n+ self.no_missing = no_missing\r\n+ # initialization\r\n+ self.dset = None\r\n+ self.gset = None\r\n+ if self.verbose:\r\n+ print("infile: ", self.infile)\r\n+ print("outfile: ", self.outfile)\r\n+ print("select: ", self.select)\r\n+ print("outfile: ", self.outfile)\r\n+ print("outputdir: ", self.outputdir)\r\n+ print("latname: ", self.latname)\r\n+ print("latvalN: ", self.latvalN)\r\n+ print("latvalS: ", self.latvalS)\r\n+ print("lonname: ", self.lonname)\r\n+ print("lonvalE: ", self.lonvalE)\r\n+ print("lonvalW: ", self.lonvalW)\r\n+ print("filter: ", self.filter)\r\n+ print("time: ", self.time)\r\n+ print("coords: ", self.coords)\r\n+\r\n+ def rowfilter(self, single_filter):\r\n+ split_filter = single_filter.split(\'#\')\r\n+ filter_varname = split_filter[0]\r\n+ op = split_filter[1]\r\n+ ll = float(split_filter[2])\r\n+ if (op == \'bi\'):\r\n+ rl = float(split_filter[3])\r\n+ if filter_varname == self.select:\r\n+ # filter on values of the selected variable\r\n+ if op == \'bi\':\r\n+ self.dset = self.dset.where(\r\n+ (self.dset <= rl) & (self.dset >= ll)\r\n+ )\r\n+ elif op == \'le\':\r\n+ self.dset = self.dset.where(self.dset <= ll)\r\n+ elif op == \'ge\':\r\n+ self.dset = self.dset.where(self.dset >= ll)\r\n+ elif op == \'e\':\r\n+ self.dset = self.dset.where(self.dset == ll)\r\n+ else: # filter on other dimensions of the selected variable\r\n+ if op == \'bi\':\r\n+ self.dset = self.dset.sel({filter_varname: slice(ll, rl)})\r\n+ elif op == \'le\':\r\n+ self.dset = self.dset.sel({filter_varname: slice(None, ll)})\r\n+ elif op == \'ge\':\r\n+ self.dset = self.dset.sel({filter_varname: slice(ll, None)})\r\n+ elif op == \'e\':\r\n+ self.dset = self.dset.sel({filter_varname: ll},\r\n+ method=\'nearest\')\r\n+\r\n+ def selection(self):\r\n+ if self.dset is None:\r\n+ sel'..b'to a mask that is the same for\r\n+ # all dimensions in the dataset.\r\n+ dsel_frame = self.dset\r\n+ for dim in self.dset.dims:\r\n+ if dim != self.latname and dim != self.lonname:\r\n+ dsel_frame = dsel_frame.isel({dim: 0})\r\n+ # transform to pandas dataframe\r\n+ dff = dsel_frame.to_dataframe().dropna().reset_index()\r\n+ # transform to geopandas to collocate\r\n+ gdf = gdp.GeoDataFrame(dff,\r\n+ geometry=gdp.points_from_xy(dff[self.lonname],\r\n+ dff[self.latname]))\r\n+ # Find nearest location where values are not null\r\n+ point = Point(self.lonvalE, self.latvalN)\r\n+ multipoint = gdf.geometry.unary_union\r\n+ queried_geom, nearest_geom = nearest_points(point, multipoint)\r\n+ self.nearest_latvalN = nearest_geom.y\r\n+ self.nearest_lonvalE = nearest_geom.x\r\n+\r\n+ def selection_from_coords(self):\r\n+ fcoords = pd.read_csv(self.coords, sep=\'\\t\')\r\n+ for row in fcoords.itertuples():\r\n+ self.latvalN = row[0]\r\n+ self.lonvalE = row[1]\r\n+ self.outfile = (os.path.join(self.outputdir,\r\n+ self.select + \'_\' +\r\n+ str(row.Index) + \'.tabular\'))\r\n+ self.selection()\r\n+\r\n+\r\n+if __name__ == \'__main__\':\r\n+ warnings.filterwarnings("ignore")\r\n+ parser = argparse.ArgumentParser()\r\n+\r\n+ parser.add_argument(\r\n+ \'infile\',\r\n+ help=\'netCDF input filename\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--select\',\r\n+ help=\'Variable name to select\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--latname\',\r\n+ help=\'Latitude name\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--latvalN\',\r\n+ help=\'North latitude value\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--latvalS\',\r\n+ help=\'South latitude value\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--lonname\',\r\n+ help=\'Longitude name\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--lonvalE\',\r\n+ help=\'East longitude value\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--lonvalW\',\r\n+ help=\'West longitude value\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--tolerance\',\r\n+ help=\'Maximum distance between original and selected value for \'\r\n+ \' inexact matches e.g. abs(index[indexer] - target) <= tolerance\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--coords\',\r\n+ help=\'Input file containing Latitude and Longitude\'\r\n+ \'for geographical selection\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--filter\',\r\n+ nargs="*",\r\n+ help=\'Filter list variable#operator#value_s#value_e\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--time\',\r\n+ help=\'select timeseries variable#operator#value_s[#value_e]\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--outfile\',\r\n+ help=\'csv outfile for storing results of the selection\'\r\n+ \'(valid only when --select)\'\r\n+ )\r\n+ parser.add_argument(\r\n+ \'--outputdir\',\r\n+ help=\'folder name for storing results with multiple selections\'\r\n+ \'(valid only when --select)\'\r\n+ )\r\n+ parser.add_argument(\r\n+ "-v", "--verbose",\r\n+ help="switch on verbose mode",\r\n+ action="store_true"\r\n+ )\r\n+ parser.add_argument(\r\n+ "--no_missing",\r\n+ help="""Do not take into account possible null/missing values\r\n+ (only valid for single location)""",\r\n+ action="store_true"\r\n+ )\r\n+ args = parser.parse_args()\r\n+\r\n+ p = XarraySelect(args.infile, args.select, args.outfile, args.outputdir,\r\n+ args.latname, args.latvalN, args.latvalS, args.lonname,\r\n+ args.lonvalE, args.lonvalW, args.filter,\r\n+ args.coords, args.time, args.verbose,\r\n+ args.no_missing, args.tolerance)\r\n+ if args.select:\r\n+ p.selection()\r\n' |