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

Maintain the type of scalars when merging. #18

Closed
pelson opened this issue Aug 7, 2012 · 1 comment
Closed

Maintain the type of scalars when merging. #18

pelson opened this issue Aug 7, 2012 · 1 comment

Comments

@pelson
Copy link
Member

pelson commented Aug 7, 2012

The type of a scalar coordinate is not preserved for scalars:

>>> ml_10 = iris.Constraint(model_level_number=10)
>>> print type(iris.load_strict('/data/local/dataZoo/iris_resources/tests/PP/globClim1/dec_subset.pp', \
...                                                  'air_potential_temperature' & ml_10).coord('sigma'))
<class 'iris.coords.DimCoord'>

>>> print type(iris.load_strict('/data/local/dataZoo/iris_resources/tests/PP/globClim1/dec_subset.pp',  \
...                                                 'air_potential_temperature').extract(ml_10).coord('sigma'))
<class 'iris.coords.AuxCoord'>
@cpelley
Copy link

cpelley commented Apr 24, 2014

This is not an issue with merging. Sigma is not a monotonic coordinate, hence why it is an AuxCoord if we load then extract. Providing two constraints on loading allows it to be deemed monotonic.

For example (coord1 here is not monotonic):
coord1 = [1, 3, 2, 2, 3, 1]
coord2 = [1, 2, 3, 4, 5, 6]

Constrained load based on coord2 values (0, 2, 4) results in a monotonic coord1 coordinate:
coord1 = [1, 2, 3]
coord2 = [1, 3, 5]

So I think the real bug here is that we cannot infer that coord1 is now a dimension coordinate (monotonic) just because we have extracted values that happen to make it monotonic (and therefore a dimension coordinate).

@pelson pelson closed this as completed Jun 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants