Skip to content

Commit 7a59a4a

Browse files
committed
Add example CLI and OceanDataCatalog usage to README.md.
1 parent 30404b1 commit 7a59a4a

1 file changed

Lines changed: 30 additions & 4 deletions

File tree

README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,41 @@ pip install git+https://github.com/NOC-MSM/OceanDataStore.git
2020

2121
**Note:** we strongly recommend installing **OceanDataStore** into a new virtual environment using either ``venv`` or ``conda / mamba``.
2222

23-
## Documentation
23+
## Examples
2424

25-
To learn more about OceanDataStore, click [**here**](https://noc-msm.github.io/OceanDataStore/) to explore the documentation.
25+
### Writing Ocean Model Data to the Cloud...
2626

27-
## Examples
27+
* To create a new Zarr store in an S3-compatible object store using a large number of files, we can use [dask](https://www.dask.org) with the `send_to_zarr` command:
28+
29+
```bash
30+
ods send_to_zarr -f /path/to/files*.nc -c credentials.json -b bucket_name -p prefix \
31+
-gf /path/to/domain_cfg.nc -uc '{"lon":"lon_new", "lat":"lat_new"}' \
32+
-cs '{"x":2160, "y":1803}' -dc dask_config.json -zv 3
33+
```
2834

2935
For examples of how to implement the commands in **OceanDataStore CLI** in your own workflows, see the bash scripts in the `examples` directory.
3036

31-
## OceanDataStore CLI Arguments
37+
### Accessing Ocean Data in the Cloud...
38+
39+
* To access monthly-mean sea surface temperature data from the NOC Near-Present Day eORCA1 ERA5v1 (1-degree) global ocean sea-ice hindcast between 2004-2010 as an `xarray.Dataset`:
40+
41+
```python
42+
# Initialise default NOC STAC:
43+
catalog = OceanDataCatalog(catalog_name="noc-stac")
44+
45+
# Open ocean model data as xarray.Dataset:
46+
catalog.open_dataset(id="noc-npd-era5/npd-eorca1-era5v1/r1i1c1f1/gn/T1m",
47+
variable_names=["tos_con"]
48+
start_datetime='2004-01',
49+
end_datetime='2008-12',
50+
)
51+
```
52+
53+
## Documentation
54+
55+
To learn more about OceanDataStore, click [**here**](https://noc-msm.github.io/OceanDataStore/) to explore the documentation.
56+
57+
## OceanDataStore CLI Reference
3258

3359
### Mandatory Arguments
3460

0 commit comments

Comments
 (0)