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

Augment cdms2.createAxis to accept "missing" argument #220

Closed
durack1 opened this issue Feb 1, 2018 · 7 comments
Closed

Augment cdms2.createAxis to accept "missing" argument #220

durack1 opened this issue Feb 1, 2018 · 7 comments
Assignees
Labels

Comments

@durack1
Copy link
Member

durack1 commented Feb 1, 2018

I've been generating a new singleton axis for use in CMOR (rewriting the default table entry of 2):

{'table_entry': 'height2m',
 'units': 'm',
 'coord_vals': cdm.createAxis([10.],id='height')},

When CMOR writes this singleton axis I get the following output:

...
huss:history = "2018-02-01T20:08:35Z altered by CMOR: Treated scalar dimension: \'height\'. 2018-02-01T20:08:35
Z altered by CMOR: replaced missing value flag (-9.99e+33) with standard missing value (1e+20)." ;
...

It'd be great if cdms2.createAxis could also take the missing= keyword arg, so that this comment and CMOR change could be suppressed. So what I am thinking is:

'coord_vals': cdm.createAxis([10.],id='height',missing=1.e20)},

And the current experience:

In [55]: a = cdm.createAxis([10.],id='height')

In [56]: b = cdm.createAxis([10.],id='height',missing=1.e20)
Traceback (most recent call last):

  File "<ipython-input-56-cc3e960cd1ed>", line 1, in <module>
    b = cdm.createAxis([10.],id='height',missing=1.e20)

TypeError: createAxis() got an unexpected keyword argument 'missing'
@dnadeau4
Copy link
Contributor

dnadeau4 commented Feb 6, 2018

Is this CF compliant?

@durack1
Copy link
Member Author

durack1 commented Feb 6, 2018

@dnadeau4 what do you mean?

@dnadeau4
Copy link
Contributor

dnadeau4 commented Feb 6, 2018

This is not allowed.
http://cfconventions.org/Data/cf-conventions/cf-conventions-1.6/build/cf-conventions.html#idp5553648

_FillValue | A value used to represent missing or undefined data.  Not allowed for coordinate data except in the case of auxiliary coordinate varibles in discrete sampling geometries.

@dnadeau4
Copy link
Contributor

dnadeau4 commented Feb 6, 2018

Why do you want to create an axis with missing_value? It does not make sense
[10, 20, -, 30, 40] What would the depth be for values between 20 an 30 meters in the data array.

@dnadeau4 dnadeau4 self-assigned this Feb 6, 2018
@durack1
Copy link
Member Author

durack1 commented Feb 6, 2018

@dnadeau4 my question may be erroneous, it's likely the array (not the axes) change caused altered by CMOR: replaced missing value flag (-9.99e+33) with standard missing value (1e+20) - is that consistent with your understanding? If yes, then I have to change the missing value of the array I am passing to CMOR (and not the axes)

@dnadeau4
Copy link
Contributor

dnadeau4 commented Feb 6, 2018

You are right, it is not the axes.
When you call "create_variable" in cmor, you have to pass missing_value=-9.99e+33. https://cmor.llnl.gov/mydoc_cmor3_api/#cmor_variable

@durack1
Copy link
Member Author

durack1 commented Feb 6, 2018

@dnadeau4 weird, I did have cmor.variable(outputVarName,d.units,axisIds,missing_value=d.missing) in the call, but the missing value must be wrongly labelled and consequently causing the error..

I'll close this, as it's a non-issue

@durack1 durack1 closed this as completed Feb 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants