matlab_routines for use with NetCDF files downloaded from this site

This page provides matlab routines for use with NetCDF files produced by "Process and Export Data as NetCDF" function on this web site. These routines require installation of the matlab functions to read NetCDF files. Download links: MexNC and the NetCDF Toolbox. Additional information on individual routines can be obtained with matlab help request (eg. help readahsrl).

readahsrl.m

This routine reads a NetCDF file produced by "Process and Export Data as NetCDF" and places the result in a matlab structure. A altitude-time subsection of the file may be selected if desired. Calling sequence: [rs]=readahsrl(filename) for the full file or [rs]=readahsrl(filename, start_time_string, end_time_string, min_alt, max_alt) for a subsection of the file. The times are entered as matlab date strings and the altitudes in kilometers.
download readahsrl.m

showahsrl.m

This routine produces the set of plots displayed by "Process and Export Data as NetCDF". Calling sequence: showahsrl(rs,[apply_masks,fig1]) where rs is the structure created by [rs]=readahsrl, apply_masks is optional if = 0 or missing mask bits in qc_mask are not applied to the images, if apply_masks=1 the masked pixels of the image will be grey. fig1 is the MATLAB figure number of the first figure (this is also optional).
download showahsrl.m

make_data_quality_mask.m

This routine addes a mask array "qc_mask" to the structure generated by readahsl.m. This is the code executed by the data quality masking section of the "Process and Export Data as NetCDF" page. qc_mask has the same dimensions as the lidar and radar data arrays. The user must supply threshold values in the MATLAB sturcture qc_params. This routine provides data quality screening. Data arrays other than rs.qc_mask are not affected by this routine. The user may apply the mask bits as needed. Calling sequence: [rs] = make_data_quality_mask(rs,qc_params,[show_masks]); Execute help make_data_quality_mask for a description of the structure qc_params. Data Quality Masking provides additional information.
download make_data_quality_mask.m

rti_fig.m

rti_fig.m is the routine that generates altitude vs time images on this web site. A 2-dimensional data array, d(t,z), with a vertical axis of altitude, z, and a horizontal axis of time, t, is plotted along with a color bar. Data may be plotted in with linear or logrithmic scaling. Execute "help rti_fig.m" for the calling sequence. The following example generates a image of the lidar backscatter cross section from data in the structure "rs":
rti_fig(rs.beta_a_backscat,rs.mean_times,[0 15000],[1e-8 1e-5],'Backscatter cross section','1/(m sr)','gg',1)
download rti_fig.m

additional support scripts

These scripts are used within the above scripts, and are necessary for them to execute properly.
netcdfattr2struct.m
frost_point.m
corneranno.m
extract_qc_bits.m
Edwin Eloranta
Last modified: Wed Jul 6 11:09:31 CDT 2011