Hi Roger,
the problem is with your code. You cannot just declare your bounds to be
contiguous. Instead, `is_contiguous` is a function of the coords that
checks whether they have bounds and whether these bounds are contiguous.
Take a look at the documentation of `is_contiguous` at [1,2] for
dimensional coords and auxiliary coords respectively.
With your lines of
```
coord.is_contiguous = True
```
you effectively remove this method, putting a simple `bool` variable in
its place; then when iris tries to call the method it stumbles over the
variable.
Good news is, simply removing the four lines that end in `.is_contiguous
= True` should make it work.
So far so good. Allow me to make some more comments on your code though.
Your code suggests that the coordinates already have bounds to begin
with; why assign `None` to them first otherwise? In that case it seems
questionable to remove them, since probably they are as they are for a
reason and you risk replacing them with wrong bounds that don't fit the
data.
If you insist on doing this (perhaps you know for a fact that the
existing bounds are erroneous?), you can use local variables to simply
the code. I would write in this situation:
```
lat = Y_annual_mean.coord('latitude')
lat.bounds = None
lat.guess_bounds()
```
and similarly for the other three coords. Indeed, since all coords
receive the same treatment, a short function is in order, something like
```
def replace_bounds(coord):
coord.bounds = None
coord.guess_bounds()
replace_bounds(Y_annual_mean.coord('latitude')
replace_bounds(Y_annual_mean.coord('longitude')
replace_bounds(X_annual_mean.coord('latitude')
replace_bounds(X_annual_mean.coord('longitude')
```
there, much clearer, don't you think?
Hope that helps.
Cheers
Klaus
[1]
https://scitools.org.uk/iris/docs/latest/iris/iris/coords.html#iris.coords.DimCoord.is_contiguous
[2]
https://scitools.org.uk/iris/docs/latest/iris/iris/coords.html#iris.coords.AuxCoord.is_contiguous
> --
> You received this message because you are subscribed to the Google
> Groups "SciTools (iris, cartopy, cf_units, etc.) -
>
https://github.com/scitools" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
scitools-iri...@googlegroups.com
> <mailto:
scitools-iri...@googlegroups.com>.
> To view this discussion on the web, visit
>
https://groups.google.com/d/msgid/scitools-iris/64e5e541-d38b-42ad-96c2-706f13b0f719%40googlegroups.com
> <
https://groups.google.com/d/msgid/scitools-iris/64e5e541-d38b-42ad-96c2-706f13b0f719%40googlegroups.com?utm_medium=email&utm_source=footer>.