Hi Duncan,
do you have a link to the cis discussion as well?
Anyway, the problem, I think, is that you are really fundamentally changing the data:
You already saw that you lose the one dimension coordinate and of course the other one
goes as well if you happen to select values from two columns.
You also lose the implied topological relationship, i.e. the points don't know their neighbors anymore.
These problems are, imho, not mere technicalities, but expressions of the underlying problem which is
that what you describe is usually not the end goal. That would normally be one of two things:
1) Plot(Treat) the selected data in the context of the original data keeping dim coords and topology intact.
2) Calculating some statistic like the mean over the selected data points.
Both use cases can be implemented by masking (as you already pointed out) and I think that is the way to go.
For example with
lat = cube.coord('latitude')
lon = cube.coord('longitude')
selection = (lat.points > 0.) & (lon.points > 4.)
mask = ~selection
the two use cases can be done as
1) cube.data.mask |= mask
2)
grid_areas = iris.analysis.cartography.area_weights(cube)
weights = grid_areas * selection
mean = cube.collapsed(['latitude', 'longitude'], iris.analysis.MEAN, weights=weights)
Of course, 2) here is the area weighted average; if you need it without area weights, simply pass in selection as weights.
Do you think this approach covers your use case?
I think the consistent alternative along the lines of your idea would be to create a one dimensional cube as you suggested,
but then all dim and aux coords should be transformed into one dimensional aux coords accordingly.
Cheers
Klaus