Skip to main content

OCSTrack: Ocean-Model-Data Collocation Tools

CI PyPI version codecov Pylint Score License: CC0-1.0

OCSTrack is an object-oriented Python package for the along-track collocation of satellite (2D) and Argo Float (3D) data with ocean circulation and wave model outputs. It simplifies the process of aligning diverse datasets, making it easier to compare and validate model simulations against observational data.


Key Features

  • Automated Data Fetching: Downloads satellite altimetry and Argo float data from public repositories.
  • Model Support: Natively handles outputs from SCHISM (and WWM), ADCIRC, SWAN, and WW3 models.
  • Flexible Collocation: Performs temporal and spatial collocation for both 2D surface tracks and 3D profiles.
  • Efficient & Scalable: Uses xarray and dask for efficient, out-of-core computations on large datasets.
  • Customizable: Object-oriented design makes it easy to extend support for new models or observational data types.

Installation

You can install OCSTrack directly from PyPI:

pip install ocstrack

To install the latest development version directly from this repository:

pip install git+https://github.com/noaa-ocs-modeling/OCSTrack.git

Optional dependencies

OCSTrack has two sets of optional extras:

Extra Packages installed When you need it
gsw gsw Accurate pressure-to-depth conversion for Argo 3D collocation. Without it, a simple linear approximation (dbar × -1.0197) is used instead.
geo shapely, geopandas Required only if you use crop_by_shape() to mask satellite data with a polygon or shapefile.
all all of the above Install everything at once.
# Accurate depth conversion for Argo data
pip install "ocstrack[gsw]"

# Shapefile/polygon cropping support
pip install "ocstrack[geo]"

# Everything
pip install "ocstrack[all]"

Quick Start

Here is a minimal example of how to collocate satellite altimetry data with a SCHISM model run.

from ocstrack import Collocate
from ocstrack.Model import SCHISM
from ocstrack.Observation import Satellite

# 1. Define time range and region of interest
start_date = '2021-05-01'
end_date = '2021-05-05'
bbox = [-76, 34, -72, 38]  # [lon_min, lat_min, lon_max, lat_max]

# 2. Initialize the Model object
# This assumes a SCHISM run directory with standard outputs
schism_run_dir = '/path/to/your/schism/run/'
model = SCHISM(schism_run_dir, start_date=start_date, end_date=end_date)

# 3. Initialize the Observation object
sat_name = 'sentinel-3a' # Example satellite
observation = Satellite(sat_name, start_date=start_date, end_date=end_date, bbox=bbox)

# 4. Create a Collocation object and run the analysis
collocator = Collocate(model, observation)
collocated_dataset = collocator.run(output_path='collocated_data.nc')

print("Collocation complete!")
print(collocated_dataset)

Documentation

For more detailed examples and the full API reference, please see our documentation website:

https://noaa-ocs-modeling.github.io/OCSTrack/

Contributing

We welcome contributions! If you have ideas for new features, find a bug, or would like to improve the documentation, please open an issue or submit a pull request.

License

This project is licensed under the terms of the CC0 1.0 Universal license. See the LICENSE.txt file for details.

How to Cite

If you use OCSTrack for 3D collocation with Argo floats, please cite:

Cassalho, F., S. Mani, S. Moghimi, F. Ye, and Y. J. Zhang. "OCSMesh and an automated creek-to-ocean mesh generation workflow." Ocean Modelling 203 (2026): 102774. https://doi.org/10.1016/j.ocemod.2026.102774.

If you use OCSTrack for 2D collocation with satellite altimetry, please cite:

Cassalho, F., A. L. Kurapov, S. Moghimi, S. M. Durski, J. Y. Zhang, A. Abdolali, et al. "Tidal modulation of waves around the Aleutian Islands." Journal of Geophysical Research: Oceans 131 (2026): e2025JC023780. https://doi.org/10.1029/2025JC023780.


Disclaimer

This repository is a scientific product and is not official communication of the National Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from the use of this GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.

Metadata

Release files for ocstrack 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ocstrack 0.4.2
File Interpreter ABI Platform
ocstrack-0.4.2-py3-none-any.whl Python 3 none any Details

Release files / ocstrack-0.4.2-py3-none-any.whl

Download URL ocstrack-0.4.2-py3-none-any.whl
Size 49.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0be598ccc0f82c1026ad75c036940c07ed9a0a7f86fbbc15c22692b7a3c32c15
BLAKE2b-256 checksum
How to use checksums
ed9c84351441824fd8f1a067c9122627ad248cf20214b3a5bac44a87e4ed248f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page