CDIP THREDDS

The CDIP THREDDS server provides access to the wave and temperature datasets collected by each CDIP buoy. The THREDDS NetCDF format is an easily-accessible, powerful tool to bring buoy data directly into a programming language (e.g. MATLAB, Python) for plotting and manipulation. If you are interested in working with CDIP data via one of these programs, see below for further instruction about data access.

To view or download data as a table (e.g. to work with in Excel or a text-editor), you can visit a CDIP station’s Parameter Download page (available as a left-hand menu link on the station’s Data Access page, e.g. https://cdip.ucsd.edu/themes/?d2=p70&u2=s:191:st:1:v:pm_download_table) and click on the desired month-year combination.

THREDDS Data Access Instructions

CDIP THREDDS data are organized into Archive and Realtime folders:

The CDIP website offers graphical displays of buoy data at user-specified time periods. Click here for example plots for visualizing data, with corresponding links to the appropriate CDIP plots, and sample Python-based code that will reproduce the plots.

DATA ACCESS OPTIONS

  1. OPENDAP - provides URL that can be used in Python/Matlab to automatically grab NetCDF file of data from server. Also provides option to download user-specified variables/timeperiods as ASCII or Binary file.
  2. HTTPServer - option to download the whole NetCDF file.
  3. NCML (NetCDF Markup Language) - XML document used to define a CDM dataset, and to allow user to add/delete/change metadata and variables, or combine data from multiple CDM files.
  4. ISO - XML metadata record for each station.
  5. UDDC (Unidata Data Discovery Convention) - tool to determine how well file metadata conforms to list of recommended metadata attributes.
  6. SOS - web service interface which allows querying observations, sensor metadata, and representations of observed features. Defines means to register/remove sensors and insert new sensor observations.


CDIP Plot Examples

Caveats and Disclaimers

The following code is meant for illustrative purposes only. Most of the examples will only work for Datawell mark 3 buoys. For mark 4 buoys, make sure you use the data type time parameter that corresponds to the variable. For example, waveTime for Hs, Tp, Dp and  sstTime for seaSurfaceTemperature. Also, plots using real-time data files (e.g. *_rt.nc) may include bad records. To filter out bad records use this python code. Finally, these examples were developed using python and matlab libraries that are several years old. They may not work with the latest library versions.

Descriptions of wave- and temperature-related plots that CDIP generates, and Python-based examples of how to reproduce these plots.

  1. Wave Height BoxplotBoxplot_Hs.png
  1. Description: A box is plotted for each month of the year that has data. The top and bottom of the black box mark the lower quartile (25% of data values are less than this value) and upper quartile (75% of data values are less than this value), a red line indicates the median, and a green line and green numeric value indicate the mean. The black lines above and below the box (the "whiskers") show the extent of the remaining data within a maximum range of 1.5L, where L is the length in meters from the lower quartile to the upper quartile. Data values that extend beyond the whiskers (the "outliers") are indicated by red crosses.
  2. CDIP example plot: https://cdip.ucsd.edu/themes/?d2=p70&u2=s:093:st:1:v:hs_box_plot:dt:2015
  3. Python-based example code: https://cdip.ucsd.edu/themes/media/docs/documents/html_pages/annualHs_plot.html

  1. Compendium Compendium.png
  1. Description: Plots of significant wave height (Hs), peak period (Tp) and peak direction (Dp) for a single station for a given month on 3 separate plots. The format of this plot is consistent with the original USACE wave parameters plot known as the wave compendium plot. Plotting all 3 parameters simultaneously gives a concise display of the general wave environment for the month.
  2. CDIP example plot: https://cdip.ucsd.edu/themes/?d2=p70&u2=s:093:st:1:v:compendium:dt:201501
  3. Python-based example code: https://cdip.ucsd.edu/themes/media/docs/documents/html_pages/compendium.html
  4. MATLAB-based example code: https://cdip.ucsd.edu/themes/media/docs/documents/html_pages/compendium_matlab.txt

Monthly_Temp.png

  1. Monthly Temperature (Sea Surface Temperature)
  1. Description: The sea temperature plot shows SST data (measured by Datawell Waverider thermistors at the sea surface, near the mooring eye of the buoy) over the entire month. Buoys return one SST value each half hour.
  2. CDIP example plot: https://cdip.ucsd.edu/themes/?d2=p70&u2=s:093:st:1:v:temperature:dt:201501
  3. Python-based example code: https://cdip.ucsd.edu/themes/media/docs/documents/html_pages/temperature.html
  4. MATLAB-based example code: https://cdip.ucsd.edu/themes/media/docs/documents/html_pages/temperature_matlab.txt

  1. Polar Spectrum PolarSpectrum.png
  1. Description: The standard CDIP spectral file is converted into a 2-dimensional frequency/direction spectrum and displayed on a polar coordinate system. The Maximum Entropy Method (MEM) is used to create the 2D spectrum; this gives a narrow directional spectrum that CDIP considers appropriate for swell in the Pacific. The polar plot is useful for identifying individual wave events based on their directions and wave periods.
  2. CDIP example plot: https://cdip.ucsd.edu/themes/?d2=p70&u2=s:093:st:1:v:polar_plot:dt:201501
  3. Python-based example code: https://cdip.ucsd.edu/themes/media/docs/documents/html_pages/polar.html

  1. SpectrumSpectrum.png
  1. Description: A single spectral wave record contains energy density and mean wave direction for each frequency bin (click here for an explanation of a CDIP spectral file). The top frame plots energy density vs. frequency, and the second plots mean wave direction vs. frequency. Note that the x-axis includes a scale for both frequency in Hz (bottom) and period in seconds (top).
  2. CDIP example plot: https://cdip.ucsd.edu/themes/?d2=p70&pb=1&u2=s:100:st:1:v:spectral_plot:dt:202112222300^UTC
  3. Python-based example code: https://cdip.ucsd.edu/themes/media/docs/documents/html_pages/spectrum_plot.html
  4. MATLAB-based example code: https://cdip.ucsd.edu/themes/media/docs/documents/html_pages/spectrum_plot_matlab.txt

  1. Timeseries (xyz direction)Timeseries(xyz).png
  1. Description: Plots the x- (North-South), y- (East-West) and z- (vertical) displacements as calculated by a Datawell Waverider. These timeseries are unedited and may contain spikes and other anomalies. Note: data for xyz directional displacements are only available in individual deployment NetCDF files for each station (not the aggregate ‘historic’ .nc file).
  2. CDIP example plot: https://cdip.ucsd.edu/themes/cdip?d2=p70&pb=1&u2=s:093:st:1:v:xz_plot:dt:201501310627^UTC
  3. Python-based example code: https://cdip.ucsd.edu/themes/media/docs/documents/html_pages/dw_timeseries.html

  1. Wave Histogram
  1. Description: Plots a histogram of the heights of individual waves derived from the vertical (z) displacement timeseries. Individual waves are identified using the crest-to-trough method, i.e. by calculating the crest-to-trough difference (max-min z-displacement) between consecutive zero up-crossings.WaveHistogram.png
  1. For buoys operated by the Navy (e.g. 067, San Nicolas Island), the user can specify a height threshold and the plot will show the percentage of waves that exceed the given threshold (default threshold is 4 m/13 ft).
  1. CDIP example plot: https://cdip.ucsd.edu/themes/cdip?pb=1&bl=cdip?pb=1&d2=p1&d2=p70&u2=s:093:st:1:v:wave_histogram:dt:201501310627^UTC

  1. Period Rose
  1. Description: The data of the selected time period are categorized by peak wave direction and significant wave height. The length of a petal (or a portion of the petal), corresponds to the frequency of occurrence.
  2. CDIP example plot - Period Rose:  https://cdip.ucsd.edu/themes/cdip?d2=p70&pb=1&u2=s:093:st:1:v:period_rose:dt:201501310627^UTC

  1. Wave Rose
  1. Description: The data of the selected time period are categorized by peak wave direction and significant wave height. The length of a petal (or a portion of the petal), corresponds to the frequency of occurrence.
  2. CDIP example plot - Wave Rose: https://cdip.ucsd.edu/themes/cdip?d2=p70&pb=1&u2=s:093:st:1:v:wave_rose:dt:201501310627^UTC



BUOY VARIABLES

How to select the good records

The following python code will select all the good records (FlagPrimary=1) for variable names beginning with “wave”. The same can be done for other variable names beginning with “sst”, “acm” and “cat4” using sstFlagPrimary, acmFlagPrimary and cat4FlagPrimary respectively.

good_waves = ( nc.variables['waveFlagPrimary'][:] == 1 )

Method 1: Produce an array of Hs records whose length equals the number of good records.

good_times = nc.variables['waveTime'][good_waves]

good_hs = nc.variables['waveHs'][good_waves]

Method 2: Set the mask on the original array of Hs. (mask=False indicates a good record).

hs = nc.variables['waveHs'][:]

hs.mask = ~good_waves

This method is appropriate for statistical work when you need to account for missing values.