icenet-ai / icenet

The icenet library is a pip installable python package containing the commands and code you need to produce forecasts
MIT License
20 stars 6 forks source link

ORAS5Downloader not working - MOTU client implementation deprecated #270

Open bnubald opened 1 month ago

bnubald commented 1 month ago

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 commented 1 month ago

Relates to #49

bnubald commented 1 month ago

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 commented 1 month ago