MATLAB Utilities
This is a listing of various helpful MATLAB scripts and functions.
Time Series Analysis
The Discrete Correlation Function - This function computes the auto- or cross-correlation of irregularly sampled time series (Krolik & Lepp (1988)).
The Discrete Structure Function - This calculates the structure function of an irregularly sampled time series. Also useful for estimating a time delay between two time series as it calculates the RMS difference as a function of lag.
Scintillation - Annual Cycles, Time Delays, etc
Calculates the time delay between the scintillation patterns observed at two telescopes. Now includes the effects of anisotropic scintles.
Coordinate calculators
Some of these scripts make use of functions written by Eran Ofek. He has very kindly released a package of MATLAB ephemeris scripts which can be downloaded from http://wise-obs.tau.ac.il/~eran/MATLAB/Ephem.html
Azimuth/Elevation calculator using mjd time data.
Azimuth/Elevation calculator using UT time data.
Transforms Azimuth/Elevation coordinates to X/Y.
Plotting functions
2D Line plot with colour mapped by a third variable.
Allows errorbars to be plotted in X and Y.
The default errorbar
function in MATLAB uses very wide horizontal bars in plotting the data, making densely sampled data difficult to interpret. This function fixes this by using errorbars as wide as the plotted points.
Designed for use in examining spectral line VLBI spot maps. This function takes a 4D data set (RA, Dec, Velocity & Amplitude), makes a scatterplot of the first two dimensions (RA, Dec). Regions of the image can be selected to view the spectrum.