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

[meteo-vm2-to-bufr] Preserve data when value is out of range #5

Open
edigiacomo opened this issue Jul 28, 2017 · 2 comments
Open

[meteo-vm2-to-bufr] Preserve data when value is out of range #5

edigiacomo opened this issue Jul 28, 2017 · 2 comments
Assignees

Comments

@edigiacomo
Copy link
Member

edigiacomo commented Jul 28, 2017

Now, a value out of range is ignored:

$ echo "201701010000,1,160,-1,,,100000000" | meteo-vm2-to-bufr
1:[201701010000,1,160,-1,,,100000000] - Value -1 is outside the range [-0.1,1638.1] for B13011 (TOTAL PRECIPITATION / TOTAL WATER EQUIVALENT)

We should implement the behaviour of dbavm (in pseudocode):

if is_out_of_range(value) {
    if not is_out_of_range(0) {
        value = 0
    } else {
         value = avg(range[0], range[1])
    }
    attributes.append(B33196=0)
}

I'm not quite sure that B33196=0 is right: in the original code a comments says "Mark as replaced", but B33196=1 is "Manual invalidation" (note that the value is 1) and B33197 is "[SIM] Manual replacement in substitution".

@edigiacomo edigiacomo self-assigned this Jul 28, 2017
@edigiacomo
Copy link
Member Author

@pat1 confirmed that the behaviour should be:

if is_out_of_range(value) {
    if (value > maxvalue) {
        value = maxvalue
    } else {
        value = minvalue  
    }
    attributes.append(out_of_range_attribute())
}

We must define which attribute and which attribute value out_of_range_attribute() will return.

@edigiacomo
Copy link
Member Author

This issue is still relevant.

@edigiacomo edigiacomo removed the stale label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant