Skip to content
New issue

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

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

Already on GitHub? # to your account

Running averages of SDI-12 soil probe data uses wrong time window size #8

Open
patricktokeeffe opened this issue Jan 25, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@patricktokeeffe
Copy link
Member

SDI-12 soil sensors (TDR315, 5TM) were moved from the standard 5-second slowsequence into a separate 1-min slowsequence to avoid data acquisition stalling due to sensor delays. By default the running averages are supposed to represent the previous 1-minute of data. However, the parameter dictating the number of samples to include in said averages (NMBR_SOIL_T_WTR_DEL_SAMPLES) was not updated and as a result, the averaging windows for those sensors was inadvertently expanded to previous 12 minutes.

Const SLOWSEQUENCE_SCAN_INTERVAL = 5000          'Unique: slow sequence measurement rate (ms) (For this CR3K program, the shortest scan interval is 2000 ms)
[...]
Const NMBR_SOIL_T_WTR_DEL_SAMPLES = (60*1000)/SLOWSEQUENCE_SCAN_INTERVAL       'Unique: Number of measurements to compute a one-minute mean of soil temperature and water

Standard slow sequence:

  SlowSequence
  Scan (SLOWSEQUENCE_SCAN_INTERVAL, mSec, 3, 0)
    [...]
    #If ((SENSOR_HFP) AND  (SENSOR_CS616) AND (SENSOR_TCAV)) Then
    AvgRun (soil_wtr_current(1), NMBR_CS6xx, soil_wtr_T(1), NMBR_SOIL_T_WTR_DEL_SAMPLES)

New sequence:

  SlowSequence
  Scan (1, Min, 0, 0)   
    [...]
    #If ((SENSOR_HFP) AND (SENSOR_CS6XX) AND (SENSOR_SOIL_T))) Then

    AvgRun (soil_wtr_current(1), NMBR_CS6xx, (tdr31X_wc(1)/100), NMBR_SOIL_T_WTR_DEL_SAMPLES) 'HINT scale % -> v/v

The trivial fix (scaling parameter to match new slowsequence time base) would mean just one data point is included in those averages. Maybe it should be a 15-, 20-, or 30-second scan instead?

Alternately: revert the addition of a new slowsequence and specify up-front that if SDI-12 soil sensors are used, the slowsequence interval must be increased from 5000msec to [whatever the actual minimum should be, probably determined through some bench testing].

@patricktokeeffe patricktokeeffe added the bug Something isn't working label Jan 25, 2024
patricktokeeffe added a commit to patricktokeeffe/EasyFlux-DL that referenced this issue Jan 26, 2024
Restores heat flux storage term TDR-31X sensor code back to main slow
sequence. Cleans up new profile-specific slow sequence.

Fixes wsular#3, fixes wsular#8, closes wsular#9
patricktokeeffe added a commit to patricktokeeffe/EasyFlux-DL that referenced this issue Jan 26, 2024
Restores heat flux storage term TDR-31X sensor code back to main slow
sequence. Cleans up new profile-specific slow sequence.

Fixes wsular#3, fixes wsular#8, closes wsular#9
patricktokeeffe added a commit to patricktokeeffe/EasyFlux-DL that referenced this issue Feb 8, 2024
Restores heat flux storage term TDR-31X sensor code back to main slow
sequence. Cleans up new profile-specific slow sequence.

Fixes wsular#3, fixes wsular#8, closes wsular#9
@patricktokeeffe patricktokeeffe self-assigned this Feb 13, 2024
patricktokeeffe added a commit to patricktokeeffe/EasyFlux-DL that referenced this issue Feb 13, 2024
Puts energy balance TDR/5TM sensors back into original slowsequence
and cleans up new slowsequence for profile sensors.

Fixes wsular#3, fixes wsular#8, closes wsular#9

(cherry picked from commit 26a04ce)

# Conflicts:
#	CHANGELOG.md

# Conflicts:
#	CHANGELOG.md
patricktokeeffe added a commit to patricktokeeffe/EasyFlux-DL that referenced this issue Feb 16, 2024
Puts energy balance TDR/5TM sensors back into original slowsequence
and cleans up new slowsequence for profile sensors.

Fixes wsular#3, fixes wsular#8, closes wsular#9

(cherry picked from commit 26a04ce)

# Conflicts:
#	CHANGELOG.md

# Conflicts:
#	CHANGELOG.md
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant