bgctw / REddyProc

Processing data from micrometeorological Eddy-Covariance systems
57 stars 31 forks source link

Error in fConvertTimeToPosix -> missing value where TRUE/FALSE needed #59

Closed H4nggara closed 1 year ago

H4nggara commented 2 years ago

Hi all,

I am new in Eddy flux data processing. I working on AsiaFLux data. The dataset is already in half-hourly format, the data frame looks like this: head(BKS_Eddy02)

Year DoY Hour NEE LE H Rg Tair Tsoil rH VPD Ustar 1 NA NA NA micro mol m-2 s-1 Wm-2 Wm-2 Wm-2 degrees C degreesC % kPa ms-1 2 2001 1 15 -99999 -99999 -99999 0 24.278 25.18 96 0.1188 -99999 3 2001 1 45 -99999 -99999 -99999 0 24.31 25.138 96.075 0.1169 -99999 4 2001 1 115 1.895 -99999 -99999 0 24.245 25.087 96.25 0.1112 -99999 5 2001 1 145 -99999 -99999 -99999 0 24.36 25 96.225 0.1127 -99999 6 2001 1 215 -25.448 -99999 -99999 0 25.035 24.97 94.475 0.1726 -99999

When I tried to convert the date and time into Posix using the EdyyProc package, I got an error message. BKS_Eddy02$DateTime <- fConvertTimeToPosix(BKS_Eddy02, 'YDH', Year = 'Year', Day = 'DoY', Hour = 'Hour')

Error in if (sum(is_invalid_doy) > 0) { : missing value where TRUE/FALSE needed

How should I treat my data? The time format seems different from the other data from FLuxnet or with the example data.

Thank you in advance

bgctw commented 2 years ago

Your first line seems to cause problems - its the units not values. If you prepare your data as text file, this is the recommended way and REddyProc routines reading from text will attach this information as attributes to the data for usage it in plotting. But its not strictly necessary, so just use the data without the first line: BKS_Eddy03 = BKS_Eddy02[-1,].

Please, use the mailing lists (reddyproc-users@lists.r-forge.r-project.org and REddyProc-help@bgc.mpg.de) for usage problems. This issue tracking system is meant for reporting errors and developing the REddyProc package. See FAQ