Skip to content

update cmems insitu from FTP to copernicusmarine files service #817

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

Closed
4 tasks done
veenstrajelmer opened this issue Apr 9, 2024 · 0 comments · Fixed by #818
Closed
4 tasks done

update cmems insitu from FTP to copernicusmarine files service #817

veenstrajelmer opened this issue Apr 9, 2024 · 0 comments · Fixed by #818

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Apr 9, 2024

Update 8-4-2024: ftp was discontinued, so we have to use an alternative.

Subset is still not yet possible for insitu, only direct download from website. When trying import copernicusmarine; copernicusmarine.open_dataset(dataset_id="cmems_obs-ins_glo_phy-ssh_my_na_PT1H"), this currently (9-4-2024) raises: "NoServiceAvailable: No service available for dataset with command load"

However, we can use the copernicusmarine "files" service:

import copernicusmarine
import dfm_tools as dfmt
# dfmt.download.copernicusmarine_reset()

copernicusmarine.get(
dataset_id="cmems_obs-ins_glo_phy-ssh_my_na_PT1H",
service="files",
filter="*BO_TS_TG_Dragor_60minute.nc",
# filter="*index_history.txt",
output_directory=".",
overwrite_output_data=True,
# force_download=True,
no_directories=True,
download_file_list=True
)

The index_history.txt file is found with the index_parts=True argument:

copernicusmarine.get(
dataset_id="cmems_obs-ins_glo_phy-ssh_my_na_PT1H",
service="files",
# filter="*BO_TS_TG_Dragor_60minute.nc",
filter="*index_history.txt",
index_parts=True,
output_directory=".",
overwrite_output_data=True,
# force_download=True,
no_directories=True,
)

Todo:

  • also requires a higher copernicusmarine version (1.1.0 works), so update pyproject.toml
  • move to this copernicusmarine files service
  • simplify dfmt.copernicusmarine_credentials() (no need to return user/pass anymore)
  • update whatsnew.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant