dctools.data.connection.connection_manager.CMEMSManager
- class dctools.data.connection.connection_manager.CMEMSManager(connect_config, call_list_files=True, do_logging=True)
Class to manage Copernicus Marine downloads.
- Parameters:
connect_config (BaseConnectionConfig)
call_list_files (bool | None)
do_logging (bool | None)
- __init__(connect_config, call_list_files=True, do_logging=True)
Initializes the CMEMS manager and performs connection.
- Parameters:
connect_config (BaseConnectionConfig) – Connection configuration.
call_list_files (bool | None)
do_logging (bool | None)
Methods
__init__(connect_config[, call_list_files, ...])Initializes the CMEMS manager and performs connection.
adjust_full_day(date_start, date_end)Adjust date_end to cover a full day if dates are the same at midnight.
Login to Copernicus Marine.
download_file(remote_path, local_path)Download a file from the remote source to the local path.
estimate_resolution(ds, coord_system)Estimate resolution from dataset based on coordinates.
extract_global_metadata()Extract global metadata (common to all files) from a single file.
extract_metadata(path)Extract metadata combining global/file-specific info.
extract_metadata_worker(path, ...[, argo_index])Extract metadata combining global/file-specific info.
get_config_clean_copy()Return a clean copy of the configuration.
get_global_metadata()Get global metadata for all files in the connection manager.
List files in the Copernicus Marine directory.
list_files_with_metadata()Version with integrated Dask client and optimized configuration.
open(path[, mode])Open a file, prioritizing local then remote access.
open_local(local_path)Open a file locally if it exists.
open_remote(dt[, mode])Open a file remotely from CMEMS using a date.
set_global_metadata(global_metadata)Sets the global metadata for the connection manager.
supports(path)Check if the given path is supported by CMEMS.
- cmems_login()
Login to Copernicus Marine.
- Return type:
None
- list_files()
List files in the Copernicus Marine directory.
- Return type:
List[str]
- open_remote(dt, mode='rb')
Open a file remotely from CMEMS using a date.
- Parameters:
dt (str) – Date string in ISO format (YYYY-MM-DDTHH:MM:SS).
mode (str) – Mode to open the file (default is “rb”).
- Returns:
Opened dataset, or None if remote opening fails.
- Return type:
Optional[xr.Dataset]
- classmethod supports(path)
Check if the given path is supported by CMEMS.
- Parameters:
path (str) – Path to check.
- Returns:
True if the path is supported, False otherwise.
- Return type:
bool