Skip to content

A MATLAB toolbox for interacting with bulk freely-available oceanographic data.

License

Notifications You must be signed in to change notification settings

lnferris/ocean_data_tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

84697805-c6f34c00-af1c-11ea-8492-717a562113af

ocean_data_tools

GitHub license GitHub stars GitHub forks GitHub issues

Copyright (c) 2020 lnferris

ocean_data_tools simplifies the process of extracting, formatting, and visualizing freely-available oceanographic data. While there is a wealth of oceanographic data accessible online, some end-users may be dissuaded from utilizing this data due to the overhead associated with batch downloading it and formatting it into usable data structures. ocean_data_tools solves this problem by allowing the user to transform common oceanographic data sources into uniform structs, call generalized functions on these structs, easily perform custom calculations, and make graphics.

Find a bug, have a question, or want to contribute? Open an issue or email lnferris@alum.mit.edu.

Dependencies

nctoolbox

Getting Started

  1. Download bathymetry.
  2. Download nctoolbox. Run the command setup_nctoolbox at the beginning of a MATLAB session.
  3. Run each demonstration in demos/demos.m, which contains example usages for all functions. All required tests data is included in data/.

Functions are named using a two-part system. The prefix (argo_, bathymetry_, general_, etc.) indicates the appropriate data source, while the suffix (\_build, \_profiles, \_section, etc.) indicates the action performed. Functions with the \_build suffix load raw data into uniform structs (e.g. argo, cruise, hycom, mercator, woa, wod). Uniform structs created by \_build functions are compatable with any general_ function, as well as functions in the Gibbs-SeaWater (GSW) Oceanographic Toolbox.

Main functions are located in ocean_data_tools/. Demonstrations are located in demos/. Test datas are located in data/. Shell scripts for batch downloading data are located in shell_scripts/. While shell scripts can be run directly in a macOS Terminal, running them in Windows requires Cygwin or similar. Python syntax examples are located in python/, which may be grow to become a module in the future.

Getting Data

argo

Download Argo data directly from GDAC FTP servers using either the Coriolis selection tool, or the US GDAC. See the Argo User's Manual for more information.

Alternatively run shell_scripts/download_argo to download data via File Transfer Protocol.

bathymetry

To get bathymetry data (for bathymetry_dir), download Smith & Sandwell under Global Topography V19.1 in netcdf form (topo_20.1.nc).

mocha

The url for MOCHA Mid-Atlantic Bight climatology is embedded. See Rutgers Marine catalog.

model

For HYCOM, download subsetted data directly using NCSS. Get the data url by visiting the HYCOM website. For example, click Access Data Here -> GLBv0.08/expt_57.7 (Jun-01-2017 to Sep-30-2017)/ -> Hindcast Data: Jun-01-2017 to Sep-30-2017. Click on the NetcdfSubset link. Set constraints and copy the NCSS Request URL at the bottom of the page. Run shell_scripts/download_hycom_lite. To download multiple months or years, run shell_scripts/download_hycom_bulk_daily (partition files by day) or shell_scripts/download_hycom_bulk_monthly (partition files by month). Please use responsibly.

For Mercator, download Copernicus Marine data directly from FTP servers. First make a Copernicus account. Use the selection tool to download GLOBAL_ANALYSIS_FORECAST_PHY_001_024. Alternatively run shell_scripts/download_mercator. Before running the script, follow the instructions for modifying your ~/.netrc file in the comments of the script.

whp_cruise

For GO-SHIP data, get CTD data (for ctdo_dir) by choosing a GO-SHIP cruise and downloading the CTD data in whp_netcdf format. More information about whp_netcdf parameters is available here. Get LADCP data (for uv_dir, wke_dir) here. There is information about LACDP processing here.

woa

Functions build the World Ocean Atlas url at maximum resolution based on arguments, but coarser resolutions and seasonal climatologies are available at the NODC website. Note NCEI is scheduled to update data urls in the near future. Functions will be updated as such.

wod

Search the World Ocean Database and select products.

Contents

Building uniform structs from data sources

argo_build searches the locally-stored Argo profiles matching the specified region & time period and builds a uniform struct

mocha_build_profiles builds a uniform struct of profiles from the MOCHA Mid-Atlantic Bight climatology

model_build_profiles builds a uniform struct of profiles from HYCOM or Operational Mercator CMEMS GLOBAL_ANALYSIS_FORECAST_PHY_001_024

demo1

whp_cruise_build builds a uniform struct of profiles from GO-SHIP cruise data in WHP-Exchange Format

woa_build_profiles builds a uniform struct of profiles from World Ocean Atlas 2018 Statistical Mean for All Decades, Objectively Analyzed Mean Fields

wod_build builds a uniform struct of profiles from World Ocean Database data

General functions for subsetting and plotting uniform structs

general_depth_subset subsets a uniform struct by depth

general_map plots coordinate locations in a uniform struct, with optional bathymetry contours

general_profiles plots vertical profiles in a uniform struct

general_region_subset subsets a uniform struct by polygon region

Screen Shot 2020-07-22 at 23 54 52

general_remove_duplicates removes spatially (or spatially and temporally) non-unique profiles from a uniform struct

general_section plots a data section from a uniform struct

Plotting gridded data without building structs

mocha_domain_plot plots a 3-D domain from the MOCHA Mid-Atlantic Bight climatology

mocha_simple_plot plots a 2-D layer from the MOCHA Mid-Atlantic Bight climatology

model_domain_plot plots a 3-D domain from HYCOM or Operational Mercator CMEMS GLOBAL_ANALYSIS_FORECAST_PHY_001_024

model_simple_plot plots a 2-D layer from HYCOM or Operational Mercator CMEMS GLOBAL_ANALYSIS_FORECAST_PHY_001_024

model_simple_plot-hycom

woa_domain_plot plots a 3-D domain from World Ocean Atlas 2018 Statistical Mean for All Decades, Objectively Analyzed Mean Fields

woa_simple_plot plots a 2-D layer from World Ocean Atlas 2018 Statistical Mean for All Decades, Objectively Analyzed Mean Fields

Adding bathymetry to existing plots

bathymetry_chord adds a slice of Smith & Sandwell Global Topography to a section plot

bathymetry_extract extracts a region of Smith & Sandwell Global Topography and outputs as arrays

bathymetry_plot adds bathymetry to 2-D (latitude vs. longitude) or 3-D (latitude vs. longitude vs. depth) data plots

Eby2o8-XsAASaSA

bathymetry_region finds the rectangular region around a uniform struct to pass as an argument for other bathymetry functions

bathymetry_section adds Smith & Sandwell Global Topography to a section from plot using bathymetry data nearest to specified coordinates

bathymetry_section

Additional functions for inspecting Argo data

argo_platform_map plots locations of Argo profiles in a uniform struct, coloring markers by platform (individual Argo float)

argo_platform_map

argo_platform_subset subsets a uniform struct of Argo data to one platform (individual Argo float)

argo_profiles_map plots coordinate locations of Argo profiles in uniform struct argo, using colors corresponding to argo_profiles called on the same struct

argo_profiles plots vertical Argo profiles in uniform struct argo, using colors corresponding to argo_profiles_map called on the same struct

Miscellaneous utilities

netcdf_info gets information about the first netcdf file in a path and saves it to a text file

region_select creates coordinate list (which represents vertices of a polygon region) by clicking stations on a plot

transect_select creates a coordinate list (which represents a virtual transect) by clicking stations on a plot

Screen Shot 2020-07-22 at 23 50 25