Usage#

To get access to Argo data, all you need is 2 lines of codes:

In [1]: from argopy import DataFetcher as ArgoDataFetcher

In [2]: ds = ArgoDataFetcher().region([-75, -45, 20, 30, 0, 100, '2011-01', '2011-06']).to_xarray()

In this example, we used a DataFetcher to get data for a given space/time region. We retrieved all Argo data measurements from 75W to 45W, 20N to 30N, 0db to 100db and from January to May 2011 (the max date is exclusive). Data are returned as a collection of measurements in a xarray.Dataset:

In [3]: ds
Out[3]: 
<xarray.Dataset>
Dimensions:          (N_POINTS: 9422)
Coordinates:
  * N_POINTS         (N_POINTS) int64 0 1 2 3 4 5 ... 9417 9418 9419 9420 9421
    LATITUDE         (N_POINTS) float64 24.54 24.54 24.54 ... 24.96 24.96 24.96
    LONGITUDE        (N_POINTS) float64 -45.14 -45.14 -45.14 ... -50.4 -50.4
    TIME             (N_POINTS) datetime64[ns] 2011-01-01T11:49:19 ... 2011-0...
Data variables: (12/15)
    CYCLE_NUMBER     (N_POINTS) int64 23 23 23 23 23 23 23 ... 38 38 38 38 38 38
    DATA_MODE        (N_POINTS) <U1 'D' 'D' 'D' 'D' 'D' ... 'D' 'D' 'D' 'D' 'D'
    DIRECTION        (N_POINTS) <U1 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A' 'A'
    PLATFORM_NUMBER  (N_POINTS) int64 1901463 1901463 ... 1901463 1901463
    POSITION_QC      (N_POINTS) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1
    PRES             (N_POINTS) float64 5.0 10.0 15.0 20.0 ... 90.0 95.0 100.0
    ...               ...
    PSAL_ERROR       (N_POINTS) float32 0.01 0.01 0.01 ... 0.01017 0.01016
    PSAL_QC          (N_POINTS) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1
    TEMP             (N_POINTS) float64 24.08 24.08 24.09 ... 21.54 21.28 21.19
    TEMP_ERROR       (N_POINTS) float32 0.002 0.002 0.002 ... 0.002 0.002 0.002
    TEMP_QC          (N_POINTS) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1
    TIME_QC          (N_POINTS) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1
Attributes:
    DATA_ID:              ARGO
    DOI:                  http://doi.org/10.17882/42182
    Fetched_from:         https://erddap.ifremer.fr/erddap
    Fetched_by:           docs
    Fetched_date:         2023/11/10
    Fetched_constraints:  [x=-75.00/-45.00; y=20.00/30.00; z=0.0/100.0; t=201...
    Fetched_uri:          ['https://erddap.ifremer.fr/erddap/tabledap/ArgoFlo...
    history:              Variables filtered according to DATA_MODE; Variable...

Fetched data are returned as a 1D array collection of measurements. If you prefer to work with a 2D array collection of vertical profiles, simply transform the dataset with the xarray.Dataset accessor method Dataset.argo.point2profile():

In [4]: ds = ds.argo.point2profile()

In [5]: ds
Out[5]: 
<xarray.Dataset>
Dimensions:          (N_PROF: 469, N_LEVELS: 55)
Coordinates:
  * N_PROF           (N_PROF) int64 15 286 125 0 223 46 ... 371 461 467 433 30
  * N_LEVELS         (N_LEVELS) int64 0 1 2 3 4 5 6 7 ... 48 49 50 51 52 53 54
    LATITUDE         (N_PROF) float64 24.54 25.04 21.48 ... 21.49 26.67 24.96
    LONGITUDE        (N_PROF) float64 -45.14 -51.58 -60.82 ... -66.83 -50.4
    TIME             (N_PROF) datetime64[ns] 2011-01-01T11:49:19 ... 2011-05-...
Data variables: (12/15)
    CYCLE_NUMBER     (N_PROF) int64 23 10 135 23 119 160 4 ... 163 1 5 2 10 38
    DATA_MODE        (N_PROF) <U1 'D' 'D' 'D' 'D' 'D' ... 'D' 'D' 'D' 'D' 'D'
    DIRECTION        (N_PROF) <U1 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A' 'A'
    PLATFORM_NUMBER  (N_PROF) int64 1901463 4901211 4900818 ... 6900778 1901463
    POSITION_QC      (N_PROF) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1
    PRES             (N_PROF, N_LEVELS) float64 5.0 10.0 15.0 ... nan nan nan
    ...               ...
    PSAL_ERROR       (N_PROF, N_LEVELS) float32 0.01 0.01 0.01 ... nan nan nan
    PSAL_QC          (N_PROF) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1
    TEMP             (N_PROF, N_LEVELS) float64 24.08 24.08 24.09 ... nan nan
    TEMP_ERROR       (N_PROF) float32 0.002 0.002 0.002 ... 0.002 0.0025 0.002
    TEMP_QC          (N_PROF) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1
    TIME_QC          (N_PROF) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1
Attributes:
    DATA_ID:              ARGO
    DOI:                  http://doi.org/10.17882/42182
    Fetched_from:         https://erddap.ifremer.fr/erddap
    Fetched_by:           docs
    Fetched_date:         2023/11/10
    Fetched_constraints:  [x=-75.00/-45.00; y=20.00/30.00; z=0.0/100.0; t=201...
    Fetched_uri:          ['https://erddap.ifremer.fr/erddap/tabledap/ArgoFlo...
    history:              Variables filtered according to DATA_MODE; Variable...

You can also fetch data for a specific float using its WMO number:

In [6]: ds = ArgoDataFetcher().float(6902746).to_xarray()

or for a float profile using the cycle number:

In [7]: ds = ArgoDataFetcher().profile(6902755, 12).to_xarray()