Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Possible FPE for valid_min, valid_max of scaled data #1068

Closed
rschmunk opened this issue Mar 23, 2018 · 6 comments · Fixed by #1070
Closed

Possible FPE for valid_min, valid_max of scaled data #1068

rschmunk opened this issue Mar 23, 2018 · 6 comments · Fixed by #1070

Comments

@rschmunk
Copy link
Contributor

rschmunk commented Mar 23, 2018

A user sent me a sample dataset where testing whether data values were good/bad was not working correctly because FPE was resulting in values that equalled the supposed valid_max being reported as invalid because the calculated valid_max was incorrect by a minuscule amount.

The var is described as

byte qa_value(time=1, scanline=2929, ground_pixel=450);
  :units = "1";
  :scale_factor = 0.01f; // float
  :add_offset = 0.0f; // float
  :valid_min = 0UB; // byte
  :valid_max = 100UB; // byte
  :long_name = "data quality value";
  :coordinates = "longitude latitude";
  :_FillValue = -1UB; // byte
  :_Unsigned = "true";

After opening the dataset in enhanced mode, calling VariableDS.getValidMax() on this variable returns a value of 0.9999999776482582.

But when extracting values from the array, there are values that are reported as being == 1.0, and calling either VariableDS.isInvalidData(1.0) or VariableDS.isMissing(1.0) returns true.

@lesserwhirls
Copy link
Collaborator

The fix is on 5.0, but I think @msdsoftware is on 4.6.x but looking at 5 (is that understanding correct?)

@rschmunk
Copy link
Contributor Author

Yes, I am still using 4.6.x, @lesserwhirls. Started looking at switching to 5.0 last week but then backed off after finding that changes to catalog handling were significant. I may take another whack at it later this week.

@rschmunk
Copy link
Contributor Author

rschmunk commented Mar 27, 2018

@lesserwhirls, I managed to get my code to compile and link against 5.0.0, but I am encountering some problems obtaining listings from remote catalogs (i.e., branches may be reported as having nothing in them), so it looks like I will revert to 4.6 for a while longer.

I have a kludge in place in my own code to deal with the scaled valid_max problem, so there's no crying need on my end to apply the #1070 fix to 4.6.

@cwardgar
Copy link
Contributor

@msdsoftware Thanks for the update. It would have been tedious to apply #1070 to 4.6, as it builds atop #1047, which is 5.0-specific.

@rschmunk
Copy link
Contributor Author

@cwardgar, I may have figured out the 5.0 problem reading catalogs. It appears that I need to call DatasetsNode.getDatasetsLogical() rather than just DatasetsNode.getDatasets()

@cwardgar
Copy link
Contributor

That's good news! Frankly, I haven't had a chance to look into the new Catalog code much (it was one of John's last contributions before he left), so I can't provide any guidance there. We'd love to know the steps you end up taking to get it working though.

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

Successfully merging a pull request may close this issue.

3 participants