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

add map_proj = 6 (Lat-lon) #221

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions salem/sio.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ def _wrf_grid_from_dataset(ds):
if ds.PROJ_NAME in ['Lambert Conformal Conic',
'WRF Lambert Conformal']:
proj_id = 1
elif ds.PROJ_NAME in ['polar stereographic']:
proj_id = 2
elif ds.PROJ_NAME in ['mercator']:
proj_id = 3
elif ds.PROJ_NAME in ['LatLon', 'lat-lon', 'LatLong']:
proj_id = 6
else:
proj_id = 99 # pragma: no cover
else:
Expand Down Expand Up @@ -172,6 +178,12 @@ def _wrf_grid_from_dataset(ds):
'+lon_0={center_lon} ' \
'+x_0=0 +y_0=0 +a=6370000 +b=6370000'
p4 = p4.format(**pargs)
elif proj_id == 6:
# Lat-long
p4 = '+proj=eqc ' \
'+lon_0={lon_0} ' \
'+x_0=0 +y_0=0 +a=6370000 +b=6370000'
p4 = p4.format(**pargs)
else:
raise NotImplementedError('WRF proj not implemented yet: '
'{}'.format(proj_id))
Expand Down
5 changes: 5 additions & 0 deletions salem/wrftools.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,11 @@ def geogrid_simulator(fpath, do_maps=True, map_kwargs=None):
pwrf = '+proj=stere +lat_ts={lat_1} +lat_0=90.0 +lon_0={lon_0} ' \
'+x_0=0 +y_0=0 +a=6370000 +b=6370000'
pwrf = pwrf.format(**pargs)
#TODO: not sure how map_proj is converted to this string instead of int?
elif map_proj == 'LATLON':
pwrf = '+proj=eqc +lon_0={lon_0} ' \
'+x_0=0 +y_0=0 +a=6370000 +b=6370000'
pwrf = pwrf.format(**pargs)
else:
raise NotImplementedError('WRF proj not implemented yet: '
'{}'.format(map_proj))
Expand Down