Fetching Argo data¶
To access Argo data, you need to use a data fetcher. You can import and instantiate the default argopy data fetcher like this:
[2]:
from argopy import DataFetcher as ArgoDataFetcher
argo_loader = ArgoDataFetcher()
/home/docs/checkouts/readthedocs.org/user_builds/argopy/checkouts/v0.1.6/argopy/plotters.py:33: UserWarning: argopy requires cartopy installed for full map plotting functionality
warnings.warn("argopy requires cartopy installed for full map plotting functionality")
Then, you can request data for a specific space/time domain, for a given float or for a given vertical profile.
For a space/time domain¶
Use the fetcher access point argopy.DataFetcher.region()
to specify a domain and chain with the argopy.DataFetcher.to_xarray()
to get the data returned as xarray.Dataset
.
For instance, to retrieve data from 75W to 45W, 20N to 30N, 0db to 10db and from January to May 2011:
[3]:
ds = argo_loader.region([-75, -45, 20, 30, 0, 10, '2011-01-01', '2011-06']).to_xarray()
print(ds)
<xarray.Dataset>
Dimensions: (N_POINTS: 998)
Coordinates:
LATITUDE (N_POINTS) float64 24.54 24.54 25.04 ... 26.67 24.96 24.96
* N_POINTS (N_POINTS) int64 0 1 2 3 4 5 6 ... 992 993 994 995 996 997
LONGITUDE (N_POINTS) float64 -45.14 -45.14 -51.58 ... -50.4 -50.4
TIME (N_POINTS) datetime64[ns] 2011-01-01T11:49:19 ... 2011-0...
Data variables:
CYCLE_NUMBER (N_POINTS) int64 23 23 10 10 10 10 10 ... 1 5 2 10 10 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) float32 5.0 10.0 2.0 4.0 ... 5.12 9.42 5.0 10.0
PRES_QC (N_POINTS) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1
PSAL (N_POINTS) float32 37.44895 37.44793 ... 37.08037 37.0463
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) float32 24.081 24.084 24.028 ... 25.098 24.794
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://www.ifremer.fr/erddap
Fetched_by: docs
Fetched_date: 2020/08/31
Fetched_constraints: phy_[x=-75.00/-45.00; y=20.00/30.00; z=0.0/10.0; t=...
Fetched_uri: https://www.ifremer.fr/erddap/tabledap/ArgoFloats.n...
history: Variables filtered according to DATA_MODE; Variable...
Note that:
- the constraints on time is not mandatory: if not specified, the fetcher will return all data available in this region.
- the last time bound is exclusive: that’s why here we specifiy June to retrieve data collected in May.
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 argopy.DataFetcher.float()
to specify the float WMO platform number and chain with the argopy.DataFetcher.to_xarray()
to get the data returned as xarray.Dataset
.
For instance, to retrieve data for float WMO 6902746:
[4]:
ds = argo_loader.float(6902746).to_xarray()
print(ds)
<xarray.Dataset>
Dimensions: (N_POINTS: 9039)
Coordinates:
LATITUDE (N_POINTS) float64 20.08 20.08 20.08 ... 16.3 16.3 16.3
* N_POINTS (N_POINTS) int64 0 1 2 3 4 5 ... 9034 9035 9036 9037 9038
LONGITUDE (N_POINTS) float64 -60.17 -60.17 -60.17 ... -62.64 -62.64
TIME (N_POINTS) datetime64[ns] 2017-07-06T14:49:00 ... 2019-0...
Data variables:
CYCLE_NUMBER (N_POINTS) int64 1 1 1 1 1 1 1 1 ... 84 84 84 84 84 84 84
DATA_MODE (N_POINTS) <U1 'D' 'D' 'D' 'D' 'D' ... 'D' 'D' 'D' 'D' 'D'
DIRECTION (N_POINTS) <U1 'D' 'D' 'D' 'D' 'D' ... 'A' 'A' 'A' 'A' 'A'
PLATFORM_NUMBER (N_POINTS) int64 6902746 6902746 ... 6902746 6902746
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 9.0 14.0 24.0 ... 1.488e+03 1.509e+03
PRES_QC (N_POINTS) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1
PSAL (N_POINTS) float64 36.06 36.06 36.06 ... 34.97 34.98 34.98
PSAL_QC (N_POINTS) int64 1 1 1 1 1 1 1 1 1 1 ... 2 2 2 2 2 2 2 2 2
TEMP (N_POINTS) float64 28.04 28.03 28.02 ... 4.286 4.281 4.277
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://www.ifremer.fr/erddap
Fetched_by: docs
Fetched_date: 2020/08/31
Fetched_constraints: phy_WMO6902746
Fetched_uri: https://www.ifremer.fr/erddap/tabledap/ArgoFloats.n...
history: Variables filtered according to DATA_MODE; Variable...
To fetch data for a collection of floats, input them in a list:
[5]:
ds = argo_loader.float([6902746, 6902755]).to_xarray()
print(ds)
<xarray.Dataset>
Dimensions: (N_POINTS: 17682)
Coordinates:
LATITUDE (N_POINTS) float64 20.08 20.08 20.08 ... 62.52 62.52 62.52
* N_POINTS (N_POINTS) int64 0 1 2 3 4 ... 17678 17679 17680 17681
LONGITUDE (N_POINTS) float64 -60.17 -60.17 -60.17 ... -60.61 -60.61
TIME (N_POINTS) datetime64[ns] 2017-07-06T14:49:00 ... 2020-0...
Data variables:
CYCLE_NUMBER (N_POINTS) int64 1 1 1 1 1 1 1 1 ... 80 80 80 80 80 80 80
DATA_MODE (N_POINTS) <U1 'D' 'D' 'D' 'D' 'D' ... 'R' 'R' 'R' 'R' 'R'
DIRECTION (N_POINTS) <U1 'D' 'D' 'D' 'D' 'D' ... 'A' 'A' 'A' 'A' 'A'
PLATFORM_NUMBER (N_POINTS) int64 6902746 6902746 ... 6902755 6902755
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 9.0 14.0 24.0 34.0 ... 938.0 963.0 984.0
PRES_QC (N_POINTS) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1
PSAL (N_POINTS) float64 36.06 36.06 36.06 ... 34.88 34.88 34.88
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 28.04 28.03 28.02 ... 3.792 3.786 3.786
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://www.ifremer.fr/erddap
Fetched_by: docs
Fetched_date: 2020/08/31
Fetched_constraints: phy_WMO6902746;WMO6902755
Fetched_uri: https://www.ifremer.fr/erddap/tabledap/ArgoFloats.n...
history: Variables filtered according to DATA_MODE; Variable...
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 to retrieve profiles for, then chain with the argopy.DataFetcher.to_xarray()
to get the data returned as xarray.Dataset
.
For instance, to retrieve data for the 12th profile of float WMO 6902755:
[6]:
ds = argo_loader.profile(6902755, 12).to_xarray()
print(ds)
<xarray.Dataset>
Dimensions: (N_POINTS: 107)
Coordinates:
LATITUDE (N_POINTS) float64 63.68 63.68 63.68 ... 63.68 63.68 63.68
* N_POINTS (N_POINTS) int64 0 1 2 3 4 5 6 ... 101 102 103 104 105 106
LONGITUDE (N_POINTS) float64 -28.81 -28.81 -28.81 ... -28.81 -28.81
TIME (N_POINTS) datetime64[ns] 2018-10-19T23:52:00 ... 2018-1...
Data variables:
CYCLE_NUMBER (N_POINTS) int64 12 12 12 12 12 12 12 ... 12 12 12 12 12 12
DATA_MODE (N_POINTS) <U1 'R' 'R' 'R' 'R' 'R' ... 'R' 'R' 'R' 'R' 'R'
DIRECTION (N_POINTS) <U1 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A' 'A'
PLATFORM_NUMBER (N_POINTS) int64 6902755 6902755 ... 6902755 6902755
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 3.0 4.0 5.0 ... 1.713e+03 1.732e+03
PRES_QC (N_POINTS) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1
PSAL (N_POINTS) float64 34.87 34.87 34.87 ... 34.94 34.94 34.94
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 7.598 7.599 7.602 ... 3.588 3.549 3.536
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://www.ifremer.fr/erddap
Fetched_by: docs
Fetched_date: 2020/08/31
Fetched_constraints: phy_WMO6902755_CYC0012
Fetched_uri: https://www.ifremer.fr/erddap/tabledap/ArgoFloats.n...
history: Variables filtered according to DATA_MODE; Variable...
To fetch data for more than one profile, input them in a list:
[7]:
ds = argo_loader.profile(6902755, [3, 12]).to_xarray()
print(ds)
<xarray.Dataset>
Dimensions: (N_POINTS: 215)
Coordinates:
LATITUDE (N_POINTS) float64 59.72 59.72 59.72 ... 63.68 63.68 63.68
* N_POINTS (N_POINTS) int64 0 1 2 3 4 5 6 ... 209 210 211 212 213 214
LONGITUDE (N_POINTS) float64 -31.24 -31.24 -31.24 ... -28.81 -28.81
TIME (N_POINTS) datetime64[ns] 2018-07-22T00:03:00 ... 2018-1...
Data variables:
CYCLE_NUMBER (N_POINTS) int64 3 3 3 3 3 3 3 3 ... 12 12 12 12 12 12 12
DATA_MODE (N_POINTS) <U1 'R' 'R' 'R' 'R' 'R' ... 'R' 'R' 'R' 'R' 'R'
DIRECTION (N_POINTS) <U1 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A' 'A'
PLATFORM_NUMBER (N_POINTS) int64 6902755 6902755 ... 6902755 6902755
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 3.0 4.0 5.0 ... 1.713e+03 1.732e+03
PRES_QC (N_POINTS) int64 1 1 1 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1
PSAL (N_POINTS) float64 34.76 34.76 34.76 ... 34.94 34.94 34.94
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 8.742 8.743 8.744 ... 3.588 3.549 3.536
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://www.ifremer.fr/erddap
Fetched_by: docs
Fetched_date: 2020/08/31
Fetched_constraints: phy_WMO6902755_CYC0003_CYC0012
Fetched_uri: https://www.ifremer.fr/erddap/tabledap/ArgoFloats.n...
history: Variables filtered according to DATA_MODE; Variable...