Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ArgoIndex support for ar_index_global_meta.txt #438

Open
SBS-EREHM opened this issue Feb 8, 2025 · 5 comments · Fixed by #439
Open

Add ArgoIndex support for ar_index_global_meta.txt #438

SBS-EREHM opened this issue Feb 8, 2025 · 5 comments · Fixed by #439
Labels
enhancement New feature or request question Further information is requested

Comments

@SBS-EREHM
Copy link

SBS-EREHM commented Feb 8, 2025

As a sensor vendor, scientists at Sea-Bird Scientific would like to be able to quickly join metadata derived from other indexes (e.g., Profile, Bio-Profile) with metadata from the ar_index_global_meta.txt index.

If wmo is added as a column to index, ar_global_index_prof or ar_bio-profile_index could easily be joined with ar_index_global_meta. For example, this would make it one step easier to retrieve metadata like SENSOR_SERIAL_NUMBER along with profile/trajectory data, or plotting a calibration coefficient vs. date of first profile (cycle=1).

Not asking for a metafile data fetcher at this time, as it looks like the ArgoFloat() will eventually provide this.

@gmaze gmaze added enhancement New feature or request question Further information is requested labels Feb 10, 2025
@gmaze
Copy link
Member

gmaze commented Feb 10, 2025

Hi @SBS-EREHM
thanks for pointing this possible new feature. Would it be possible for you to describe, may be in pseudo-code, what would be a typical use case for this.

I just checked and it looks like it would quite easy to make the meta data index file available in ArgoIndex.

as a complement, the new ArgoFloat provides easy access to any float meta netcdf file:
ArgoFloat(6903091).open_dataset('meta')

and I'm preparing an ArgoIndex float iterator so that something like this would be possible:

for float in ArgoIndex().search_region([...]).iterfloats():
   ds = float.open_dataset('meta')

Does a new search method, on the profiler_type index columns would be useful as well ?

@gmaze gmaze linked a pull request Feb 10, 2025 that will close this issue
@gmaze
Copy link
Member

gmaze commented Feb 11, 2025

don't want to close this too fast

please have a look to #439 providing support for the 'meta' file index with the ArgoIndex

and note that the 'wmo' column is added when exporting with ArgoIndex.to_dataframe()

@gmaze gmaze reopened this Feb 11, 2025
@SBS-EREHM
Copy link
Author

Sorry for the delay. It took me a bit of time to figure out how to install your '438-add-argoindex-support-for-meta-index' branch. Very nice!

Yes, a search method with profiler_type would be useful!

FYI, I did get an error on:

f = argopy.ArgoFloat(3902666) (or f = argopy(host='s3', wmo=3902666) )
d = f.open_dataset('meta')

ValueError: DAC name for Float 3902666 cannot be found from https://data-argo.ifremer.fr. (s3://argo-gdac-sandbox/pub)

@gmaze
Copy link
Member

gmaze commented Feb 13, 2025

awesome !

so let's fix this in #441

@gmaze
Copy link
Member

gmaze commented Feb 13, 2025

the error with the float '3902666' was that the fleet monitoring API was not returning any data !
this is un-expected from the API, but since the float was deployed only 5 days ago, may be it's not in the system yet

anyway, this allowed me to improve the ArgoFloat class to handle such cases. When metadata are not return by the API, they are loaded from the meta file, and the DAC name is obtained from the index

so this should work now, even for float 3902666
(still on the 438-add-argoindex-support-for-meta-index branch)

from argopy import ArgoFloat
ArgoFloat(3902666)

<argofloat.3902666.http.online>
GDAC host: https://data-argo.ifremer.fr/
DAC name: coriolis
Network(s): ['CORE']
Deployment date: 2025-02-08 13:20 [5 days ago]
Float type and manufacturer: ARVOR [NKE]
Number of cycles: 3
Dashboard: https://fleetmonitoring.euro-argo.eu/float/3902666
Netcdf dataset available: ['Rtraj', 'meta', 'prof', 'tech']

note that a new search_profiler_type and search_profiler_label methods available in the ArgoIndex

from argopy import ArgoIndex

idx = ArgoIndex(index_file='meta').load()
idx.search_profiler_type([838, 878])
idx.search_profiler_label('ARVOR')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants