What would be an Argo float object in python and the associated methods/attributes ?
Must be possible to point toward all possible GDAC hosts
from argopy import ArgoFloat
# Expected API
WMO = 6903091
# Create an instance using the float WMO:
af = ArgoFloat(WMO) # Use argopy 'gdac' option by default
af = ArgoFloat(WMO, host='/home/ref-argo/gdac') # Use your local GDAC copy
af = ArgoFloat(WMO, host='https') # Shortcut for https://data-argo.ifremer.fr
af = ArgoFloat(WMO, host='ftp') # shortcut for ftp://ftp.ifremer.fr/ifremer/argo
af = ArgoFloat(WMO, host='s3') # Shortcut for s3://argo-gdac-sandbox/pub
Get a dictionary with all available datasets for this float:
af.ls_dataset()
then simply open dataset using any key from the list of available datasets dictionary:
ds = af.open_dataset('prof')
ds = af.open_dataset('meta')
ds = af.open_dataset('tech')
ds = af.open_dataset('Rtraj')
ds = af.open_dataset('Sprof')
af.profiles[1] # Return xarray dataset with data from: profiles/<WMO>_001.nc or profiles/D<WMO>_001.nc # Ascent by default
af.profilesD[1] # Return xarray dataset with data from: profiles/<WMO>_001D.nc or profiles/D<WMO>_001D.nc # Explicitly load descent profile
af.profiles[1] # Return xarray dataset with data from: profiles/R<WMO>_001.nc # Ascent by default
af.profilesD[1] # Return xarray dataset with data from: profiles/R<WMO>_001D.nc # Explicitly load descent profile
af.profilesB[1] # Return xarray dataset with data from: profiles/BR<WMO>_001.nc # Ascent by default
af.profilesBD[1] # Return xarray dataset with data from: profiles/BR<WMO>_001D.nc # Explicitly load descent profile
af.profilesS[1] # Return xarray dataset with data from: profiles/SR<WMO>_001.nc # Ascent by default
af.profilesSD[1] # Return xarray dataset with data from: profiles/SR<WMO>_001D.nc # Explicitly load descent profile
af.index # Return pandas dataframe with <WMO> profile index match (but which index ?)
af.N_CYCLES # Return nb of cycles (not to be confused with profiles)
af.N_LEVELS # Return max nb of vertical levels
af.dac # Return name of the float DAC
af.path # Return Path or url toward the GDAC float folder/bucket
af.json_meta # Return Float json scheme like https://github.com/euroargodev/sensor_metadata_json/blob/main/json_floats/float-SBE-NAVIS_EBR-1101.json
af.params # Return the list of parameters
af.sensors # Return the list of sensors
af.monitor() # Open EuroArgo-Fleet monitoring webpage
af.plot(12) # Open profile webpage like: https://dataselection.euro-argo.eu/cycle/4187022
af.plot(cyc=12) # Open profile webpage like: https://dataselection.euro-argo.eu/cycle/4187022
for float in ArgoIndex().search_lat_lon([lon_min, lon_max, lat_min, lat_max]).iterfloats():
float.WMO # 'float' is a ArgoFloat instance
af = ArgoFloat(WMO)
ds = af.open_dataset('prof')
# Do some stuff on ds
# [...]
af.to_netcdf(ds)
ds.argo.to_netcdf(af, 'updated.nc')