This README_WCv2.txt gives a brief description of the WC v2 data and Matlab codes that correspond to the cuwindcube/WLS7_PTQ github repository. Author: Paul T. Quelet Last Updated: 10 July 2015 For questions and bug fixes, please contact ptquelet@gmail.com -------------------------------- LOCATION OF INSTRUMENTS As of 2 March 2015, the WC16 v2 LiDAR was co-located at the "lidar super-site" at the middle south guy of the Boulder Atmospheric Observatory (BAO): 40.004881N, 105.0039W, 1582msl per Google Earth. -------------------------------- GENERAL INFORMATION The Windcube (WC) referred to here is a Leosphere Version 2 (v2) Windcube. Note that the "u" and "v" and "w" as defined in these files are NOT in meteorological coordinates, but in a local right-handed coordinate system: U positive from south -> north V positive from west -> east W positive from up -> down Therefore, the calculation performed in the codes is: u_meteorological = u_native v_meteorological = v_native w_meteorological = -w_native Note: The coordinate system for the v2 is different than the v1. -------------------------------- DATA FILES INFORMATION STA file : Averaged file, 2-minute average. INCLUDES MOTION COMPENSATION ('mc' in codes). (ASCII text file, .sta extension) RTD file : Real Time Data file, about 1.25 Hz. Timestamps include milliseconds, so need to include these for time accuracy. INCLUDES MOTION COMPENSATION ('mc' in codes). (ASCII text file, .rtd extension) STDSTA file : Averaged file, 2-minute average. NO MOTION COMPENSATION ('std' in codes). (ASCII text file, .stdsta extension) STDRTD file : Real Time Data file, about 1.25 Hz. Timestamps include milliseconds, so need to include these for time accuracy. NO MOTION COMPENSATION ('std' in codes). (ASCII text file, .stdrtd extension) Digit decoding: d - day, m - month, y - year, H - hour, M - minute, S - second, F - fraction of sec File names formats: WLS866-16_YYYY_MM_DD__hh_mm_ss.sta (WC16 v2 STA) WLS866-16_YYYY_MM_DD__hh_mm_ss.stdsta (WC16 v2 STDSTA) WLS866-16_YYYY_MM_DD__hh_mm_ss.rtd (WC16 v2 RTD) WLS866-16_YYYY_MM_DD__hh_mm_ss.stdrtd (WC16 v2 STDRTD) Files are daily unless an interruption in data collection occurred; in that case, the file name is the time stamp of the restarted time of data collection. Note: RTD data is much larger as noted in the code. WC_nums : 1 is WC49 (v1), 2 is WC61 (v1), 3 is WC68 (v1), 4 is WC16 (WLS866 v2 offshore LiDAR) in the codes Note on XPIA experiment: Only WC61, WC68, and WC16 were taking data during XPIA. This README only discusses WC16 as it is a v2 LiDAR. Vertical Levels Chosen : 40m, 50m, 60m, 80m, 100m, 120m, 140m, 150m, 160m, 180m, 200m 11 vertical levels (or altitudes) chosen for v2 remote sensing -------------------------------- TIME INFORMATION Digit decoding: d - day, m - month, y - year, H - hour, M - minute, S - second, F - fraction of sec Date/Time, UTC (v2, STA) : yyyy/mm/dd HH:MM Date/Time, UTC (v2, STDSTA) : yyyy/mm/dd HH:MM Date/Time, UTC (v2, RTD) : yyyy/mm/dd HH:MM:SS.FFF Date/Time, UTC (v2, STDRTD) : yyyy/mm/dd HH:MM:SS.FFF (where .FFF are the fractions of a second in Matlab format, although only the first two fractional second digits are usually reported) Time stamp is the first column of WC files. Note on time stamp: 9 April 2015 lidars were compared to time.gov. Both lidars lagged time.gov by one second. -------------------------------- VARIABLES, STA FILES, v2 COLUMNS 2-6 Int Temp (°C) : internal temperature (deg Celsius) of the laser unit Ext Temp (°C) : Meteorological parameter available with PTH option for the standard Windcube v2. (Not available for XPIA) Pressure (hPa) : Meteorological parameter available with PTH option for the standard Windcube v2. (Not available for XPIA) Rel Humidity (%) : Meteorological parameter available with PTH option for the standard Windcube v2. (Not available for XPIA) Wiper count : ignore unless suspect precipitation (but often poor metric for precipitation) COLUMNS 7-17 (GROUPS of 11) **** begin group of variables that will repeat for each of ten heights ******** 40m Wind Speed (m/s) : mean scalar averaged horizontal wind speed (m/s) at the first (lowest) measurement altitude for the 2-minute period 40m Wind Speed Dispersion (m/s) : standard deviation of scalar averaged horizontal wind speed (m/s) 40m Wind Speed min (m/s) : minimum 1-sec wind speed measurement during the 2-minute period (m/s) 40m Wind Speed max (m/s) : maximum "" 40m Wind Direction (°) : vector-averaged wind direction of altitude 1 40m Z-wind (m/s) : average W-component at altitude 1 40m Z-wind Dispersion (m/s) : standard deviation of W-component altitude 1 40m CNR (dB) : average CNR for the two-minute period (dB) 40m CNR min (dB) : minimum CNR 40m Dopp Spect Broad (m/s) : 2 minute averaged spectral broadening (converted to m/s) 40m Data Availability (%) : percentage of data available at this altitude (assuming Leosphere CNR threshold of -22 dB) **** end group of variables that will repeat for each of ten heights ********** Repeats this group of variables for next 10 levels, where the 40m in naming changes to 50m, 60m, 80m, ... , 200m (Each group of columns is separated by a blank column, e.g. 18, 30, ...) -------------------------------- VARIABLES, RTD FILES, v2 COLUMNS 2-7 Position : laser beam head angular position with respect to North (0°). East is +90°, South is +180°, West is +270°, and Up (anti-nadir) is +360° Temperature : internal temperature (deg Celsius) of the laser unit Wiper Count : ignore unless suspect precipitation (but often poor metric for precipitation) Alpha : Roll (rotated about native X, rotated above the North axis) Beta : Pitch (rotated about native Y, rotated above the East axis) Gamma : Yaw (rotated about native Z, rotated above the down/nadir axis) COLUMNS 8-15 (GROUPS of 8) **** begin group of variables that will repeat for each of ten heights ******** 40m CNR (dB) : Carrier to Noise Ratio in the corresponding line of sight (dB) (*** often use -17 dB as a threshold***) 40m Radial Wind Speed (m/s) : Radial Wind Speed along the line of site (m/s) 40m Radial Wind Speed Dispersion (m/s) : Averaged Doppler Spectrum width converted into (m/s) 40m Wind Speed (m/s) : Horizontal wind speed (m/s), running average from last ~4 seconds 40m Wind Direction (°) : Wind direction [°] 40m X-wind (m/s) : U wind positive from south -> north (see above) 40m Y-wind (m/s) : V positive from west -> east (see above) 40m Z-wind (m/s) : W positive from up -> down (see above) ***** end group of variables that will repeat for each of ten heights ********* Repeats this group of variables for next 10 levels, where the 40m in naming changes to 50m, 60m, 80m, ... , 200m (Each group of columns is separated by a blank column, e.g. 18, 30, ...) -------------------------------- SPECIAL NOTES ON V2 RTD FILES: There were several modifications made to the WC v2 RTD input data formats for proper read in: 1) The carriage returns at the end of lines were Unix carriage returns (\n). In order to read using Matlab, these were changed to Windows carriage returns (\r\n). 2) There was an extra tab (\t) at the end of the header line before the carriage return that was eliminated. 3) There were an extra two tabs (\t\t) before the carriage return on any data line. These were eliminated. 4) The software would stop reading somewhere in the scanner "Position" column (col. num. 2) when it encountered the first "V". Unlike the v1s, the scanner position goes from 0 to 90 to 180 to 270 to vertical. The "V" was the straight vertical label. However, when the software saw this column, it would assume a float column, but hiccup when the "V", like a string was encountered. All the "V" data points were changed to an integer, in particular "360", and the user is able to proceed. 5) There were the two datestrings that the RTD files wrote out where the software started to write the datestring, stopped, and then started again on the same line with writing the datestring with the rest of the data. These were corrected. The breeze.colorado.edu/pub/WC16_1Hz/ directory of the Lundquist Research group contains these updated file formats. -------------------------------- CODES INFORMATION Basic Information: Note: Consider "1" to be "on" when using a flag in the codes, while "0" is "off". The useful header starts on line 41 for a v2 and the data start on line 42 for a v2 LiDAR. The ten altitudes are defined in line 39 for a v2. Architecture of Directories (below your main directory): WC16_STA_XPIA/ : Input Data directory for WC16 v2 STA data (includes motion compensation when on the platform) WC16_STDSTA_XPIA/ : Input Data directory for WC16 v2 Standard (STD) STA data (no motion compensation) WC16_RTD_XPIA/ : Input Data directory for WC16 v2 RTD data (includes motion compensation when on the platform) WC16_STDRTD_XPIA/ : Input Data directory for WC16 v2 Standard (STD) RTD data (no motion compensation) WC_calc_output/ : Output directory for the WC_calc code. Data files are split up over WC devices. Also default output for some plots. WC_load_output/ : Output directory for the load_WLS7_WLS866 code. Single data file created named based on WCs selected. Structure variables in the file per each WC device. WC_regTA_output/ : Output from WCs_regular_time_axis code. WC data is put on consistent, regular 2-minute resolution, time axis with NaN filled in for missing times. Note: RTD data is much larger and is put on the local C: drive by default and noted in the code. MAIN DRIVER code: Main_WC_script.m: Single script allowing the user to set multiple parameters to use in multiple functions of the code. (All codes below act as functions to pass parameters into from the Main_WC_script.) READ IN CODES: load_WLS7_WLS866.m : Takes STA (.sta) or converted RTD (.rtd) files from WC software from one of the above directories and converts them into native Matlab .mat file format for use in other codes importFile.m : Imports a single WindCube file importDir.m : Loops through importFile multiple times for many WindCube files in a single directory CALCULATION / PLOTTING CODES: WC_calc.m : Calculates TKE, I, shear, etc. using output from load_WLS7_WLS866.m WC_daily_pcolor.m : Creates daily color raster plots of WC variables for quick analysis like on DataViewer (http://breeze.colorado.edu/DataViewer/XPIA.html) WCs_avail_profile.m : Takes in data from the WCs availability and plots it as a function of height WCs_regular_time_axis.m : Takes output from WC_calc and puts data onto consistent, regular 2-minute resolution, time axis with NaN filled in for missing times. Weibull_Distribution_WCs.m : Creates relative histograms and best fit Weibull distribution traces of the WC data. winds_scatter_wc_compare_regTA.m : Scatterplots comparing the WC devices. winds_scatter_wc16_v2_ground_table_compare_regTA.m : Scatterplots comparing WC16 v2 to the v1 LiDAR on the ground and on the motion table to see the effects. (STA files only so far.) MATLAB FUNCTIONS (dependencies) (Please make sure these functions are "Added to the Path" as the codes use these user contributed functions): circ_colormap.m : Allows user to incorporate circular colormaps. Useful for wind direction plotting. structvars.m : print a set of assignment commands that, if executed, would assign fields of a structure to individual variables of the same name (or vice versa). v2struct.m : Nice code to efficiently pack/unpack variables to/from a scalar structure. variableCreator.m : Creating new variables on the fly is something that should be avoided (using eval()), but this alternative method is better. -------------------------------- STAND ALONE READ IN CODE leosphere_WC_v2_readin_code.m This is a Matlab code provided directly from Leosphere in order to read in the WC16 v2 data. This code is not part of the suite of Matlab codes above used as part of CU. It is stand alone and provided to the user as an alternative way to read in and deal with the data.