euroargodev / argopy

A python library for Argo data beginners and experts
https://argopy.readthedocs.io
European Union Public License 1.2
189 stars 41 forks source link

ArgoPy compatibility with EuroArgo data selection #357

Closed ElenaTerzic closed 5 months ago

ElenaTerzic commented 5 months ago

Hi!

I have a question regarding the compatibility of Euro-Argo data downloading (https://dataselection.euro-argo.eu/) options (in Copernicus csv and netCDF or original Argo csv format) with the ArgoPy library?

Is there a way to use the same tools for data manipulation and visualization from argopy with the data that are extracted that way? For example, to convert it to a Pandas data frame format or something similar which could be compatible with the tools from this library?

Thanks in advance!

gmaze commented 5 months ago

Hi @ElenaTerzic

The library cannot "consumed" csv data returned by the https://dataselection.euro-argo.eu/ platform (in fact, we're working on a way to output the platform selection as a code snippet using argopy, see #197 )

The easiest method, is to try to make your data selection and download directly from your code using the argopy datafetcher, no need to go through the https://dataselection.euro-argo.eu/ platform.

If you share some example of data selection you're doing on the web platform, I could help check if we can transform it into a code snippet with argopy

ElenaTerzic commented 5 months ago

Hi @gmaze

Thanks a lot for your reply. I'll try with your suggestion. The snippet could indeed be a very helpful tool.

I downloaded all available T-S data for the Southern Adriatic with 642 cycles in total.

Screenshot 2024-06-05 at 09 49 03

For now I chose the csv format, but netCDF is also fine.

I'll go with data fetcher and see how this works.

Thanks a lot!

Best, E

gmaze commented 5 months ago

ok @ElenaTerzic

you can do such a selection with the region selection end point in argopy: https://argopy.readthedocs.io/en/latest/user-guide/fetching-argo-data/data_selection.html#data-selection-region

it's a rectangular domain, but it's easy to refine it after download Here is a code snippet to download all research quality data for your domain:

from argopy import DataFetcher, ArgoIndex

# Southern Adriatic, surface down to 1000m:
box = [16.2488, 19.8558, 40.6261, 42.8421, 0, 1000]

# Checkout any profiles available in the domain:
idx = ArgoIndex(cache=True).search_lat_lon(box[0:4])
print(idx.N_MATCH)

# Define an Argo set
ArgoSet = DataFetcher(mode='research', ds='phy', cache=True, parallel=True).region(box)

# Download data (takes about 45 secs):
ArgoSet.load()

# Plot float trajectories:
ArgoSet.plot()
Screenshot 2024-06-05 at 10 11 23
# Get data structure as an xarray:
ds = ArgoSet.data

<xarray.Dataset.argo>
This is a collection of Argo points
N_POINTS(240796) ~ N_PROF(1316) x N_LEVELS(998)
# Possibly convert points to profiles:
ds.argo.point2profile()
ElenaTerzic commented 5 months ago

@gmaze , that's excellent, thank you very much!

Best, E