Skip to content

Conversation

@jkrasting
Copy link
Contributor

@jkrasting jkrasting commented May 15, 2020

  • Option to select 'land' or 'ocean' emphasis
  • Requires an update to the PROJ library and use of
    a new projection (imh_o)
  • Ocean view works best with central_longitude=-160.

IGH Default View:

proj = ccrs.InterruptedGoodeHomolosine()

imh_default_view

IGH New Optional Ocean View:

proj = ccrs.InterruptedGoodeHomolosine(central_longitude=-160,emphasis='ocean')

imh_ocean_view

Rationale

This update provides new functionality for oceanographic plots that was not previously possible with the land-only focus of the current IGH projection.

Implications

None.

@SciTools-assistant SciTools-assistant added Blocked: CLA needed See https://scitools.org.uk. Submit the form at: https://scitools.org.uk/cla/v4/form and removed Blocked: CLA needed See https://scitools.org.uk. Submit the form at: https://scitools.org.uk/cla/v4/form labels May 15, 2020
"""
input_point_nans = np.isnan(x) | np.isnan(y)
input_point_nans = np.isnan(x) | np.isnan(y) | \
np.isinf(x) | np.isinf(y)

Choose a reason for hiding this comment

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

E127 continuation line over-indented for visual indent

@QuLogic
Copy link
Member

QuLogic commented Jul 2, 2020

Now that Proj 7.1.0 is out, we can add this. However, it will need a check that the version of Proj is new enough, like EqualEarth. It will also need an entry in the docs in docs/make_projection.py and docs/source/crs/projections.rst, and the what's new docs/whats_new.rst.

@jkrasting
Copy link
Contributor Author

jkrasting commented Jul 6, 2020 via email

@QuLogic
Copy link
Member

QuLogic commented Jul 7, 2020

No specific plans, but probably not for a couple months.

@jkrasting
Copy link
Contributor Author

@QuLogic - I added in a PROJ version check and updated the documentation. I didn't see a whats_new.rst file for the an new version, however.

@jkrasting
Copy link
Contributor Author

image

@QuLogic
Copy link
Member

QuLogic commented Jan 19, 2021

Can you rebase to get working CI, and ensure that tests are passing?

@jkrasting
Copy link
Contributor Author

I rebased against the current master branch @QuLogic. I also squashed into a single commit.

@jkrasting
Copy link
Contributor Author

@QuLogic - I don't really understand the tests well enough to understand how this is failing. Are you able to help me?

Copy link
Contributor

@greglucas greglucas left a comment

Choose a reason for hiding this comment

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

Looks like this is really close. The minimum version test is currently failing due to an old proj being used. You'll need to add a pytest.skipif to check versions for this, something similar to this:

@pytest.mark.skipif(ccrs.PROJ4_VERSION < (5, 2, 0),
reason='Proj is too old.')

But probably within the parameterized function itself rather than as a decorator.

Do you want to add an image comparison for the new projection?

Features
--------

* John Krasting added the ability to use the oceanic view
Copy link
Contributor

Choose a reason for hiding this comment

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

This is for the previous release What's New. We generally make this while doing the release. You can add yourself to the contributors list now though.
https://github.com/SciTools/cartopy/blob/master/docs/source/contributors.rst

"""
Parameters
----------
central_longitude: optional
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
central_longitude: optional
central_longitude : float, optional

All of these should have a space after the name, then the type, followed by optional. See here for the parameter spec: https://numpydoc.readthedocs.io/en/latest/format.html#parameters

@jkrasting
Copy link
Contributor Author

Thanks for your help @greglucas! In regard to this suggestion:

Do you want to add an image comparison for the new projection?

Did you mean add a figure in lib/cartopy/tests/mpl/baseline_images/mpl/test_crs or are you suggesting something different?

@greglucas
Copy link
Contributor

Yes, I think that would be a good place for it. Just to make sure the image for the ocean view is coming out as you expect.

@jkrasting jkrasting force-pushed the dev/igh_o branch 3 times, most recently from 5416edd to 1bc6542 Compare June 11, 2021 15:51
@jkrasting
Copy link
Contributor Author

@greglucas - thanks for the feedback. I think everything is addressed now. This PR is blocked again from running the CI, but everything seems to check out OK on my fork: https://github.com/jkrasting/cartopy/actions/runs/929096625

Copy link
Contributor

@greglucas greglucas 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 this is a nice addition and good to go. I'll hold off merging for a few days in case anyone else has comments/suggestions on it.

@jkrasting
Copy link
Contributor Author

I think this is a nice addition and good to go. I'll hold off merging for a few days in case anyone else has comments/suggestions on it.

Thanks for your help @greglucas. Looking forward to seeing this in a future release!

@QuLogic
Copy link
Member

QuLogic commented Aug 6, 2021

Can you rebase to fix the conflicts?

- The ocean emphasis for the Interrupted Goode
  Homolosine projection (imh_o) requires proj
  version 7.1.0 or later.
- Option to select 'land' or 'ocean' emphasis
- Increaed n resolution from 31 points to 91 points
- Added docstring for class
- Added images of both land and ocean views
- Applies to InterruptedGoodeHomolosine views
- Added tests for ocean view in addition to
  the existing land view
- Values should be the same for both views
- While the emphasis="land" option is the default,
  these modifications will ensure that the MPL
  tests are always run with the option.
- The Interrupted Goode Homolosine ocean
  projection requires Proj version 7.1.0
  or greater.
- Added tests for both land and ocean
- Follows NumPy formatting
@jkrasting
Copy link
Contributor Author

Yes, just rebased now.

@jkrasting
Copy link
Contributor Author

@greglucas, @QuLogic - looks like this needs a workflow approval for parts of the CI to run.

@QuLogic QuLogic added this to the 0.20 milestone Aug 9, 2021
@QuLogic
Copy link
Member

QuLogic commented Aug 9, 2021

Thanks @jkrasting!

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.

5 participants