Skip past header information
USGS - science for a changing world

U.S. Geological Survey Data Series 74, Version 3.0

Long-Term Oceanographic Observations in Massachusetts Bay, 1989-2006


MATLAB M-Files

Skip past contents information

The plots and statistical analyses in this report were produced using MATLAB software, created by Mathworks (www.mathworks.com). Plots were converted to tagged PDF format using Adobe (www.adobe.com) Acrobat. This code was designed to run on MATLAB R2008a with NetCDF installed. See Montgomery and others (2008) for information on how to install NetCDF. These programs are available from the source forge web site.

Although these MATLAB M-files have been used by the USGS, no warranty, expressed or implied, is made by the USGS or the United States Government as to the accuracy and functioning of the program and related program material, nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.

Note that in general the plotting commands require the desired output directory (“plotDirectory”), the MATLAB data file containing the concatenated time series at each site (“concatData”), and (or) the folder containing the Excel files delineating which files are included in the concatenation series (“concatFolder”).  Some programs also require a list of the years (“theYears”) and (or) the site (“A” or “B”) for which data should be plotted.  See individual file comments for more details.

m-files listed below (zipped folder)
Additional m-files called (zipped folder)

adcp_contour: Creates the contour plots of the ADCP data from all depths. (See Time-Series Plots.)

adcp_contour_rotated:  Creates the contour plots of the ADCP data from LT-B, with current split into along-shore and cross-shore components.  (See Time-Series Plots.)

adcp_ell_plots: Creates the plots of the principal axes data by month for the ADCP. (See Mean Flow.)

adcp_ell_tables: Creates tables of the principal axes data by month for the ADCP. (See Principal Axes.)

adcp_scat_plots: Creates scatter plots of the principal axes data for the ADCP. (See Scatter Plots.)

adcp_vpv: Converts the ADCP current data into .vel files for use with the USGS Velocity Profile Viewer. (See Time-Series Plots.)

adcp_whisk: Creates whisker plots of the ADCP data from select depths. (See Time-Series Plots.)

add_right_ticks:  Adds a plot boundary box and ticks on the right y-axis (does not add upper x-axis ticks, as opposed to MATLAB’s “box on” command).

anglextocompass: Converts angles measured in degrees counterclockwise from east to degrees clockwise from north.

archive_mblt: Scans the data directories and creates a MATLAB file containing information about the data files.

archivedirectory_for_table:  A subcall of archive_mblt.

attn: Creates plots of the beam attenuation data. (See Time-Series Plots.)

binsort: A subcall of sort_currents.m.

compare_ell_plots:  Creates plots comparing the principal axes data for sites LT-A and LT-B.  (See Mean Flow.).

compare_sites: Creates plots comparing the monthly mean and variability of wind stress, surface current at LT-A and LT-B, and standard deviation of pressure. (See Time-Series Plots.)

concatenate_files:  Creates the MATLAB (.mat) file containing concatenated time-series of data for LT-A and LT-B.  (See Digital Data Files and Concatenated Data.)

data_available_plots_wconcat:  Creates plots of the data available, indicating with asterisks which files are used in the concatenated series.  (See Overview of Data Set.)

data_available_table:  Creates tables of the data available.  (See Overview of Data Set.)

mblt_windstress: Calculates the wind stress from NOAA Buoy 44013 wind speed data.

mixed_plot_a: Creates a plot of significant wave height, beam attenuation, sediment-trapping rate, current speed, and bottom pressure from LT-A. (See Time-Series Plots.)

mixed_plot_b:  Creates a plot of significant wave height, sediment-trapping rate, and current speed from LT-B.  (See Time-Series Plots.).

monthly_stats: Calculates the monthly statistics of meteorological and oceanographic observations. (See Statistics.)

monthly_stats2: Continuation of "monthly_stats.m," which was becoming large and unwieldy; creates plots for ADCP and wind-0stress observations. (See Statistics.)

monthly_stats_rivers: Calculates the monthly statistics of streamflow observations. (See Statistics.)

monthly_stats_sed: Calculates the monthly statistics of sediment-trapping rate. (See Statistics.)

pcm_ell_plots: Creates the plots of the principal-axes data by month for the point current meters. (See Mean Flow.)

pcm_ell_tables: Creates the tables of the principal-axes data by month for the point current meters. (See Principal Axes.)

pcm_scat_plots: Creates scatter plots of the principal-axes data for the point current meters. (See Scatter Plots.)

pcm_whisk: Creates whisker plots of the point current meter data. (See Time-Series Plots.)

pres_plot: Creates plots of the pressure data. (See Time-Series Plots.)

river_ts: Creates plots of the salinity, temperature, and streamflow data. (See Time-Series Plots.)

rotate_current:  Rotates current data to give components along a specified direction.

show_filters: Plots the filter weights for the PL33 low-pass filter and plots the filter in frequency space. (See Data Processing.)

singlejd: Converts two component julian date measurements into one component julian date.

smart_interp: A data-interpolation routine modified from the Mathworks "interp1.m" command. This code separates the data into pieces based on gaps in the original time series to prevent linear interpolation over large data gaps.

sort_currents: Sorts currents into speed and direction using binsort.m. (See Currents Sorted By Speed and Direction.)

tides: Performs all of the tidal analyses. (See Tidal Analysis.)

tstrap_avg_plot:  Creates a plot of the sediment-trapping rate for the time-series sediment traps at LT-A and LT-B, averaged over each deployment.  (See Time-Series Plots.)

tstrap_bottle_plot:  Creates a plot of the sediment-trapping rate for the time-series sediment traps at LT-A and LT-B, depicting each bottle individually.  (See Time-Series Plots.)

tstrap_preserve_plot:  Creates a plot comparing the sediment-trapping rate for the time-series sediment traps at LT-A, comparing results for time periods when two sediments of traps were used with different chemical preservatives.  (See Time-Series Plots.)

tube_trap: Creates plots of the trapping rate from the tube sediment traps by year. (See Time-Series Plots.)

tube_trap_year: Creates plots of the trapping rate from the tube sediment traps from all years. (See Time-Series Plots.)

uvtospdir: Converts U and V components of a vector to speed and direction measured counterclockwise from east.

usgs_plot:  Formats the subplots of a plot for any given year to match USGS visual standards.

value2index: Determines the index of the point in a series numerically closest to a given target value.

weath_plot: Creates plots of various meteorological data. (See Time-Series Plots.)

write_vpv: A subcall of adcp_vpv.

Skip USGS links group

Accessibility FOIA Privacy Policies and Notices

Take Pride in America logo USAGov logo U.S. Department of the Interior | U.S. Geological Survey
End of USGS links group