InterpolationTransform: vector wind average
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- data-engineering
Research direction
Start with logger/transforms/interpolation_transform.py and read how field_spec sources are parsed, cached, and validated, along with the existing averaging algorithms. Implement paired speed/direction handling and the vector_average and wind_steadiness algorithms with the stated timestamp, missing-value, and min_count rules; add tests for the new behavior and startup checks. Done means both algorithms produce one output per field spec and reject the unsupported source/options described in the issue.
Written by the indexing model from the issue text.
Description
Split out from #664 (item 3). The rest of that issue is done in #666, #667 and #674.
Problem
polar_average averages directions as unit vectors and ignores speed, so a brief 1-knot puff counts as much as a sustained 30-knot wind. The meteorological standard (WMO) is to average the u/v wind components weighted by speed. That gives a resultant direction, and a steadiness ratio (resultant speed ÷ scalar mean speed) that shows when a direction average means little because the wind is swinging around.
Proposed design
These are the decisions reached while working on #664. They are open to revision.
One output per field_spec entry, as for every other InterpolationTransform algorithm:
- Average speed: the scalar mean speed, which is the usual met convention. This needs nothing new; it is
boxcar_averageon the speed field. vector_average(new): the speed-weighted resultant direction.wind_steadiness(new): resultant speed ÷ scalar mean speed, from 0 (no consistent direction) to 1 (steady).- Output names: both new algorithms name their output after the direction field, plus
result_prefix.
Speed and direction are given as a pair:
field_spec:
- sources: [TrueWindSpeed]
algorithm: boxcar_average
window: 60
result_prefix: Avg # → AvgTrueWindSpeed
- sources: [{speed: TrueWindSpeed, direction: TrueWindDir}]
algorithm: vector_average
window: 60
result_prefix: Avg # → AvgTrueWindDir
- sources: [{speed: TrueWindSpeed, direction: TrueWindDir}]
algorithm: wind_steadiness
window: 60
result_prefix: Steadiness # → SteadinessTrueWindDir
The dict form of field_spec would take source: {speed: ..., direction: ...}.
Pairing and options
- Pairing: speed and direction samples are paired by exact timestamp. That holds when both come from the same record, which is the usual case, including through
CachedDataReader. Unpaired samples are ignored. - Missing values: a pair with either value missing (None or NaN) is ignored.
min_count: counts valid pairs.outlier_mads: refused, since it has no obvious meaning for vectors.- Startup checks: both new algorithms require a paired source, and every other algorithm refuses one.
Implementation notes
- Where the code goes:
logger/transforms/interpolation_transform.py, about 95 lines plus tests:- accept a pair in both
field_specforms and cache both fields; - pair the samples before computing;
- the two algorithms;
- the startup checks.
- accept a pair in both
- One existing line would crash:
transform()builds anon_emptymap that nothing reads, by looking up each source in a dict. That raisesTypeErrorwhen the source is itself a dict. The lookup can simply be deleted. - Template:
averaging_logger_templatecould later gain optional variables for this, added without changing existing definitions.
- Dominant language
- Python
- Stars
- 57
- Forks
- 30
- Avg merge
- 3h 14m
- Merged PRs (30d)
- 56
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OceanDataTools/openrvdas
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
OceanDataTools/openrvdas#760 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
OceanDataTools/openrvdas#758 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
OceanDataTools/openrvdas#748 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 58/100
OceanDataTools/openrvdas#743 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
OceanDataTools/openrvdas#721 ·
Maintainers usually reply within 1 day
All issues in OceanDataTools/openrvdas
Similar issues
-
automated endpoint-dead needs-curation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
almanac-data/climate-almanac#138 ·
Maintainers usually reply within 1 day
-
level/subtask type/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
wazuh/wazuh-virtual-machines#1091 ·
Maintainers usually reply within 1 day
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentPossibly taken @halcyon-past claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/semantic-kernel#14824 · 1 comment ·
Maintainers usually reply within 3 days
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
stack314/django-neolith#142 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
LedgerHQ/app-bitcoin-legacy#306 ·