User mode: standard vs expert#

Problem

For beginners or non-experts of the Argo dataset, it can be quite complicated to get access to Argo measurements. Indeed, the Argo data set is very complex, with thousands of different variables, tens of reference tables and a user manual more than 100 pages long.

This is mainly due to:

  • Argo measurements coming from many different models of floats or sensors,

  • quality control of in situ measurements of autonomous platforms being really a matter of ocean and data experts,

  • the Argo data management workflow being distributed between more than 10 Data Assembly Centers all around the world,

  • the Argo autonomous profiling floats, despite quite a simple principle of functioning, is a rather complex robot that needs a lot of data to be monitored and logged.

Solution

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.

What type of user are you ?#

If you don’t know in which user 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 answered to no more than 1 question, you probably would feel more comfortable with the standard user mode. Otherwise, you can give a try to the expert mode.

In standard mode, fetched data are automatically filtered to account for their quality (only good are retained) and level of processing by the data centers (whether they looked at the data briefly or not).

Setting the user mode#

Let’s start with standard import:

In [1]: import argopy

In [2]: from argopy import DataFetcher as ArgoDataFetcher

By default, all argopy data fetchers are set to work with a standard user mode.

If you want to change the user mode, or simply makes it explicit, you can use:

  • argopy global options:

In [3]: argopy.set_options(mode='standard')
Out[3]: <argopy.options.set_options at 0x7f23b812a490>
  • a temporary context:

In [4]: with argopy.set_options(mode='standard'):
   ...:     ArgoDataFetcher().profile(6902746, 34)
   ...: 
  • option when instantiating the data fetcher:

In [5]: ArgoDataFetcher(mode='standard').profile(6902746, 34)
Out[5]: 
<datafetcher.erddap>
Name: Ifremer erddap Argo data fetcher for floats
API: https://www.ifremer.fr/erddap
Domain: phy;WMO6902746
Performances: cache=False, parallel=False
User mode: standard
Dataset: phy

Differences in user modes#

To highlight that, let’s compare data fetched for one profile with each modes.

You will note that the standard mode has fewer variables to let you focus on your analysis. For expert, all Argo variables for you to work with are here.

The difference is the most visible when fetching Argo data from a local copy of the GDAC ftp, so let’s use a sample of this provided by argopy tutorial datasets:

In [6]: ftproot, flist = argopy.tutorial.open_dataset('localftp')

In [7]: argopy.set_options(local_ftp=ftproot)
Out[7]: <argopy.options.set_options at 0x7f23abc11400>

In standard mode:

In [8]: with argopy.set_options(mode='standard'):
   ...:     ds = ArgoDataFetcher(src='localftp').profile(6901929, 2).to_xarray()
   ...:     print(ds.data_vars)
   ...: 
Data variables:
    CONFIG_MISSION_NUMBER  (N_POINTS) int32 
    CYCLE_NUMBER           (N_POINTS) int32 
    DATA_MODE              (N_POINTS) <U1 
    DIRECTION              (N_POINTS) <U1 
    PLATFORM_NUMBER        (N_POINTS) int32 
    POSITION_QC            (N_POINTS) int32 
    PRES                   (N_POINTS) float64 
    PRES_QC                (N_POINTS) int32 
    PSAL                   (N_POINTS) float64 
    PSAL_QC                (N_POINTS) int32 
    TEMP                   (N_POINTS) float64 
    TEMP_QC                (N_POINTS) int32 
    TIME_QC                (N_POINTS) int32 

In expert mode:

In [9]: with argopy.set_options(mode='expert'):
   ...:     ds = ArgoDataFetcher(src='localftp').profile(6901929, 2).to_xarray()
   ...:     print(ds.data_vars)
   ...: 
Data variables:
    CONFIG_MISSION_NUMBER     (N_POINTS) int32 2 2
    CYCLE_NUMBER              (N_POINTS) int32 2 2
    DATA_CENTRE               (N_POINTS) <U2 'BO' 'BO'
    DATA_MODE                 (N_POINTS) <U1 'R' 'R'
    DATA_STATE_INDICATOR      (N_POINTS) <U4 '2B  ' '2B  '
    DC_REFERENCE              (N_POINTS) <U32 '                              ...
    DIRECTION                 (N_POINTS) <U1 'A' 'A'
    FIRMWARE_VERSION          (N_POINTS) <U32 '5900A04                       ...
    FLOAT_SERIAL_NO           (N_POINTS) <U32 'AI2600-17EU01                 ...
    PI_NAME                   (N_POINTS) <U64 "Diarmuid O'Conchubhair        ...
    PLATFORM_NUMBER           (N_POINTS) int32 6901929 6901929
    PLATFORM_TYPE             (N_POINTS) <U32 'ARVOR                         ...
    POSITIONING_SYSTEM        (N_POINTS) <U8 'GPS     ' 'GPS     '
    POSITION_QC               (N_POINTS) int32 1 1
    PRES                      (N_POINTS) float32 0.4 0.5
    PRES_ADJUSTED             (N_POINTS) float32 nan nan
    PRES_ADJUSTED_ERROR       (N_POINTS) float32 nan nan
    PRES_ADJUSTED_QC          (N_POINTS) int32 0 0
    PRES_QC                   (N_POINTS) int32 1 1
    PROFILE_PRES_QC           (N_POINTS) <U1 'A' 'A'
    PROFILE_PSAL_QC           (N_POINTS) <U1 'A' 'A'
    PROFILE_TEMP_QC           (N_POINTS) <U1 'F' 'F'
    PROJECT_NAME              (N_POINTS) <U64 'Argo Ireland                  ...
    PSAL                      (N_POINTS) float32 35.34 35.34
    PSAL_ADJUSTED             (N_POINTS) float32 nan nan
    PSAL_ADJUSTED_ERROR       (N_POINTS) float32 nan nan
    PSAL_ADJUSTED_QC          (N_POINTS) int32 0 0
    PSAL_QC                   (N_POINTS) int32 1 1
    TEMP                      (N_POINTS) float32 10.03 10.03
    TEMP_ADJUSTED             (N_POINTS) float32 nan nan
    TEMP_ADJUSTED_ERROR       (N_POINTS) float32 nan nan
    TEMP_ADJUSTED_QC          (N_POINTS) int32 0 0
    TEMP_QC                   (N_POINTS) int32 4 4
    TIME_LOCATION             (N_POINTS) datetime64[ns] 2018-02-24T09:16:24.9...
    TIME_QC                   (N_POINTS) int32 1 1
    VERTICAL_SAMPLING_SCHEME  (N_POINTS) <U256 'Primary sampling: averaged [1...
    WMO_INST_TYPE             (N_POINTS) int32 844 844