MATLAB
The oceanum-matlab library provides read-only access to the Oceanum Datamesh from MATLAB and GNU Octave.
Requirements
Section titled “Requirements”- MATLAB R2022b or later
- GNU Octave 6.0+ (also supported)
Installation
Section titled “Installation”The Oceanum toolbox is available form the Mathworks community file exchange. Or download/clone from the Github repository
addpath('/path/to/oceanum-matlab');Authentication
Section titled “Authentication”Set your Datamesh token as an environment variable:
setenv('DATAMESH_TOKEN', 'your-token-here');Quick Start
Section titled “Quick Start”Connect to the Datamesh
Section titled “Connect to the Datamesh”% Initialize connectorconnector = oceanum.datamesh.Connector();
% Browse the catalogcatalog = connector.get_catalog();disp(catalog);
% Search for datasetsresults = connector.get_catalog('wave');Load Data
Section titled “Load Data”% Load a datasourcedata = connector.load_datasource('datasource-id');
% Execute a query with filtersquery_input = struct(... 'datasource', 'datasource-id', ... 'limit', 1000 ...);result = connector.query(query_input);Work with NetCDF
Section titled “Work with NetCDF”% Load as NetCDF structurenc_data = connector.load_datasource('datasource-id', 'format', 'netcdf');Main Classes
Section titled “Main Classes”| Class | Description |
|---|---|
Connector | Primary API communication interface |
Catalog | Dataset discovery and searching |
Datasource | Individual datasource metadata |
Query | Advanced filtering capabilities |
Stage | Query staging information |
Session | Automatic session handling |
Features
Section titled “Features”- Catalog browsing - Search and discover datasets
- Data loading - Load datasources as MATLAB tables or NetCDF structures
- OceanQL queries - Filter by space, time, and variables
- Query size limits - Automatic error messaging for large queries
- Session management - Automatic authentication handling
Limitations
Section titled “Limitations”Compared to the Python library, the MATLAB version:
- Read-only access (no write operations)
- Synchronous operations only
- Limited format support
- No lazy loading capabilities
Documentation
Section titled “Documentation”The API mirrors the Python library. For detailed guidance, refer to the Python documentation.