Skip to content

Commit

Permalink
implement save for all cloudproducts.
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>
  • Loading branch information
mraspaud committed Nov 27, 2014
1 parent e8bf5b6 commit 920b955
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions mpop/satin/nc_pps_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,15 @@ def is_loaded(self):
return True
# return len(self._projectables) > 0

def save(self, filename, old=True, **kwargs):
del kwargs
if old:
from nwcsaf_formats.ppsv2014_to_oldformat import write_product
write_product(self, filename)

else:
raise NotImplementedError("Can't save to new pps format yet.")


class PPSReader(Reader):

Expand Down Expand Up @@ -405,14 +414,6 @@ def __init__(self, filename=None):
NwcSafPpsChannel.__init__(self, filename)
self.name = "CT"

def save(self, filename, old=True, **kwargs):
del kwargs
if old:
from nwcsaf_formats.ppsv2014_to_oldformat import write_cloudtype
write_cloudtype(self, filename)

else:
raise NotImplementedError("Can't save to new pps format yet.")

class CloudTopTemperatureHeight(NwcSafPpsChannel):

Expand All @@ -428,15 +429,6 @@ def __init__(self, filename=None):
self.name = "CMA"


def save(self, filename, old=False):
if old:
from nwcsaf_formats.ppsv2014_to_oldformat import write_cloudtype
write_cloudtype(self, filename)

else:
raise NotImplementedError("Can't save to new pps format yet.")


class PrecipitationClouds(NwcSafPpsChannel):

def __init__(self, filename=None):
Expand Down

0 comments on commit 920b955

Please sign in to comment.