Mercurial > repos > ecology > argo_getdata
changeset 0:055a934a380f draft
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/ocean commit d3171d27d35f51b8e7464082610431642f1e4660
author | ecology |
---|---|
date | Thu, 21 Dec 2023 13:21:21 +0000 |
parents | |
children | 28c8f085d1b4 |
files | argo_getdata.py argo_getdata.xml macro.xml test-data/argo_data.netcdf |
diffstat | 4 files changed, 611 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/argo_getdata.py Thu Dec 21 13:21:21 2023 +0000 @@ -0,0 +1,191 @@ +# author: Marie Jossรฉ + +# Python script + +############################# +# Argo data access # +############################# + +# Packages : argopy + + +# Load arguments +import argparse +import sys + +import argopy + +command_line_args = sys.argv[1:] + + +parser = argparse.ArgumentParser(description="Retrieve argo Data") +# Add arguments + +parser.add_argument("--user", type=str, + help="User mode : standard, expert or research") +parser.add_argument("--cardinal_1", type=float, help="Longitude min") +parser.add_argument("--cardinal_2", type=float, help="Longitude max") +parser.add_argument("--cardinal_3", type=float, help="Latitude min") +parser.add_argument("--cardinal_4", type=float, help="Latitude max") +parser.add_argument("--pressure_1", type=float, help="Pressure min") +parser.add_argument("--pressure_2", type=float, help="Pressure max") +parser.add_argument("--date_1", type=str, help="Starting date") +parser.add_argument("--date_2", type=str, help="Ending date.") +parser.add_argument("--wmo", type=str, help="WMO: argo's identifier") +parser.add_argument("--profile", type=str, help="Number of profiles") +parser.add_argument("--params", type=str, help="List of bgc parameters") +parser.add_argument("--measured", type=str, help="List of bgc parameters") +parser.add_argument("--output_argo", type=str, help="Output data from argo") + +args = parser.parse_args(command_line_args) + + +# Parse the command line arguments + +print(args) +# Import data + +user = args.user +cardinal_1 = args.cardinal_1 +cardinal_2 = args.cardinal_2 +cardinal_3 = args.cardinal_3 +cardinal_4 = args.cardinal_4 +pressure_1 = args.pressure_1 +pressure_2 = args.pressure_2 +date_1 = args.date_1 +date_2 = args.date_2 +wmo = args.wmo +if wmo is not None: + wmo = list(map(int, wmo.split(","))) +profile = args.profile +if profile is not None: + profile = list(map(int, profile.split(","))) +params = args.params +if params is not None: + params = params.split(",") + if len(params) == 83: + params = "all" +measured = args.measured +if measured is not None: + measured = measured.split(",") + +# Letโs import the argopy data fetcher: + +###################### +# User mode # +###################### +# By default, +# all argopy data fetchers are set to work with a standard user mode. +# To change that + +argopy.set_options(mode=user) + +###################### +# Fetching Argo data # +###################### +# Data selection # + +# To access Argo data with a DataFetcher, +# you need to define how to select your data of interest. +# argopy provides 3 different data selection methods: + +argo_data = argopy.DataFetcher() + +# ๐บ For a space/time domain # + +if (cardinal_1 is not None): + mode = "region" + argo_data = argo_data.region([cardinal_1, cardinal_2, + cardinal_3, cardinal_4, + pressure_1, pressure_2, + date_1, date_2]) + +# โ For one or more profiles # +# Use the fetcher access point argopy.DataFetcher.profile() +# to specify the float WMO platform number +# and the profile cycle number(s) to retrieve profiles for. +elif (wmo is not None and profile is not None): + argo_data = argo_data.profile(wmo, profile) + # can also be argo_data = argo_data.profile(6902755, [3, 12]) + mode = "profile" + +# ๐ค For one or more floats # +# If you know the Argo float unique identifier number called a WMO number +# you can use the fetcher access point DataFetcher.float() +# to specify one or more float WMO platform numbers to select. +else: + argo_data = argo_data.float(wmo) + # can also be argo_data = argo_data.float([6902746, 6902755]) + mode = "float" + +# Data sources # +# Letโs start with standard import: +# argopy.reset_options() +# Specify data source erddap, gdac or argovis + +# if (ftp != "") : + # argopy.set_options(src = "gdac", ftp = ftp) +# else : + # argopy.set_options(src = "erddap") + +# With remote, online data sources, +# it may happens that the data server is experiencing down time. +print(argopy.status()) + +# Dataset # +# Argo data are distributed as a single dataset. +# It is referenced at https://doi.org/10.17882/42182. +# But they are several Argo missions with specific files and parameters +# that need special handling by argopy, namely: +# - the core Argo Mission: from floats that measure temperature, +# salinity, pressure down to 2000m, +# - the Deep Argo Mission: from floats that measure temperature, +# salinity, pressure down to 6000m, +# - and the BGC-Argo Mission: from floats that measure temperature, +# salinity, pressure and oxygen, pH, nitrate, chlorophyll, +# backscatter, irradiance down to 2000m. +# You can choose between phy or bgc +if (params is None): + argopy.set_options(dataset="phy") +else: + argopy.set_options(dataset="bgc") + if (measured != ['None'] and measured is not None): + argo_data = argopy.DataFetcher(params=params, measured=measured) + if (mode == "region"): + argo_data = argo_data.region([cardinal_1, cardinal_2, + cardinal_3, cardinal_4, + pressure_1, pressure_2, + date_1, date_2]) + elif (mode == "profile"): + argo_data = argo_data.profile(wmo, profile) + else: + argo_data = argo_data.float(wmo) + else: + argo_data = argopy.DataFetcher(params=params, measured=None) + if (mode == "region"): + argo_data = argo_data.region([cardinal_1, cardinal_2, + cardinal_3, cardinal_4, + pressure_1, pressure_2, + date_1, date_2]) + elif (mode == "profile"): + argo_data = argo_data.profile(wmo, profile) + else: + argo_data = argo_data.float(wmo) + +# Data fetching # +# To fetch (i.e. access, download, format) Argo data, +# argopy provides the DataFetcher class. +# Several DataFetcher arguments exist to help you select the dataset, +# the data source and the user mode the most suited for your applications; +# and also to improve performances. + +# You define the selection of data you want to fetch +# with one of the DataFetcher methods: region, float or profile. +# 2 lines to download Argo data: import and fetch ! + +argo_data = argo_data.load().data +argo_data.to_netcdf("argo_data.nc") + +# argo_metadata = argo_data.to_index() + +print(argo_data)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/argo_getdata.xml Thu Dec 21 13:21:21 2023 +0000 @@ -0,0 +1,396 @@ +<tool id="argo_getdata" name="Argo data access" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05"> + <description>for global ocean in situ observing system</description> + <macros> + <import>macro.xml</import> + </macros> + <expand macro="argo_requirements"> + </expand> + <required_files> + <include type="literal" path="argo_getdata.py"/> + <include type="literal" path="macro.xml"/> + </required_files> + <command detect_errors="exit_code"><![CDATA[ + python '$__tool_directory__/argo_getdata.py' + --user=$user + #if $selection.data_selection == 'space_time': + --cardinal_1=$selection.cardinal_1 + --cardinal_2=$selection.cardinal_2 + --cardinal_3=$selection.cardinal_3 + --cardinal_4=$selection.cardinal_4 + --pressure_1=$selection.pressure_1 + --pressure_2=$selection.pressure_2 + --date_1=$selection.date_1 + --date_2=$selection.date_2 + #else if $selection.data_selection == 'floats': + --wmo=$selection.wmo + #else: + --wmo=$selection.wmo + --profile=$selection.profile + #end if + #if $dataset.data_dataset == 'bgc' : + --params=$dataset.params + --measured=$dataset.measured + #end if + --output_argo='$output_argo' + ]]> + </command> + <inputs> + <param name="user" type="select" label="We have preconfigured some mode of operations for you. What mode do you want to use?"> + <option value="standard">๐ standard mode simplifies the dataset, remove most of its jargon and return a priori good data</option> + <option value="research">๐ฃ research mode simplifies the dataset to its heart, preserving only data of the highest quality for research studies, including studies sensitive to small pressure and salinity bias </option> + <option value="expert">๐ expert mode return all the Argo data, without any postprocessing</option> + </param> + <conditional name="selection"> + <param name="data_selection" type="select" label="How do you want to select your data of interest ?"> + <option value="space_time">๐บ For a space/time domain</option> + <option value="floats">๐ค For one or more floats</option> + <option value="profiles">โ For one or more profiles</option> + </param> + <when value="space_time"> + <param name="cardinal_1" type="float" min="-90" max="90" value="0" label="Input longitude min (+east/-west):"/> + <param name="cardinal_2" type="float" min="-90" max="90" value="0" label="Input longitude max (+east/-west):"/> + <param name="cardinal_3" type="float" min="-90" max="90" value="0" label="Input latitude min (+north/-south):"/> + <param name="cardinal_4" type="float" min="-90" max="90" value="0" label="Input latitude max (+north/-south):"/> + <param name="pressure_1" type="float" value="0" label="Input pressure min (db)"/> + <param name="pressure_2" type="float" value="0" label="Input pressure max (db)"/> + <param name="date_1" type="text" optional="true" label="Input starting date" value="yyyy-mm"/> + <param name="date_2" type="text" optional="true" label="Input ending date" value="yyyy-mm"/> + </when> + <when value="floats"> + <param name="wmo" type="text" label="Input WMO number" help="If you want to enter multiple ones just separate them with a comma (example : 6902746, 6902755)"/> + </when> + <when value="profiles"> + <param name="wmo" type="integer" value="0" label="Input WMO number" /> + <param name="profile" type="text" multiple="true" value="0" label="Input profile cycle number" help="if you want to enter multiple ones just separate them with a comma (example : 3,12)"/> + </when> + </conditional> + <!--<conditional name="sources"> + <param name="data_sources" type="select" label="From where do you want to get your data ?"> + <option value="erddap">โญ the Ifremer erddap server </option> + <option value="gdac">๐ an Argo GDAC server or any other GDAC-compliant local folder.</option> + <option value="argovis">๐ the Argovis server.</option> + </param> + <when value="erddap"/> + <when value="gdac"> + <param name="ftp" type="select" label="Input ftp server url"> + <option value="ftp://ftp.ifremer.fr/ifremer/argo">France Coriolis</option> + <option value="ftp://usgodae.org/pub/outgoing/argo">US GODAE</option> + </param> + </when> + <when value="argovis"/> + </conditional>--> + <conditional name="dataset"> + <param name="data_dataset" type="select" label="Which kind of dataset do you want ?" help="At this time, BGC parameters are only available in expert user mode."> + <option value="phy">Physical parameters: temperature, salinity, pressure</option> + <option value="bgc">Biogeochemical parameters: temperature, salinity, pressure and oxygen, pH, nitrate, chlorophyll, backscatter, irradiance</option> + </param> + <when value="phy"/> + <when value="bgc"> + <param name="params" type="select" multiple="true" label="Choose which variable you want to study"> + <option value="BBP532">BBP532</option> + <option value="BBP532_ADJUSTED">BBP532_ADJUSTED</option> + <option value="BBP532_ADJUSTED_ERROR">BBP532_ADJUSTED_ERROR</option> + <option value="BBP532_ADJUSTED_QC">BBP532_ADJUSTED_QC</option> + <option value="BBP532_DATA_MODE">BBP532_DATA_MODE</option> + <option value="BBP532_QC">BBP532_QC</option> + <option value="BBP700">BBP700</option> + <option value="BBP700_ADJUSTED">BBP700_ADJUSTED</option> + <option value="BBP700_ADJUSTED_ERROR">BBP700_ADJUSTED_ERROR</option> + <option value="BBP700_ADJUSTED_QC">BBP700_ADJUSTED_QC</option> + <option value="BBP700_DATA_MODE">BBP700_DATA_MODE</option> + <option value="BBP700_QC">BBP700_QC</option> + <option value="CHLA">CHLA</option> + <option value="CHLA_ADJUSTED">CHLA_ADJUSTED</option> + <option value="CHLA_ADJUSTED_ERROR">CHLA_ADJUSTED_ERROR</option> + <option value="CHLA_ADJUSTED_QC">CHLA_ADJUSTED_QC</option> + <option value="CHLA_DATA_MODE">CHLA_DATA_MODE</option> + <option value="CHLA_QC">CHLA_QC</option> + <option value="CONFIG_MISSION_NUMBER">CONFIG_MISSION_NUMBER</option> + <option value="CYCLE_NUMBER">CYCLE_NUMBER</option> + <option value="DIRECTION">DIRECTION</option> + <option value="DOWNWELLING_PAR">DOWNWELLING_PAR</option> + <option value="DOWNWELLING_PAR_ADJUSTED">DOWNWELLING_PAR_ADJUSTED</option> + <option value="DOWNWELLING_PAR_ADJUSTED_ERROR">DOWNWELLING_PAR_ADJUSTED_ERROR</option> + <option value="DOWNWELLING_PAR_ADJUSTED_QC">DOWNWELLING_PAR_ADJUSTED_QC</option> + <option value="DOWNWELLING_PAR_DATA_MODE">DOWNWELLING_PAR_DATA_MODE</option> + <option value="DOWNWELLING_PAR_QC">DOWNWELLING_PAR_QC</option> + <option value="DOWN_IRRADIANCE380">DOWN_IRRADIANCE380</option> + <option value="DOWN_IRRADIANCE380_ADJUSTED">DOWN_IRRADIANCE380_ADJUSTED</option> + <option value="DOWN_IRRADIANCE380_ADJUSTED_ERROR">DOWN_IRRADIANCE380_ADJUSTED_ERROR</option> + <option value="DOWN_IRRADIANCE380_ADJUSTED_QC">DOWN_IRRADIANCE380_ADJUSTED_QC</option> + <option value="DOWN_IRRADIANCE380_DATA_MODE">DOWN_IRRADIANCE380_DATA_MODE</option> + <option value="DOWN_IRRADIANCE380_QC">DOWN_IRRADIANCE380_QC</option> + <option value="DOWN_IRRADIANCE412">DOWN_IRRADIANCE412</option> + <option value="DOWN_IRRADIANCE412_ADJUSTED">DOWN_IRRADIANCE412_ADJUSTED</option> + <option value="DOWN_IRRADIANCE412_ADJUSTED_ERROR">DOWN_IRRADIANCE412_ADJUSTED_ERROR</option> + <option value="DOWN_IRRADIANCE412_ADJUSTED_QC">DOWN_IRRADIANCE412_ADJUSTED_QC</option> + <option value="DOWN_IRRADIANCE412_DATA_MODE">DOWN_IRRADIANCE412_DATA_MODE</option> + <option value="DOWN_IRRADIANCE412_QC">DOWN_IRRADIANCE412_QC</option> + <option value="DOWN_IRRADIANCE490">DOWN_IRRADIANCE490</option> + <option value="DOWN_IRRADIANCE490_ADJUSTED">DOWN_IRRADIANCE490_ADJUSTED</option> + <option value="DOWN_IRRADIANCE490_ADJUSTED_ERROR">DOWN_IRRADIANCE490_ADJUSTED_ERROR</option> + <option value="DOWN_IRRADIANCE490_ADJUSTED_QC">DOWN_IRRADIANCE490_ADJUSTED_QC</option> + <option value="DOWN_IRRADIANCE490_DATA_MODE">DOWN_IRRADIANCE490_DATA_MODE</option> + <option value="DOWN_IRRADIANCE490_QC">DOWN_IRRADIANCE490_QC</option> + <option value="DOXY">DOXY</option> + <option value="DOXY_ADJUSTED">DOXY_ADJUSTED</option> + <option value="DOXY_ADJUSTED_ERROR">DOXY_ADJUSTED_ERROR</option> + <option value="DOXY_ADJUSTED_QC">DOXY_ADJUSTED_QC</option> + <option value="DOXY_DATA_MODE">DOXY_DATA_MODE</option> + <option value="DOXY_QC">DOXY_QC</option> + <option value="NITRATE">NITRATE</option> + <option value="NITRATE_ADJUSTED">NITRATE_ADJUSTED</option> + <option value="NITRATE_ADJUSTED_ERROR">NITRATE_ADJUSTED_ERROR</option> + <option value="NITRATE_ADJUSTED_QC">NITRATE_ADJUSTED_QC</option> + <option value="NITRATE_DATA_MODE">NITRATE_DATA_MODE</option> + <option value="NITRATE_QC">NITRATE_QC</option> + <option value="PH_IN_SITU_TOTAL">PH_IN_SITU_TOTAL</option> + <option value="PH_IN_SITU_TOTAL_ADJUSTED">PH_IN_SITU_TOTAL_ADJUSTED</option> + <option value="PH_IN_SITU_TOTAL_ADJUSTED_ERROR">PH_IN_SITU_TOTAL_ADJUSTED_ERROR</option> + <option value="PH_IN_SITU_TOTAL_ADJUSTED_QC">PH_IN_SITU_TOTAL_ADJUSTED_QC</option> + <option value="PH_IN_SITU_TOTAL_DATA_MODE">PH_IN_SITU_TOTAL_DATA_MODE</option> + <option value="PH_IN_SITU_TOTAL_QC">PH_IN_SITU_TOTAL_QC</option> + <option value="PLATFORM_NUMBER">PLATFORM_NUMBER</option> + <option value="POSITION_QC">POSITION_QC</option> + <option value="PRES">PRES</option> + <option value="PRES_ADJUSTED">PRES_ADJUSTED</option> + <option value="PRES_ADJUSTED_ERROR">PRES_ADJUSTED_ERROR</option> + <option value="PRES_ADJUSTED_QC">PRES_ADJUSTED_QC</option> + <option value="PRES_DATA_MODE">PRES_DATA_MODE</option> + <option value="PRES_QC">PRES_QC</option> + <option value="PSAL">PSAL</option> + <option value="PSAL_ADJUSTED">PSAL_ADJUSTED</option> + <option value="PSAL_ADJUSTED_ERROR">PSAL_ADJUSTED_ERROR</option> + <option value="PSAL_ADJUSTED_QC">PSAL_ADJUSTED_QC</option> + <option value="PSAL_DATA_MODE">PSAL_DATA_MODE</option> + <option value="PSAL_QC">PSAL_QC</option> + <option value="TEMP">TEMP</option> + <option value="TEMP_ADJUSTED">TEMP_ADJUSTED</option> + <option value="TEMP_ADJUSTED_ERROR">TEMP_ADJUSTED_ERROR</option> + <option value="TEMP_ADJUSTED_QC">TEMP_ADJUSTED_QC</option> + <option value="TEMP_QC">TEMP_QC</option> + <option value="TIME_QC">TIME_QC</option> + </param> + <param name="measured" type="select" multiple="true" label="Choose which variables cannot be NaN and must return value" optional="true"> + <option value="BBP532">BBP532</option> + <option value="BBP532_ADJUSTED">BBP532_ADJUSTED</option> + <option value="BBP532_ADJUSTED_ERROR">BBP532_ADJUSTED_ERROR</option> + <option value="BBP532_ADJUSTED_QC">BBP532_ADJUSTED_QC</option> + <option value="BBP532_DATA_MODE">BBP532_DATA_MODE</option> + <option value="BBP532_QC">BBP532_QC</option> + <option value="BBP700">BBP700</option> + <option value="BBP700_ADJUSTED">BBP700_ADJUSTED</option> + <option value="BBP700_ADJUSTED_ERROR">BBP700_ADJUSTED_ERROR</option> + <option value="BBP700_ADJUSTED_QC">BBP700_ADJUSTED_QC</option> + <option value="BBP700_DATA_MODE">BBP700_DATA_MODE</option> + <option value="BBP700_QC">BBP700_QC</option> + <option value="CHLA">CHLA</option> + <option value="CHLA_ADJUSTED">CHLA_ADJUSTED</option> + <option value="CHLA_ADJUSTED_ERROR">CHLA_ADJUSTED_ERROR</option> + <option value="CHLA_ADJUSTED_QC">CHLA_ADJUSTED_QC</option> + <option value="CHLA_DATA_MODE">CHLA_DATA_MODE</option> + <option value="CHLA_QC">CHLA_QC</option> + <option value="CONFIG_MISSION_NUMBER">CONFIG_MISSION_NUMBER</option> + <option value="CYCLE_NUMBER">CYCLE_NUMBER</option> + <option value="DIRECTION">DIRECTION</option> + <option value="DOWNWELLING_PAR">DOWNWELLING_PAR</option> + <option value="DOWNWELLING_PAR_ADJUSTED">DOWNWELLING_PAR_ADJUSTED</option> + <option value="DOWNWELLING_PAR_ADJUSTED_ERROR">DOWNWELLING_PAR_ADJUSTED_ERROR</option> + <option value="DOWNWELLING_PAR_ADJUSTED_QC">DOWNWELLING_PAR_ADJUSTED_QC</option> + <option value="DOWNWELLING_PAR_DATA_MODE">DOWNWELLING_PAR_DATA_MODE</option> + <option value="DOWNWELLING_PAR_QC">DOWNWELLING_PAR_QC</option> + <option value="DOWN_IRRADIANCE380">DOWN_IRRADIANCE380</option> + <option value="DOWN_IRRADIANCE380_ADJUSTED">DOWN_IRRADIANCE380_ADJUSTED</option> + <option value="DOWN_IRRADIANCE380_ADJUSTED_ERROR">DOWN_IRRADIANCE380_ADJUSTED_ERROR</option> + <option value="DOWN_IRRADIANCE380_ADJUSTED_QC">DOWN_IRRADIANCE380_ADJUSTED_QC</option> + <option value="DOWN_IRRADIANCE380_DATA_MODE">DOWN_IRRADIANCE380_DATA_MODE</option> + <option value="DOWN_IRRADIANCE380_QC">DOWN_IRRADIANCE380_QC</option> + <option value="DOWN_IRRADIANCE412">DOWN_IRRADIANCE412</option> + <option value="DOWN_IRRADIANCE412_ADJUSTED">DOWN_IRRADIANCE412_ADJUSTED</option> + <option value="DOWN_IRRADIANCE412_ADJUSTED_ERROR">DOWN_IRRADIANCE412_ADJUSTED_ERROR</option> + <option value="DOWN_IRRADIANCE412_ADJUSTED_QC">DOWN_IRRADIANCE412_ADJUSTED_QC</option> + <option value="DOWN_IRRADIANCE412_DATA_MODE">DOWN_IRRADIANCE412_DATA_MODE</option> + <option value="DOWN_IRRADIANCE412_QC">DOWN_IRRADIANCE412_QC</option> + <option value="DOWN_IRRADIANCE490">DOWN_IRRADIANCE490</option> + <option value="DOWN_IRRADIANCE490_ADJUSTED">DOWN_IRRADIANCE490_ADJUSTED</option> + <option value="DOWN_IRRADIANCE490_ADJUSTED_ERROR">DOWN_IRRADIANCE490_ADJUSTED_ERROR</option> + <option value="DOWN_IRRADIANCE490_ADJUSTED_QC">DOWN_IRRADIANCE490_ADJUSTED_QC</option> + <option value="DOWN_IRRADIANCE490_DATA_MODE">DOWN_IRRADIANCE490_DATA_MODE</option> + <option value="DOWN_IRRADIANCE490_QC">DOWN_IRRADIANCE490_QC</option> + <option value="DOXY">DOXY</option> + <option value="DOXY_ADJUSTED">DOXY_ADJUSTED</option> + <option value="DOXY_ADJUSTED_ERROR">DOXY_ADJUSTED_ERROR</option> + <option value="DOXY_ADJUSTED_QC">DOXY_ADJUSTED_QC</option> + <option value="DOXY_DATA_MODE">DOXY_DATA_MODE</option> + <option value="DOXY_QC">DOXY_QC</option> + <option value="NITRATE">NITRATE</option> + <option value="NITRATE_ADJUSTED">NITRATE_ADJUSTED</option> + <option value="NITRATE_ADJUSTED_ERROR">NITRATE_ADJUSTED_ERROR</option> + <option value="NITRATE_ADJUSTED_QC">NITRATE_ADJUSTED_QC</option> + <option value="NITRATE_DATA_MODE">NITRATE_DATA_MODE</option> + <option value="NITRATE_QC">NITRATE_QC</option> + <option value="PH_IN_SITU_TOTAL">PH_IN_SITU_TOTAL</option> + <option value="PH_IN_SITU_TOTAL_ADJUSTED">PH_IN_SITU_TOTAL_ADJUSTED</option> + <option value="PH_IN_SITU_TOTAL_ADJUSTED_ERROR">PH_IN_SITU_TOTAL_ADJUSTED_ERROR</option> + <option value="PH_IN_SITU_TOTAL_ADJUSTED_QC">PH_IN_SITU_TOTAL_ADJUSTED_QC</option> + <option value="PH_IN_SITU_TOTAL_DATA_MODE">PH_IN_SITU_TOTAL_DATA_MODE</option> + <option value="PH_IN_SITU_TOTAL_QC">PH_IN_SITU_TOTAL_QC</option> + <option value="PLATFORM_NUMBER">PLATFORM_NUMBER</option> + <option value="POSITION_QC">POSITION_QC</option> + <option value="PRES">PRES</option> + <option value="PRES_ADJUSTED">PRES_ADJUSTED</option> + <option value="PRES_ADJUSTED_ERROR">PRES_ADJUSTED_ERROR</option> + <option value="PRES_ADJUSTED_QC">PRES_ADJUSTED_QC</option> + <option value="PRES_DATA_MODE">PRES_DATA_MODE</option> + <option value="PRES_QC">PRES_QC</option> + <option value="PSAL">PSAL</option> + <option value="PSAL_ADJUSTED">PSAL_ADJUSTED</option> + <option value="PSAL_ADJUSTED_ERROR">PSAL_ADJUSTED_ERROR</option> + <option value="PSAL_ADJUSTED_QC">PSAL_ADJUSTED_QC</option> + <option value="PSAL_DATA_MODE">PSAL_DATA_MODE</option> + <option value="PSAL_QC">PSAL_QC</option> + <option value="TEMP">TEMP</option> + <option value="TEMP_ADJUSTED">TEMP_ADJUSTED</option> + <option value="TEMP_ADJUSTED_ERROR">TEMP_ADJUSTED_ERROR</option> + <option value="TEMP_ADJUSTED_QC">TEMP_ADJUSTED_QC</option> + <option value="TEMP_QC">TEMP_QC</option> + <option value="TIME_QC">TIME_QC</option> + </param> + </when> + </conditional> + </inputs> + <outputs> + <data name="output_argo" from_work_dir="argo_data.nc" format="netcdf" label="Argo data"/> + </outputs> + <tests> + <test expect_num_outputs="1"> + <param name="user" value="standard"/> + <param name="data_selection" value="space_time"/> + <param name="cardinal_1" value="-75.0"/> + <param name="cardinal_2" value="-45.0"/> + <param name="cardinal_3" value="20.0"/> + <param name="cardinal_4" value="30.0"/> + <param name="pressure_1" value="0.0"/> + <param name="pressure_2" value="10.0"/> + <param name="date_1" value="2011-01"/> + <param name="date_2" value="2011-06"/> + <param name="data_dataset" value="phy"/> + <output name="output_argo"> + <assert_contents> + <has_text text="LATITUDE LONGITUDE TIME"/> + </assert_contents> + </output> + </test> + <test expect_num_outputs="1"> + <param name="user" value="standard"/> + <param name="data_selection" value="floats"/> + <param name="wmo" value="6902746"/> + <param name="data_dataset" value="phy"/> + <output name="output_argo"> + <assert_contents> + <has_text text="DIMENSION_SCALE"/> + </assert_contents> + </output> + </test> + <test expect_num_outputs="1"> + <param name="user" value="standard"/> + <param name="data_selection" value="profiles"/> + <param name="wmo" value="6902755"/> + <param name="profile" value="12"/> + <param name="data_dataset" value="phy"/> + <output name="output_argo"> + <assert_contents> + <has_text text="Direction of the station profiles"/> + </assert_contents> + </output> + </test> + <test expect_num_outputs="1"> + <param name="user" value="expert"/> + <param name="data_selection" value="profiles"/> + <param name="wmo" value="6902755"/> + <param name="profile" value="12"/> + <param name="data_dataset" value="phy"/> + <output name="output_argo"> + <assert_contents> + <has_text text="Delayed mode or real time data"/> + </assert_contents> + </output> + </test> + <test expect_num_outputs="1"> + <param name="user" value="expert"/> + <param name="data_selection" value="floats"/> + <param name="wmo" value="6904241"/> + <param name="data_dataset" value="bgc"/> + <param name="params" value="DOXY,BBP700"/> + <output name="output_argo"> + <assert_contents> + <has_text text="_NCProperties"/> + </assert_contents> + </output> + </test> + </tests> + <help><![CDATA[ +========================================================== +Argo data access to global ocean in situ observing system. +========================================================== +In order to ease Argo data analysis for the vast majority of standard users, we implemented in argopy different levels of verbosity and data processing to hide or simply remove variables only meaningful to experts. Let argopy manage data wrangling, and focus on your scientific analysis. + +If you donโt know in which category you would place yourself, try to answer the following questions: + + - [] what is a WMO number ? + + - [] what is the difference between Delayed and Real Time data mode ? + + - [] what is an adjusted parameter ? + + - [] what a QC flag of 3 means ? + +If you donโt answer to more than 1 question: you probably will feel more comfortable with the standard or research user modes. + +By default, all argopy data fetchers are set to work with a standard user mode, the other possible modes are research and expert. + +**What it does** + +This tool based on argopy is able to fetch (i.e. access, download, format) Argo data into netcdf files. + + +**Input description** + +- This tool provides 3 user modes: + + - ๐ expert mode return all the Argo data, without any postprocessing, + + - ๐ standard mode simplifies the dataset, remove most of its jargon and return a priori good data, + + - ๐ฃ research mode simplifies the dataset to its heart, preserving only data of the highest quality for research studies, including studies sensitive to small pressure and salinity bias (e.g. calculations of global ocean heat content or mixed layer depth). + +- The tool provides 3 different data selection methods: + + - ๐บ For a space/time domain (to select data for a rectangular space/time domain) + + - ๐ค For one or more floats (if you know the Argo float unique identifier number called a WMO number you can use this mode) + + - โ For one or more profiles (specify the float WMO platform number and the profile cycle number(s) to retrieve profiles) + +- The tool can retrieve data from : + + - โญ the Ifremer **erddap** server (Default). The erddap server database is updated daily and doesnโt require you to download anymore data than what you need. You can select this data source with the keyword erddap and methods described below. The Ifremer erddap dataset is based on mono-profile files of the GDAC. Since this is the most efficient method to fetcher Argo data, itโs the default data source in argopy. + +- With this tool you can thus get access to the following Argo data: + + - the **phy** dataset, for physical parameters. This dataset provides data from floats that measure temperature, salinity, pressure, without limitation in depth. It is available from all Available data sources. Since this is the most common Argo data subset itโs selected with the phy keyword by default in argopy. + + - the **bgc** dataset, for biogeochemical parameters.This dataset provides data from floats that measure temperature, salinity, pressure and oxygen, pH, nitrate, chlorophyll, backscatter, irradiance, without limitation in depth. You can select this dataset with the keyword bgc and methods described below. + + +**Output** + +You can retrieve the Argo data in one netcdf file. + +**More about argopy** + +https://argopy.readthedocs.io/en/latest/index.html + + ]]></help> + <expand macro="argo_bibref"/> +</tool>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macro.xml Thu Dec 21 13:21:21 2023 +0000 @@ -0,0 +1,24 @@ +<macros> + <token name="@TOOL_VERSION@">0.1.15</token> + <token name="@VERSION_SUFFIX@">0</token> + <xml name="argo_requirements"> + <requirements> + <requirement type="package" version="@TOOL_VERSION@">argopy</requirement> + <yield/> + </requirements> + </xml> + <xml name="argo_input_user"> + <inputs> + <param name="user" type="select" label="Which kind of user are you ?"> + <option value="standard">๐ standard mode simplifies the dataset, remove most of its jargon and return a priori good data</option> + <option value="research">๐ฃ research mode simplifies the dataset to its heart, preserving only data of the highest quality for research studies, including studies sensitive to small pressure and salinity bias </option> + <option value="expert">๐ expert mode return all the Argo data, without any postprocessing</option> + </param> + </inputs> + </xml> + <xml name="argo_bibref"> + <citations> + <citation type="doi">doi:10.21105/joss.02425</citation> + </citations> + </xml> +</macros>