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

ORAS5Downloader not working - MOTU client implementation deprecated #270

Open
bnubald opened this issue Jun 4, 2024 · 4 comments
Open
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@bnubald
Copy link
Collaborator

bnubald commented Jun 4, 2024

  • IceNet version: v0.2.8 (will affect all versions with ORAS5Downloader)
  • Python version: 3.11.7

Description

The ORAS5Downloader is currently not working.

The previously used MOTU client interface is no longer supported as of March 2024. See here

Need to transition to the use of Copernicus Marine Toolbox. It looks pretty cool!

What I Did

import pandas as pd

from icenet.data.interfaces.cmems import ORAS5Downloader

import logging
logging.basicConfig(level=logging.INFO)

oras5 = ORAS5Downloader(
    var_names=["thetao", "so", "uo", "vo"],     # Name of variables to download
    dates=[                                     # Dates to download the variable data for
        pd.to_datetime(date).date()
        for date in pd.date_range("2020-01-01", "2020-04-30", freq="D")
    ],
    path="./data",                              # Location to download data to (default is `./data`)
    delete_tempfiles=True,                      # Whether to delete temporary downloaded files
    levels=[None, None, None, None, None],      
    max_threads=4,                              # Maximum number of concurrent downloads
    north=False,                                # Boolean: Whether require data across northern hemisphere
    south=True)                                 # Boolean: Whether require data across southern hemisphere
oras5.download()                                # Start downloading
@bnubald bnubald added the bug Something isn't working label Jun 4, 2024
@bnubald bnubald added this to the v0.2.9 milestone Jun 4, 2024
@bnubald bnubald self-assigned this Jun 4, 2024
bnubald added a commit to bnubald/icenet that referenced this issue Jun 7, 2024
bnubald added a commit to bnubald/icenet that referenced this issue Jun 7, 2024
This is required since MOTU client has become deprecated as of Mar 2024
@bnubald
Copy link
Collaborator Author

bnubald commented Jun 7, 2024

Relates to #49

bnubald added a commit that referenced this issue Jun 7, 2024
Resolves #270 ORAS5Downloader downloader update
@bnubald
Copy link
Collaborator Author

bnubald commented Jun 7, 2024

Above PR fixes issue.

Will leave this issue open, since should use Copernicus's python API instead of CLI as defined in above PR.

@JimCircadian This change should be made to download-toolbox as well.

@bnubald
Copy link
Collaborator Author

bnubald commented Jun 7, 2024

  • Add copernicusmarine to requirements.txt

@bnubald bnubald added the good first issue Good for newcomers label Sep 6, 2024
@bnubald
Copy link
Collaborator Author

bnubald commented Sep 6, 2024

Set as good first issue to move from CLI to Copernicus' Python API

i.e. referring to following commit: 23f9ac2

Not using copernicusmarine command here:

cmd = \
"""copernicusmarine subset \
-i {} \
-x -180 \
-X 179.75 \
-y {} \
-Y {} \
-z 0.5056 \
-Z 0.5059 \
-t '{}T00:00:00' \
-T '{}T00:00:00' \
-v {} \
-o {} \
-f {} \
--username {} \
--password '{}' \
--no-metadata-cache \
--force-download \
""".format(self._dataset,
self.hemisphere_loc[2],
self.hemisphere_loc[0],
req_dates[0].strftime("%Y-%m-%d"),
req_dates[-1].strftime("%Y-%m-%d"),
self._var_map[var],
os.path.split(download_path)[0],
os.path.split(download_path)[1],
self._creds['username'],
self._creds['password']
)
cmd = " ".join(cmd.split())

But, the Python API instead - would be cleaner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant