Skip to content

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

Description

@durack1

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'

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions