diff --git a/mpop/satin/nc_reader.py b/mpop/satin/nc_reader.py index 78d659f0..5f454ee7 100644 --- a/mpop/satin/nc_reader.py +++ b/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, @@ -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): diff --git a/mpop/satout/cfscene.py b/mpop/satout/cfscene.py index 4bcae149..96248d9f 100644 --- a/mpop/satout/cfscene.py +++ b/mpop/satout/cfscene.py @@ -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) @@ -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. """