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

f-tds operations fail when dataset has NaN for missing #1495

Open
karlmsmith opened this issue Nov 23, 2017 · 3 comments
Open

f-tds operations fail when dataset has NaN for missing #1495

karlmsmith opened this issue Nov 23, 2017 · 3 comments

Comments

@karlmsmith
Copy link
Contributor

karlmsmith commented Nov 23, 2017

Reported by @AnsleyManke on 18 Dec 2014 19:20 UTC
John Maurer reported this.

When we define the transformed variable, the operation consists of defining the variable and inheriting the attributes from the dataset variable.

let/d=1 salt_1_transformed=salt[d=1,z=100:500@AVE]
set att/like=salt salt_1_transformed

If SALT has missing_value flag of NaN, this is incorrect. Ferret isn't going to save the data with NaN's.

Migrated-From: http://dunkel.pmel.noaa.gov/trac/ferret/ticket/2223

@karlmsmith
Copy link
Contributor Author

karlmsmith commented Nov 23, 2017

Comment by @AnsleyManke on 18 Dec 2014 19:30 UTC
There is a fix needed in the F-TDS scripts that run. We should get the attributes from the dataset variable but then reset the missing-data flag:

let/d=1 salt_1_transformed=salt[d=1,z=100:500@AVE]
set att/like=salt salt_1_transformed

set var/bad=-1.e34 salt_1_transformed

Also, in Ferret there's a mistake in what it does with datasets that have NaN as their missing_value and/or _FillValue attribute.

In Ferret 15 years ago when we implemented NaN as missing values, the method was to substitute the Ferret missing-value flag for NaN as the data is read. The routine mis-defined the Ferret flag, as 1.e-34 instead of -1.e34. This leads to consistent results purely within Ferret, but it's much better to use Ferret's default missing-value flag.

@karlmsmith
Copy link
Contributor Author

karlmsmith commented Nov 23, 2017

Comment by @AnsleyManke on 18 Dec 2014 19:36 UTC
This is fixed in the LAS iosp script get_datavar.jnl, and in Ferret routines tm_switch_nan.c and cd_get_1_dep_var.F

@karlmsmith
Copy link
Contributor Author

karlmsmith commented Nov 23, 2017

Comment by @AnsleyManke on 19 Dec 2014 00:03 UTC
Rework this, undoing the changes, once #2224 is completed.

@karlmsmith karlmsmith reopened this Nov 23, 2017
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