Skip to content

Conversation

@dopplershift
Copy link
Contributor

This picks back up #456 and fixes #339 and #455

  • added scale_factor to Stereographic projection.
  • warnings when true_scale_latitude is used with non-polar
    stereographic projections
  • test_stereographic extended

cc @QuLogic since you reviewed this previously

Copy link
Member

@pelson pelson 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. Probably needs a rebase to get the tests passing. Otherwise, 👍

@pelson
Copy link
Member

pelson commented Jan 11, 2018

@dopplershift - no doubt you're running around like crazy with AMS, but if you get a chance, I think this just needs a rebase.

Fixes SciTools#339 and SciTools#455
- added scale_factor to Stereographic projection.
- warnings when true_scale_latitude is used with non-polar
  stereographic projections
- test_stereographic extended

class NorthPolarStereo(Stereographic):
def __init__(self, central_longitude=0.0, globe=None):
def __init__(self, central_longitude=0.0, true_scale_latitude=None, globe=None):

Choose a reason for hiding this comment

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

E501 line too long (84 > 79 characters)

central_latitude=90,
central_longitude=central_longitude, globe=globe)
central_longitude=central_longitude,
true_scale_latitude=true_scale_latitude, # None is equivalent to +90

Choose a reason for hiding this comment

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

E261 at least two spaces before inline comment
E501 line too long (80 > 79 characters)


class SouthPolarStereo(Stereographic):
def __init__(self, central_longitude=0.0, globe=None):
def __init__(self, central_longitude=0.0, true_scale_latitude=None, globe=None):

Choose a reason for hiding this comment

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

E501 line too long (84 > 79 characters)

central_latitude=-90,
central_longitude=central_longitude, globe=globe)
central_longitude=central_longitude,
true_scale_latitude=true_scale_latitude, # None is equivalent to -90

Choose a reason for hiding this comment

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

E261 at least two spaces before inline comment
E501 line too long (80 > 79 characters)

@dopplershift
Copy link
Contributor Author

Done.

Yeah, AMS was pretty crazy--but amazing.

central_latitude=90,
central_longitude=central_longitude, globe=globe)
central_longitude=central_longitude,
true_scale_latitude=true_scale_latitude, # None is +90

Choose a reason for hiding this comment

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

E261 at least two spaces before inline comment

central_latitude=-90,
central_longitude=central_longitude, globe=globe)
central_longitude=central_longitude,
true_scale_latitude=true_scale_latitude, # None is -90

Choose a reason for hiding this comment

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

E261 at least two spaces before inline comment

('lon_0', central_longitude),
('x_0', false_easting), ('y_0', false_northing)]

if true_scale_latitude:
Copy link
Member

Choose a reason for hiding this comment

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

It's old, but should this be is not None? Since the *PolarStereo comments say defaults are not 0, it seems like you might want to pass a true scale latitude of 0, and that would be ignored with the code like this. Or is that basically useless since 0 is at the border?

Copy link
Contributor Author

@dopplershift dopplershift Jan 13, 2018

Choose a reason for hiding this comment

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

Of course you find that after I think I'm done. 😁 Checking for None makes sense to me since the latitude is float anyway--checking just for 0 is worthless.

@QuLogic
Copy link
Member

QuLogic commented Jan 12, 2018

@pelson How are you going to proceed when the original author never submitted a CLA?

@pelson
Copy link
Member

pelson commented Jan 12, 2018

#456 (comment) suggests this was resolved. This is also reflected in https://github.com/SciTools/scitools.org.uk/blob/gh-pages/contributors.json#L36. I'll need to do some digging to figure out why the CLA check is failing.

@dopplershift dopplershift force-pushed the fix_issues_339_455 branch 2 times, most recently from 1e282c4 to 1405f2e Compare January 15, 2018 19:49
@dopplershift
Copy link
Contributor Author

Alright, finally green (minus CLA).

Copy link
Member

@pelson pelson left a comment

Choose a reason for hiding this comment

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

I've suggested a few tweaks. But am happy in general with this. thanks @dopplershift 👍

if true_scale_latitude is not None:
warnings.warn('It does not make sense to provide both '
'"scale_factor" and "true_scale_latitude". '
'Ignoring "scale_factor".')
Copy link
Member

Choose a reason for hiding this comment

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

I've just realised that this is new behaviour - I'd support this being an exception, not a warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense.

'the use of "scale_factor" instead.')
proj4_params.append(('lat_ts', true_scale_latitude))

if scale_factor:
Copy link
Member

Choose a reason for hiding this comment

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

I'd be more comfortable if we checked None explicitly. (I know scale_factor=0 doesn't really make any sense, but I'd rather not ignore it silently.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

@dopplershift dopplershift added this to the 0.16 milestone Jan 18, 2018
Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

Assuming @pelson can figure out the CLA.

@QuLogic
Copy link
Member

QuLogic commented Jan 26, 2018

Ping @pelson? Last thing for 0.16...

@ajdawson
Copy link
Member

Just looks like the ID used to make the commit is not the same as the Github username. Can either get the original author to make the association to please the CI tool, or just take it that this commit obviously came from that person who we have a CLA for.

@QuLogic
Copy link
Member

QuLogic commented Feb 2, 2018

Well, I'm merging this then.

@QuLogic QuLogic merged commit 6f56b97 into SciTools:master Feb 2, 2018
@dopplershift dopplershift deleted the fix_issues_339_455 branch February 26, 2018 23:17
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.

Remove the "true_scale_latitude" parameter to Stereographic.

5 participants