Conversation
…is avoids ever needing a world-to-pixel transformation which is ill-defined if distortions are present or when slicing a cube.
@ChrisBeaumont - this is ready for testing in Glue if you are interested. You now no longer need the
if you want to show a grid, you can, but when you call Regardless of the grid type, all other transformations are now pixel to world, so should work on any arbitrary slices and images with distortions! |
cool, will try to look at this tomorrow |
Playing with this now, a few things seem broken:
I'll keep investigating
|
@ChrisBeaumont - can you share the file? |
https://www.dropbox.com/s/wpr4wfavrif0q9u/12co.fits On Mon, Apr 21, 2014 at 4:01 PM, Thomas Robitaille <notifications@github.com
Chris Beaumont |
@ChrisBeaumont - the solution turned out to be very simple - the slices argument is in the wrong order, so you are getting velocity ticks (which explains the values). Try using |
@ChrisBeaumont - I nevertheless found a few small things that should be fixed - namely that in this case, only the ticks for the non-sliced coordinate should be shown by default. I've pushed a fix. |
self.coords[1].set_axislabel_position('l') | ||
self.coords[0].set_ticklabel_position('b') | ||
self.coords[1].set_ticklabel_position('l') | ||
for coord_index in range(len(slices)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a graceful fallback here for slices=None. Something like for coord_index in range(len(slices or []))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -9,7 +9,7 @@ def wrap_180(values): | |||
return values_new | |||
|
|||
|
|||
def find_coordinate_range(transform, extent, x_type='scalar', y_type='scalar'): | |||
def find_coordinate_range(transform, extent, coord_types): | |||
''' | |||
Find the range of coordinates to use for ticks/grids | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extent isn't iterable, but list-like (you need random access)
I proposed some improvements and a bugfix in #25, but otherwise this looks good to me! |
This is work in progress, and includes the refactoring carried out during the ALMA software development workshop at NRAO.
cc @ChrisBeaumont - there are still a couple of things to add, but this will then be ready for you to test with glue and optimize if needed.