metData = readMetData(fn,fmt,rowIndex)

Reads meteorological data from file in one of three different formats.

fn [string] 
Filename to be read 
fmt [scalar] 
Identifier for the data format. fmt=1 is a CSV file provided by the 14th weather squadron with historical METAR data. fmt=2 (most common) is a text file with data downloaded from (requires CAC) OR one-minute observation data. 
rowIndex [varies] 
Identifier for the data to extract. If a scalar it is the row number (not counting any header rows), if a date (datetime or date vector), will return data from the row with the closest date/time match. If rowIndex is a date vector, it is assumed to be in UTC time. Pass [] to read all data from the file. 
Return Values
Return Values 
metData [struct] 
Structure with fields 
DATE [datetime] 
Date of observation time (Matlab datetime object) 
site [string] 
Site code 
lat [scalar] 
Site latitude (deg decimal) 
lon [scalar] 
Site longitude (deg decimal) 
alt [scalar] 
Site altitude (m MSL) 
temp [scalar] 
Temperature (K) 
dp [scalar] 
Dewpoint (K) 
press [scalar] 
Pressure (Pa) 
rh [scalar] 
Relative humidity (%) 
windSpeed [scalar] 
Wind speed (m/s) 
windDir [scalar] 
Wind direction (deg) 
vis [scalar] 
Visibility (m) 
cloudCond [matrix] 
Observed cloud conditions in a 3x2 matrix. Column 1 holds the fractional cloud coverages at each layer, column 2 holds the cloud layer altitude in ft AGL. 
surfCn2 [scalar] 
Surface Cn2 - NaN if fmt=1 or 2 (m^{-2/3}) 
METAR [string] 
Raw string data from the METAR file 
Made with Doc-O-Matic.
Copyright (c) 2009. All rights reserved.
What do you think about this topic? Send feedback!