Skip to content

Commit

Permalink
Fixed polar-stereographic projection bugs, thanks to Ron Goodson
Browse files Browse the repository at this point in the history
  • Loading branch information
loerum committed Feb 26, 2015
1 parent 4623f55 commit 2b33644
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions mpop/imageo/formats/ninjotiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,15 +677,20 @@ def write(image_data, output_fn, area_def, product_name=None, **kwargs):
options = {}
options['meridian_west'] = upper_left[0]
options['meridian_east'] = lower_right[0]
if area_def.proj_dict.has_key('lat_0'):
options['ref_lat1'] = area_def.proj_dict['lat_0']
options['ref_lat2'] = 0
if kwargs['projection'].endswith("POL"):
if area_def.proj_dict.has_key('lat_ts'):
options['ref_lat1'] = area_def.proj_dict['lat_ts']
options['ref_lat2'] = 0
else:
if area_def.proj_dict.has_key('lat_0'):
options['ref_lat1'] = area_def.proj_dict['lat_0']
options['ref_lat2'] = 0
if area_def.proj_dict.has_key('lon_0'):
options['central_meridian'] = area_def.proj_dict['lon_0']
if area_def.proj_dict.has_key('a'):
options['radius_a'] = area_def.proj_dict['a']
if area_def.proj_dict.has_key('b'):
options['radius_b'] = area_def.proj_dict['a']
options['radius_b'] = area_def.proj_dict['b']
options['origin_lon'] = upper_left[0]
options['origin_lat'] = upper_left[1]
options['min_gray_val'] = image_data.min()
Expand Down

0 comments on commit 2b33644

Please sign in to comment.