Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Bug in WindVector instruction?


dberdes Jun 11, 2009 01:02 AM

I have one table declared in my CR1000 CRBasic program:

DataTable (OneMin,TableStore_TF,-1)
DataInterval (5,60,Sec,0)
OpenInterval
CardOut (0 ,-1) 'Send data to CompactFlash card
Sample (1,Station,String)
Sample (1,TimeZone,String)
Sample (1,ClockOffset_ms,Long)
Minimum (1,BattVolt_V,FP2,False,False)
Average (1,EnclTemp_degC,FP2,False)
Average (1,EnclRelHum_percent,FP2,False)
Average (1,AmbTemp_degC,FP2,False)
Average (1,AmbRelHum_percent,FP2,False)
Average (1,BaroPres_hPa,IEEE4,False)
Average (1,ISOTrackTemp_degC,FP2,False)
Average (1,SAETrackTemp_degC,FP2,False)
WindVector (1,WindSpeed_mps,WindDir_deg,FP2,False,0,0,1)
Maximum (1,WindSpeed_mps,FP2,False,False)
EndTable

Here is the header of the resultant TOA5 output file from this table:

"TOA5","CPG Passby Noise","CR1000","10859","CR1000.Std.16","CPU:CPG Passby Noise Weather 20090610.CR1","27118","OneMin"
"TIMESTAMP","RECORD","Station","TimeZone","ClockOffset_ms","BattVolt_V_Min","EnclTemp_degC_Avg","EnclRelHum_percent_Avg","AmbTemp_degC_Avg","AmbRelHum_percent_Avg","BaroPres_hPa_Avg","ISOTrackTemp_degC_Avg","SAETrackTemp_degC_Avg","WindSpeed_mps_WVc(1)","WindSpeed_mps_WVc(2)","WindSpeed_mps_Max"
"TS","RN","","","ms","V","deg C","%RH","deg C","%RH","hPa","deg C","deg C","mps","mps","mps"
"","","Smp","Smp","Smp","Min","Avg","Avg","Avg","Avg","Avg","Avg","Avg","WVc","WVc","Max"

Questions:
Why is the "WindSpeed_mps" variable listed twice in the TOA5 file header? What happened to "WindDir_deg"?

Why are the units "mps" listed for the WindDir_deg variable?

The actual data values for wind direction are properly scaled in degrees engineering units.

I can provide a copy of my CRBasic program if necessary.

Thanks,


Dana Jun 11, 2009 05:50 PM

Questions:
Why is the "WindSpeed_mps" variable listed twice in the TOA5 file header? What happened to "WindDir_deg"?

The program uses output option 1, which returns two outputs - mean horizontal wind speed and unit vector mean wind direction.


Why are the units "mps" listed for the WindDir_deg variable?

Units are typically not specified in the header unless the program assigns units. Do you have a line that reads

Units WindDir_deg = mps

in your program?


The actual data values for wind direction are properly scaled in degrees engineering units.


Dana Jun 11, 2009 05:54 PM

Oops, email got sent before I finished. That's what trying to use the tab key will get you in this web interface :)

Anyway,you may find information useful in the most recent help file. There is an example showing how to use the FieldNames instruction to change the field headers used for the Wind Vector instruction. You can get the most recent Help & definition files used in CRBasic by downloading the most recent OS from our web site. The installation will put the files where they can be accessed by the program. This is true for any of our CRBasic dataloggers.

Regards,
Dana


dberdes Jun 11, 2009 09:56 PM

Hi Dana,

I am using the latest CR1000 OS and properly use the units declaration in my CRBasic program to set the units for all variables.

I will be emailing you the following:

my CRBasic program.
a TOA5 file from declared table output.
a snapshot of the latest table record.

Kind regards,


Dana Jun 11, 2009 11:18 PM

Hi David,

Your program has a variable declared as Windspeed_mps. This is the variable you have used in the WindVector instruction. Based on the WindVector instruction's OutputOption parameter, WindVector outputs two values:

WindSpeed_mps_WVc(1)
WindSpeed_mps_WVc(2)

where
WindSpeed_mps is the original variable name
WVc is the output type identifier that gets appended to the output name*
(1) indicates the mean horizontal wind speed
(2) indicates the unit vector mean wind direction

*(similarly, when you output the minimum battery voltage, BattVolt_V, you end up with the output field BattVolt_V_Min)


Your program has this at line 69:

Units WindSpeed_mps = mps

That's where your data file header gets the "mps" for units.


All of this results in a header of:

Header Line 1 - WindSpeed_mps_WVc(1),WindSpeed_mps_WVc(2),
Header Line 2 - mps, mps (the units you specified)
Header Line 3 - WVc, WVc (and output field id automatically generated)

Use the FieldNames instruction if you would like to change the default field name or the units(see the CRBasic WindVector help).

Regards,
Dana

Log in or register to post/reply in the forum.