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

Fixes and Improvements to WCSAxes #9392

Merged
merged 39 commits into from
Oct 26, 2019
Merged

Conversation

Cadair
Copy link
Member

@Cadair Cadair commented Oct 17, 2019

This PR is a collection of WCSAxes related fixes, primarily focusing on APE 14 and 1D plotting.

It does the following things:

astropy/wcs/utils.py Outdated Show resolved Hide resolved
@Cadair Cadair force-pushed the wcsaxes_ndcube_fixes branch 2 times, most recently from 48192ff to 4aacd74 Compare October 21, 2019 16:39
@Cadair Cadair marked this pull request as ready for review October 21, 2019 16:59
Copy link
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So does changing back to including all coordinates in ax.coords not break any existing tests?!

Otherwise just a few comments below, but overall I'm 👍 on this

@bsipocz bsipocz added this to the v4.0 milestone Oct 21, 2019
@Cadair
Copy link
Member Author

Cadair commented Oct 22, 2019

Given the addition of the auto spine selection for 1D plots, I have made a change here which by default plots the physical type (and for scalar axes unit) as an axis label. This primarily so that it is easy to identify which spatial axis is which, but is also obviously more generally useful.

This is a reasonably large change to the default behaviour, so I would be happy to add it only to the 1D plots if people think that's a good idea. @astrofrog @larrybradley

Copy link
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks great (just a couple of comments below). Regarding the auto-labelling, I think this would be a good improvement to make. I know it would 'break' some existing plots where people don't want axis labels, but I'm thinking that's a pretty narrow use case as probably the majority of people will be using it with labels and won't see the difference?

However I think it's very important we document this well - both in the wcsaxes docs and in the what's new, so could you add both of these to this PR?

@larrybradley - do you agree about enabling the auto-labelling?

astropy/visualization/wcsaxes/coordinate_helpers.py Outdated Show resolved Hide resolved
astropy/wcs/utils.py Show resolved Hide resolved
Copy link
Member

@larrybradley larrybradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the auto labeling is fine. For those who may not want axis labels, can we add an simple example/docs showing how to turn off the automatic labels?

@Cadair
Copy link
Member Author

Cadair commented Oct 23, 2019

New reference images are in astropy/astropy-data#76 also I wrote a script to generate them: astropy/astropy-tools#141

I will add a section to the narrative docs about disabling autolabel

@Cadair
Copy link
Member Author

Cadair commented Oct 23, 2019

Small doc section added, let me know if you think it should be expanded.

@bsipocz
Copy link
Member

bsipocz commented Oct 23, 2019

@Cadair - please update to use the new images, I've just merged your PR in astropy-data.

@Cadair
Copy link
Member Author

Cadair commented Oct 24, 2019

According to @astrofrog in chat yesterday I put them in the wrong dir. I will issue a new data PR to move them.

@Cadair
Copy link
Member Author

Cadair commented Oct 24, 2019

astropy/astropy-data#77

astrofrog and others added 9 commits October 25, 2019 11:52
If we had a split coupled SLLWCS it broke
…t WCS

In addition to this, the generation of the coord_map is handled correctly if a
SlicedLowLevelWCS object and the slices argument are specified, where previously
this would cause errors because of incorrect mapping between WCSAxes sliced WCS
and the input WCS.
This means that for 1D plots the world axis which has the highest derivative is
plotted on the bottom axes by default.
@Cadair
Copy link
Member Author

Cadair commented Oct 25, 2019

slumps back into a chair

I think this is now ready for final review.

Cadair added a commit to Cadair/astropy-data that referenced this pull request Oct 25, 2019
Copy link
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, thanks! A few small things/issues related to the reference images:

  • the reference image for test_changed_axis_units and test_minor_ticks looks wrong - the label for dec is on the wrong side
  • the test_noncelestial_angular reference image has confusing labels - both are the same
  • Is there a y label missing for test_direct_init or is it just out of the figure bounds? Maybe you can just turn off auto-labelling for that one too?
  • I wonder if we should turn off the auto-labelling for elliptical frames, the test_elliptical_frame example shows that it's maybe not ideal?
  • can you edit the test_axisbelow test to turn off autolabelling to limit a bit how many reference images are changed? (that one is a particularly prolific test)
  • there are reference images added for test_axes_off that are empty
  • for test_tick_params the unit bracket is empty so maybe not worth showing that bracket when unit is empty? also maybe disable auto-labelling for that test since it's really about the ticks
  • for test_update_clip_path_change_wcsandtest_update_clip_path_rectangular`` same comment, unit is empty but actually maybe just turn off auto-labelling
  • for test_update_clip_path_nonrectangular keep the auto-labelling but this one can be the test for when the unit is empty?

Cadair added a commit to Cadair/astropy-data that referenced this pull request Oct 25, 2019
@Cadair
Copy link
Member Author

Cadair commented Oct 25, 2019

I have updated the data PR, although i haven't modified the figure for #9411

Copy link
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, so approving - however I will deal with merging the PR for the reference images tomorrow, which is needed for the CI to pass here. I'll do it over the weekend to avoid disrupting other PRs.

astrofrog pushed a commit to Cadair/astropy-data that referenced this pull request Oct 26, 2019
@astrofrog astrofrog added the 💤 merge-when-ci-passes Do not use: We have auto-merge option now. label Oct 26, 2019
@mhvk mhvk merged commit c5d03e3 into astropy:master Oct 26, 2019
@Cadair
Copy link
Member Author

Cadair commented Oct 27, 2019

Thanks everyone!!

@Cadair Cadair deleted the wcsaxes_ndcube_fixes branch October 27, 2019 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WCSAxes no longer has an entry for every world dimension in CoordinatesMap
5 participants