Accessing Argo data by date using Argopy#

Import the usual suspects:

import xarray as xr
xr.set_options(display_style="html", display_expand_attrs=False);
from matplotlib import pyplot as plt
plt.style.use('default')
import cartopy.crs as ccrs
import argopy
/Users/gmaze/miniconda3/envs/aos/lib/python3.10/site-packages/pyproj/__init__.py:89: UserWarning: pyproj unable to set database path.
  _pyproj_global_context_initialize()

Import argopy and set-up a data fetcher:

from argopy import DataFetcher as ArgoDataFetcher
argo_loader = ArgoDataFetcher(src='argovis', parallel=True)
argo_loader
<datafetcher.argovis> 'No access point initialised'
Available access points: float, profile, region
Backend: argovis (parallel=True)
User mode: standard
Dataset: phy

You can load profiles for a specific date (and domain) using the region access point:

argo_loader.region([-180, 180, -90, 90, 0, 5000, '2020-11-11', '2020-11-12']).load()
argo_loader
/Users/gmaze/miniconda3/envs/aos/lib/python3.10/site-packages/pandas/core/indexes/base.py:6982: FutureWarning: In a future version, the Index constructor will not infer numeric dtypes when passed object-dtype sequences (matching Series behavior)
  return Index(sequences[0], name=names)
<datafetcher.argovis>
Name: Argovis Argo data fetcher for a space/time region
API: https://argovis.colorado.edu
Domain: [x=-180.00/180.00; y=-90.00/90 ... 00.0; t=2020-11-11/2020-11-12]
Backend: argovis (parallel=True)
User mode: standard
Dataset: phy
apDS = argo_loader.data
apDS
<xarray.Dataset>
Dimensions:          (N_POINTS: 339177)
Coordinates:
  * N_POINTS         (N_POINTS) int64 0 1 2 3 4 ... 339173 339174 339175 339176
    TIME             (N_POINTS) datetime64[ns] 2020-11-11T00:08:20 ... 2020-1...
    LATITUDE         (N_POINTS) float64 35.14 35.14 35.14 ... -15.29 -15.29
    LONGITUDE        (N_POINTS) float64 15.69 15.69 15.69 ... -135.0 -135.0
Data variables:
    CYCLE_NUMBER     (N_POINTS) float64 103.0 103.0 103.0 ... 189.0 189.0 189.0
    DATA_MODE        (N_POINTS) object 'R' 'R' 'R' 'R' 'R' ... 'A' 'A' 'A' 'A'
    DIRECTION        (N_POINTS) object 'A' 'A' 'A' 'A' 'A' ... 'A' 'A' 'A' 'A'
    PLATFORM_NUMBER  (N_POINTS) float64 6.904e+06 6.904e+06 ... 5.902e+06
    POSITION_QC      (N_POINTS) float64 1.0 1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
    PRES             (N_POINTS) float64 2.9 3.9 5.1 ... 1.124e+03 1.126e+03
    PSAL             (N_POINTS) float64 38.03 38.03 38.03 38.03 ... nan nan nan
    TEMP             (N_POINTS) float64 22.01 22.02 22.01 ... 3.764 3.752 3.74
    TIME_QC          (N_POINTS) float64 1.0 1.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
Attributes: (7)
argo_loader.plot('trajectory')
(<Figure size 900x540 with 1 Axes>,
 <GeoAxesSubplot:xlabel='longitude', ylabel='latitude'>)
../../_images/5d4527f200693327eaf61522608afef4e50d65f73d9898225ad1037fa59df2ce.png

We can look at the upper 10db temperature values:

temp = apDS.where(apDS['PRES']<10)['TEMP']
temp
<xarray.DataArray 'TEMP' (N_POINTS: 339177)>
array([22.014, 22.017, 22.012, ...,    nan,    nan,    nan])
Coordinates:
  * N_POINTS   (N_POINTS) int64 0 1 2 3 4 ... 339172 339173 339174 339175 339176
    TIME       (N_POINTS) datetime64[ns] 2020-11-11T00:08:20 ... 2020-11-11T2...
    LATITUDE   (N_POINTS) float64 35.14 35.14 35.14 ... -15.29 -15.29 -15.29
    LONGITUDE  (N_POINTS) float64 15.69 15.69 15.69 ... -135.0 -135.0 -135.0
Attributes: (6)
fig, ax = plt.subplots(**{"figsize": (10, 6), "dpi": 90}, subplot_kw={"projection": ccrs.PlateCarree()})
argopy.plotters.latlongrid(ax)
ax.add_feature(argopy.plotters.land_feature, edgecolor="black")
cs = ax.scatter(x=temp['LONGITUDE'], y=temp['LATITUDE'], c=temp, cmap="RdBu_r",vmin=-2, vmax=30, edgecolor='none')
cbar = fig.colorbar(cs, ax=ax, extend='both', orientation='horizontal', shrink=.8, aspect=40)
cbar.set_label(temp.attrs['long_name'])
ax.set_title('Daily top 10db temperature');
../../_images/78aecedc8051c3ca73f5b54fe828811fae9c7252f76a4a5f9a88561c4450837a.png