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.4/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:
TIME (N_POINTS) datetime64[ns] 2011-01-01T11:49:19 ... 2011-05-31T11:34:52
LONGITUDE (N_POINTS) float64 -45.14 -45.14 -51.58 ... -50.4 -50.4
* N_POINTS (N_POINTS) int64 0 1 2 3 4 5 6 ... 992 993 994 995 996 997
LATITUDE (N_POINTS) float64 24.54 24.54 25.04 ... 26.67 24.96 24.96
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:
cdm_altitude_proxy: pres
cdm_data_type: TrajectoryProfile
cdm_profile_variables: cycle_number, data_type, format_version, handb...
cdm_trajectory_variables: platform_number, project_name, pi_name, platfo...
Conventions: Argo-3.1, CF-1.6, COARDS, ACDD-1.3
creator_email: support@argo.net
creator_name: Argo
creator_url: http://www.argo.net/
Easternmost_Easting: -45.006
featureType: TrajectoryProfile
geospatial_lat_max: 29.995
geospatial_lat_min: 20.01
geospatial_lat_units: degrees_north
geospatial_lon_max: -45.006
geospatial_lon_min: -74.37700000000001
geospatial_lon_units: degrees_east
history: 2020-06-24T21:05:11Z (local files)\n2020-06-24...
id: ArgoFloats
infoUrl: http://www.argo.net/
institution: Argo
keywords: adjusted, argo, array, assembly, best, centre,...
keywords_vocabulary: GCMD Science Keywords
license: The data may be used and redistributed for fre...
Northernmost_Northing: 29.995
references: http://www.argodatamgt.org/Documentation
source: Argo float
sourceUrl: (local files)
Southernmost_Northing: 20.01
standard_name_vocabulary: CF Standard Name Table v29
summary: Argo float vertical profiles from Coriolis Glo...
time_coverage_end: 2011-05-31T17:21:23Z
time_coverage_start: 2011-01-01T11:49:19Z
title: Argo Float Measurements
user_manual_version: 3.1
Westernmost_Easting: -74.37700000000001
DATA_ID: ARGO
DOI: http://doi.org/10.17882/42182
Fetched_from: http://www.ifremer.fr/erddap
Fetched_by: docs
Fetched_date: 2020/06/24
Fetched_constraints: phy_[x=-75.00/-45.00; y=20.00/30.00; z=0.0/10....
Fetched_uri: http://www.ifremer.fr/erddap/tabledap/ArgoFloa...
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:
TIME (N_POINTS) datetime64[ns] 2017-07-06T14:49:00 ... 2019-02-13T07:20:00
LONGITUDE (N_POINTS) float64 -60.17 -60.17 -60.17 ... -62.64 -62.64
* N_POINTS (N_POINTS) int64 0 1 2 3 4 5 ... 9034 9035 9036 9037 9038
LATITUDE (N_POINTS) float64 20.08 20.08 20.08 ... 16.3 16.3 16.3
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:
cdm_altitude_proxy: pres
cdm_data_type: TrajectoryProfile
cdm_profile_variables: cycle_number, data_type, format_version, handb...
cdm_trajectory_variables: platform_number, project_name, pi_name, platfo...
Conventions: Argo-3.1, CF-1.6, COARDS, ACDD-1.3
creator_email: support@argo.net
creator_name: Argo
creator_url: http://www.argo.net/
Easternmost_Easting: -56.839999999999975
featureType: TrajectoryProfile
geospatial_lat_max: 24.645
geospatial_lat_min: 13.91
geospatial_lat_units: degrees_north
geospatial_lon_max: -56.839999999999975
geospatial_lon_min: -85.606
geospatial_lon_units: degrees_east
history: 2020-06-24T21:05:00Z (local files)\n2020-06-24...
id: ArgoFloats
infoUrl: http://www.argo.net/
institution: Argo
keywords: adjusted, argo, array, assembly, best, centre,...
keywords_vocabulary: GCMD Science Keywords
license: The data may be used and redistributed for fre...
Northernmost_Northing: 24.645
references: http://www.argodatamgt.org/Documentation
source: Argo float
sourceUrl: (local files)
Southernmost_Northing: 13.91
standard_name_vocabulary: CF Standard Name Table v29
summary: Argo float vertical profiles from Coriolis Glo...
time_coverage_end: 2020-06-17T07:16:00Z
time_coverage_start: 2017-07-06T14:49:00Z
title: Argo Float Measurements
user_manual_version: 3.1
Westernmost_Easting: -85.606
DATA_ID: ARGO
DOI: http://doi.org/10.17882/42182
Fetched_from: http://www.ifremer.fr/erddap
Fetched_by: docs
Fetched_date: 2020/06/24
Fetched_constraints: phy_WMO6902746
Fetched_uri: http://www.ifremer.fr/erddap/tabledap/ArgoFloa...
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: 17108)
Coordinates:
TIME (N_POINTS) datetime64[ns] 2017-07-06T14:49:00 ... 2020-06-21T00:16:00
LONGITUDE (N_POINTS) float64 -60.17 -60.17 -60.17 ... -57.85 -57.85
* N_POINTS (N_POINTS) int64 0 1 2 3 4 ... 17104 17105 17106 17107
LATITUDE (N_POINTS) float64 20.08 20.08 20.08 ... 63.71 63.71 63.71
Data variables:
CYCLE_NUMBER (N_POINTS) int64 1 1 1 1 1 1 1 1 ... 73 73 73 73 73 73 73
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 ... 1.313e+03 1.338e+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.89 34.89 34.89
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.421 3.411 3.41
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:
cdm_altitude_proxy: pres
cdm_data_type: TrajectoryProfile
cdm_profile_variables: cycle_number, data_type, format_version, handb...
cdm_trajectory_variables: platform_number, project_name, pi_name, platfo...
Conventions: Argo-3.1, CF-1.6, COARDS, ACDD-1.3
creator_email: support@argo.net
creator_name: Argo
creator_url: http://www.argo.net/
Easternmost_Easting: -28.733000000000004
featureType: TrajectoryProfile
geospatial_lat_max: 65.042
geospatial_lat_min: 13.91
geospatial_lat_units: degrees_north
geospatial_lon_max: -28.733000000000004
geospatial_lon_min: -85.606
geospatial_lon_units: degrees_east
history: 2020-06-24T21:05:16Z (local files)\n2020-06-24...
id: ArgoFloats
infoUrl: http://www.argo.net/
institution: Argo
keywords: adjusted, argo, array, assembly, best, centre,...
keywords_vocabulary: GCMD Science Keywords
license: The data may be used and redistributed for fre...
Northernmost_Northing: 65.042
references: http://www.argodatamgt.org/Documentation
source: Argo float
sourceUrl: (local files)
Southernmost_Northing: 13.91
standard_name_vocabulary: CF Standard Name Table v29
summary: Argo float vertical profiles from Coriolis Glo...
time_coverage_end: 2020-06-21T00:16:00Z
time_coverage_start: 2017-07-06T14:49:00Z
title: Argo Float Measurements
user_manual_version: 3.1
Westernmost_Easting: -85.606
DATA_ID: ARGO
DOI: http://doi.org/10.17882/42182
Fetched_from: http://www.ifremer.fr/erddap
Fetched_by: docs
Fetched_date: 2020/06/24
Fetched_constraints: phy_WMO6902746;WMO6902755
Fetched_uri: http://www.ifremer.fr/erddap/tabledap/ArgoFloa...
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:
TIME (N_POINTS) datetime64[ns] 2018-10-19T23:52:00 ... 2018-10-19T23:52:00
LONGITUDE (N_POINTS) float64 -28.81 -28.81 -28.81 ... -28.81 -28.81
* N_POINTS (N_POINTS) int64 0 1 2 3 4 5 6 ... 101 102 103 104 105 106
LATITUDE (N_POINTS) float64 63.68 63.68 63.68 ... 63.68 63.68 63.68
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:
cdm_altitude_proxy: pres
cdm_data_type: TrajectoryProfile
cdm_profile_variables: cycle_number, data_type, format_version, handb...
cdm_trajectory_variables: platform_number, project_name, pi_name, platfo...
Conventions: Argo-3.1, CF-1.6, COARDS, ACDD-1.3
creator_email: support@argo.net
creator_name: Argo
creator_url: http://www.argo.net/
Easternmost_Easting: -28.807000000000016
featureType: TrajectoryProfile
geospatial_lat_max: 63.679
geospatial_lat_min: 63.679
geospatial_lat_units: degrees_north
geospatial_lon_max: -28.807000000000016
geospatial_lon_min: -28.807000000000016
geospatial_lon_units: degrees_east
history: 2020-06-24T21:05:02Z (local files)\n2020-06-24...
id: ArgoFloats
infoUrl: http://www.argo.net/
institution: Argo
keywords: adjusted, argo, array, assembly, best, centre,...
keywords_vocabulary: GCMD Science Keywords
license: The data may be used and redistributed for fre...
Northernmost_Northing: 63.679
references: http://www.argodatamgt.org/Documentation
source: Argo float
sourceUrl: (local files)
Southernmost_Northing: 63.679
standard_name_vocabulary: CF Standard Name Table v29
summary: Argo float vertical profiles from Coriolis Glo...
time_coverage_end: 2018-10-19T23:52:00Z
time_coverage_start: 2018-10-19T23:52:00Z
title: Argo Float Measurements
user_manual_version: 3.1
Westernmost_Easting: -28.807000000000016
DATA_ID: ARGO
DOI: http://doi.org/10.17882/42182
Fetched_from: http://www.ifremer.fr/erddap
Fetched_by: docs
Fetched_date: 2020/06/24
Fetched_constraints: phy_WMO6902755_CYC0012
Fetched_uri: http://www.ifremer.fr/erddap/tabledap/ArgoFloa...
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:
TIME (N_POINTS) datetime64[ns] 2018-07-22T00:03:00 ... 2018-10-19T23:52:00
LONGITUDE (N_POINTS) float64 -31.24 -31.24 -31.24 ... -28.81 -28.81
* N_POINTS (N_POINTS) int64 0 1 2 3 4 5 6 ... 209 210 211 212 213 214
LATITUDE (N_POINTS) float64 59.72 59.72 59.72 ... 63.68 63.68 63.68
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:
cdm_altitude_proxy: pres
cdm_data_type: TrajectoryProfile
cdm_profile_variables: cycle_number, data_type, format_version, handb...
cdm_trajectory_variables: platform_number, project_name, pi_name, platfo...
Conventions: Argo-3.1, CF-1.6, COARDS, ACDD-1.3
creator_email: support@argo.net
creator_name: Argo
creator_url: http://www.argo.net/
Easternmost_Easting: -28.807000000000016
featureType: TrajectoryProfile
geospatial_lat_max: 63.679
geospatial_lat_min: 59.723
geospatial_lat_units: degrees_north
geospatial_lon_max: -28.807000000000016
geospatial_lon_min: -31.235000000000014
geospatial_lon_units: degrees_east
history: 2020-06-24T21:05:20Z (local files)\n2020-06-24...
id: ArgoFloats
infoUrl: http://www.argo.net/
institution: Argo
keywords: adjusted, argo, array, assembly, best, centre,...
keywords_vocabulary: GCMD Science Keywords
license: The data may be used and redistributed for fre...
Northernmost_Northing: 63.679
references: http://www.argodatamgt.org/Documentation
source: Argo float
sourceUrl: (local files)
Southernmost_Northing: 59.723
standard_name_vocabulary: CF Standard Name Table v29
summary: Argo float vertical profiles from Coriolis Glo...
time_coverage_end: 2018-10-19T23:52:00Z
time_coverage_start: 2018-07-22T00:03:00Z
title: Argo Float Measurements
user_manual_version: 3.1
Westernmost_Easting: -31.235000000000014
DATA_ID: ARGO
DOI: http://doi.org/10.17882/42182
Fetched_from: http://www.ifremer.fr/erddap
Fetched_by: docs
Fetched_date: 2020/06/24
Fetched_constraints: phy_WMO6902755_CYC0003_CYC0012
Fetched_uri: http://www.ifremer.fr/erddap/tabledap/ArgoFloa...