Usage

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

[2]:
from argopy import DataFetcher as ArgoDataFetcher
ds = ArgoDataFetcher().region([-75, -45, 20, 30, 0, 100, '2011', '2012']).to_xarray()
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)

In this example, we used a data fetcher 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:

[3]:
print(ds)
<xarray.Dataset>
Dimensions:                (N_POINTS: 29023)
Coordinates:
  * N_POINTS               (N_POINTS) int64 0 1 2 3 ... 29019 29020 29021 29022
    LATITUDE               (N_POINTS) float64 24.54 24.54 24.54 ... 22.58 22.58
    LONGITUDE              (N_POINTS) float64 -45.14 -45.14 ... -54.11 -54.11
    TIME                   (N_POINTS) datetime64[ns] 2011-01-01T11:49:19 ... ...
Data variables:
    CONFIG_MISSION_NUMBER  (N_POINTS) int64 1 1 1 1 1 1 1 1 ... 2 2 2 2 2 2 2 2
    CYCLE_NUMBER           (N_POINTS) int64 23 23 23 23 23 23 ... 23 23 23 23 23
    DATA_MODE              (N_POINTS) <U1 'D' 'D' 'D' 'D' ... 'D' 'D' 'D' 'D'
    DIRECTION              (N_POINTS) <U1 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A'
    PLATFORM_NUMBER        (N_POINTS) int64 1901463 1901463 ... 6901052 6901052
    POSITION_QC            (N_POINTS) int64 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 ... 70.7 80.2 90.7
    PRES_QC                (N_POINTS) int64 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1
    PSAL                   (N_POINTS) float64 37.45 37.45 37.45 ... 37.19 37.16
    PSAL_QC                (N_POINTS) int64 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 ... 24.78 24.14
    TEMP_QC                (N_POINTS) int64 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
Attributes:
    DATA_ID:              ARGO
    DOI:                  http://doi.org/10.17882/42182
    Fetched_from:         https://www.ifremer.fr/erddap
    Fetched_by:           docs
    Fetched_date:         2021/01/04
    Fetched_constraints:  [x=-75.00/-45.00; y=20.00/30.00; z=0.0/100.0; t=201...
    Fetched_uri:          ['https://www.ifremer.fr/erddap/tabledap/ArgoFloats...
    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 argopy.argo.point2profile():

[4]:
ds = ds.argo.point2profile()
print(ds)
<xarray.Dataset>
Dimensions:                (N_LEVELS: 55, N_PROF: 1419)
Coordinates:
  * N_PROF                 (N_PROF) int64 42 664 298 5 527 ... 368 526 1272 1375
  * N_LEVELS               (N_LEVELS) int64 0 1 2 3 4 5 6 ... 49 50 51 52 53 54
    LATITUDE               (N_PROF) float64 24.54 25.04 21.48 ... 20.66 22.58
    LONGITUDE              (N_PROF) float64 -45.14 -51.58 ... -53.52 -54.11
    TIME                   (N_PROF) datetime64[ns] 2011-01-01T11:49:19 ... 20...
Data variables:
    CONFIG_MISSION_NUMBER  (N_PROF) int64 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 2 2
    CYCLE_NUMBER           (N_PROF) int64 23 10 135 23 119 ... 193 171 165 4 23
    DATA_MODE              (N_PROF) <U1 'D' 'D' 'D' 'D' 'D' ... 'D' 'D' 'D' 'D'
    DIRECTION              (N_PROF) <U1 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A'
    PLATFORM_NUMBER        (N_PROF) int64 1901463 4901211 ... 6900935 6901052
    POSITION_QC            (N_PROF) int64 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
    PRES_QC                (N_PROF) int64 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1
    PSAL                   (N_PROF, N_LEVELS) float64 37.45 37.45 ... nan nan
    PSAL_QC                (N_PROF) int64 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 ... nan nan
    TEMP_QC                (N_PROF) int64 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
Attributes:
    DATA_ID:              ARGO
    DOI:                  http://doi.org/10.17882/42182
    Fetched_from:         https://www.ifremer.fr/erddap
    Fetched_by:           docs
    Fetched_date:         2021/01/04
    Fetched_constraints:  [x=-75.00/-45.00; y=20.00/30.00; z=0.0/100.0; t=201...
    Fetched_uri:          ['https://www.ifremer.fr/erddap/tabledap/ArgoFloats...
    history:              Variables filtered according to DATA_MODE; Variable...

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

[5]:
ds = ArgoDataFetcher().float(6902746).to_xarray()
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)

or for a float profile using the cycle number:

[6]:
ds = ArgoDataFetcher().profile(6902755, 12).to_xarray()
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)
/home/docs/checkouts/readthedocs.org/user_builds/argopy/conda/v0.1.7/lib/python3.8/site-packages/xarray/core/alignment.py:307: FutureWarning: Index.__or__ operating as a set operation is deprecated, in the future this will be a logical operation matching Series.__or__.  Use index.union(other) instead
  index = joiner(matching_indexes)