jmzobitz / neonSoilFlux

R Code to analyze and process soil respiration fluxes at NEON sites
GNU General Public License v3.0
6 stars 6 forks source link

determine_position throws error #13

Closed jmzobitz closed 6 months ago

jmzobitz commented 8 months ago

The function determine_position in acquire_neon_data throws an error Test case: "BART", "2020-05" (also happens at a lot of other sitest oo).

Add on the positions for swc

swc <- determine_position(swc_positions,swc)

Error message: Error in mutate() at NEONSoils/R/determine_position.R:54:2: ℹ In argument: zOffset = map_dbl(.x = position_info, .f = ~pluck(.x, "zOffset")). ℹ In group 58033: horizontalPosition = "005", verticalPosition = "508", startDateTime = 2020-05-01. Caused by error in map_dbl(): ℹ In index: 1. Caused by error: ! Result must be length 1, not 2. Run rlang::last_trace() to see where the error occurred.

jmzobitz commented 8 months ago

At this point in the code the number of levels is 2 - so I think that is giving the error here in the pluck. Grr.

jmzobitz commented 7 months ago

From Ed Ayres:


Thanks for reaching out about this. I want to look into it some more, but right now my recommendation is to use the depths listed in swc_depthsV2.csv. There is a known problem with the depths in the sensor positions file that comes in the download package for the soil water content data product (see second paragraph on the data product webpage: https://data.neonscience.org/data-products/DP1.00094.001). I realize that it is not ideal to have to direct your code to swc_depthsV2.csv until we are able to fix the data product, but I feel like this is necessary to make sure you are using the correct measurement depths.

I’m not sure how long it will take to resolve the issue for the soil moisture product as we are waiting for a new data processing pipeline to be put in place. However, as of just a few weeks ago the very first data product (https://data.neonscience.org/data-products/DP1.00066.001) was published using that pipeline – you shouldn’t notice a difference in the published data, but a lot has changed behind the scenes! With that pipeline in place we will be gradually switching over all data products to the new pipeline, which will allow us to fix the soil moisture measurement depth issue, but the timeline is still TBD.