Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another possible NA value for temp_soil #55

Closed
Aariq opened this issue Jul 28, 2023 · 3 comments
Closed

Another possible NA value for temp_soil #55

Aariq opened this issue Jul 28, 2023 · 3 comments

Comments

@Aariq
Copy link
Member

Aariq commented Jul 28, 2023

I'm seeing -14366.200 as a value for temp_soil_*F columns sometimes where the corresponding temp in ºC is NA. Should we have azmetr treat that value as NA? Or maybe just make the ºF values NA whenever the corresponding ºC are NA?

library(azmetr)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
az_daily(station_id = "az08", start_date = "2022-03-15", end_date = "2022-03-17") |> 
  select(starts_with("temp_soil"))
#> # A tibble: 3 × 12
#>   temp_soil_10cm_maxC temp_soil_10cm_maxF temp_soil_10cm_meanC
#>                 <dbl>               <dbl>                <dbl>
#> 1                  NA             -14366.                   NA
#> 2                  NA             -14366.                   NA
#> 3                  NA             -14366.                   NA
#> # ℹ 9 more variables: temp_soil_10cm_meanF <dbl>, temp_soil_10cm_minC <dbl>,
#> #   temp_soil_10cm_minF <dbl>, temp_soil_50cm_maxC <dbl>,
#> #   temp_soil_50cm_maxF <dbl>, temp_soil_50cm_meanC <dbl>,
#> #   temp_soil_50cm_meanF <dbl>, temp_soil_50cm_minC <dbl>,
#> #   temp_soil_50cm_minF <dbl>

Created on 2023-07-28 with reprex v2.0.2

@jeremylweiss
Copy link
Member

Nice catch, thanks for pointing this out! The -14366.200 values should be nodata values, following the standardized nodata value system we now have in place. I'll edit those values accordingly.

@jeremylweiss
Copy link
Member

The -14366.2 value is a conversion of the 'pre-nodata-standardization' nodata value of -7999 from degrees C to degrees F. Since azmetr has -7999 in its list of nodata value possibilities, the temp_soil_10cm values in the above example show up as NA for degrees C. Since 14366.2 is not in the azmetr list of nodata values, it shows up as 14366.2 for temp_soil_10cm in degrees F.

The same issue shows up in the hourly data for the dates in the above example.

At that time, station_id = "az08" had bad data for temp_soil_10cm, due to animal damage to sensor wires. Those data were edited manually with nodata values.

Temperature-unit conversion from metric to imperial happens in the database system, after data are brought in from individual stations. Perhaps the old nodata value was entered manually by mistake after the 'nodata-standardization' was put in place, and the unit-conversion code no longer recognized it as such.

-7999 values are now standardized nodata values for soil temperature, -9999.0. NA now appears where -14366.2 values were.

@jeremylweiss
Copy link
Member

close #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants