Skip to content

Commit

Permalink
Merge branch 'unstable' of ssh://safe/data/proj/SAF/GIT/mpop into uns…
Browse files Browse the repository at this point in the history
…table
  • Loading branch information
mraspaud committed Mar 10, 2014
2 parents f12e91c + f6873ca commit 06f280a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
7 changes: 5 additions & 2 deletions mpop/satin/nc_reader.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010, 2011, 2012.
# Copyright (c) 2010, 2011, 2012, 2014.

# SMHI,
# Folkborgsvägen 1,
Expand Down Expand Up @@ -67,7 +67,10 @@
"geostationary": "geos",
"albers_conical_equal_area": "aea",
"azimuthal_equidistant": "aeqd",

"equirectangular": "eqc",
"transverse_mercator": "tmerc",
"stereographic": "stere",
"general_oblique_transformation": "ob_tran"
}

def _load02(filename):
Expand Down
17 changes: 16 additions & 1 deletion mpop/satout/cfscene.py
Expand Up @@ -374,7 +374,8 @@ def proj2cf(proj_dict):
"merc": merc2cf,
"aea": aea2cf,
"laea": laea2cf,
"ob_tran": obtran2cf,}
"ob_tran": obtran2cf,
"eqc": eqc2cf,}

return cases[proj_dict["proj"]](proj_dict)

Expand All @@ -390,6 +391,20 @@ def geos2cf(proj_dict):
"perspective_point_height": eval(proj_dict["h"])
}

def eqc2cf(proj_dict):
"""Return the cf grid mapping from a eqc proj dict. However, please be
aware that this is not an official CF projection. See
http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.4/apf.html.
"""

return {"grid_mapping_name": "equirectangular",
"latitude_of_true_scale": eval(proj_dict.get("lat_ts", "0")),
"latitude_of_projection_origin": eval(proj_dict["lat_0"]),
"longitude_of_projection_origin": eval(proj_dict["lon_0"]),
"false_easting": eval(proj_dict.get("x_0", "0")),
"false_northing" : eval(proj_dict.get("y_0", "0"))
}

def stere2cf(proj_dict):
"""Return the cf grid mapping from a stereographic proj dict.
"""
Expand Down

0 comments on commit 06f280a

Please sign in to comment.