-
Notifications
You must be signed in to change notification settings - Fork 279
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
Rolling cubes #83
Comments
Hey Matthew, welcome to github! Thanks for reporting/suggesting this. Obviously the code you have provided has some significant limitations, but is clearly useful in some cases. FYI There is already a discussion going on about bounding box extractions, for which this would make a good usecase (at #77). I agree that there is a need for this functionality, especially with regards to analysis. It should be noted that I am currently working on a tool which should make visualisation of data much easier (on a map) in its native coordinate system, avoiding the need to transform the coordinate system of the underlying data (which the example code is doing). All the best, |
Welcome, @msmizielinski ! |
I have at least two other users on previous occasions who have also reported a need for this so I think it is definitely a common requirement and a necessary enhancement |
No one wants to modify a Cube like this as an end in itself - it's a means to an end. As @pelson suggests, there may be other changes which would remove the need to do this, so it's worth considering why this is being done so we can best address the real need. |
The underlying issue here is that a safe extraction is required irrespective of whether it over the meridian or not. This is what needs to be addressed. In addition to this, it would be useful to be able to modify the plotting region so that you don't have data on either side with nothing at the centre. There is another user who has contacted Ian in regards to this issue. This is now 4+ users who require to extract a region over a longitudinal boundary and adjust the plot so that it is not split. |
Sounds like the 4+ users might be best served by:
|
+1 |
I don't disagree that this is desirable. But I do want to stress that the "contiguous dataset" is not a requirement to do a lot of analyses (masking would work equally well in a large number of cases. Where it wouldn't work might be in gradients and other "connectivity" related analyses). |
I believe I need the "contiguous dataset" solution for outputting the data array in a more primitive file format (geotiff #224). The data must be arranged sequentially from -180:180. |
It's time to nail this down into a concrete plan. I suggest:
So. Is this solution acceptable? Is it flawed? Are there any nicer alternatves? |
Moving to the discussion forum https://groups.google.com/forum/#!topic/scitools-iris-dev/puXL8oTjNlw |
Updating @cpelley's function to work with iris v1.1/v1.2:
|
Also see this topic for a comment on the |
Also see this ticket for a related issue. |
I'd like to submit a PR to address this issue so I've posted to the corresponding iris-dev discussion topic. |
When working with global fields it is occasionally useful to extract data across the longitude boundary, for example when attempting to extract the region 30W-30E. At the moment it is not straightforward to extract such a region in iris (for plotting or analysis), but Carwyn (cpelley) has provided a solution using the following code
after which a suitably phrased constraint can be used to extract the data from the cube extb.
The numpy method to "roll" an array along an index could be directly implemented within the cube object allowing this task to be performed more easily. Such a method could also be very useful in preparing global fields to be plotted with the most important region centred.
The text was updated successfully, but these errors were encountered: