Skip to content

Commit

Permalink
rename _md attribute to mda.
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 21, 2014
1 parent 8f50e53 commit 255d5eb
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions mpop/satin/nc_pps_l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class NwcSafPpsChannel(mpop.channel.GenericChannel):

def __init__(self, filename=None):
mpop.channel.GenericChannel.__init__(self)
self._md = {}
self.mda = {}
self._projectables = []
self._keys = []
self._refs = {}
Expand All @@ -81,12 +81,12 @@ def read(self, filename, load_lonlat=True):

rootgrp = Dataset(filename, 'r')
for item in rootgrp.ncattrs():
self._md[item] = getattr(rootgrp, item)
self.mda[item] = getattr(rootgrp, item)

self._md["satellite"] = rootgrp.platform
self._md["orbit"] = rootgrp.orbit_number
self.mda["satellite"] = rootgrp.platform
self.mda["orbit"] = rootgrp.orbit_number
try:
self._md["time_slot"] = datetime.strptime(rootgrp.start_time[:-2],
self.mda["time_slot"] = datetime.strptime(rootgrp.start_time[:-2],
"%Y%m%dT%H%M%S")
except AttributeError:
LOG.debug("No time information in product file!")
Expand Down Expand Up @@ -119,11 +119,11 @@ def read(self, filename, load_lonlat=True):
dset_found = True
break
if not dset_found:
self._md[var_name] = var[:]
self.mda[var_name] = var[:]
# try:
# self._md[var_name] = var[:].filled(0)
# self.mda[var_name] = var[:].filled(0)
# except AttributeError:
# self._md[var_name] = var[:]
# self.mda[var_name] = var[:]
continue

setattr(self, var_name, InfoObject())
Expand Down Expand Up @@ -160,7 +160,7 @@ def read(self, filename, load_lonlat=True):
return

def project(self, coverage):
"""Projct the data"""
"""Project the data"""
LOG.debug("Projecting channel %s..." % (self.name))
import copy
res = copy.copy(self)
Expand Down Expand Up @@ -429,7 +429,6 @@ def __init__(self, filename=None):

def get_lonlat(filename):
"""Read lon,lat from netCDF4 CF file"""
import numpy as np
from netCDF4 import Dataset

col_indices = None
Expand Down

0 comments on commit 255d5eb

Please sign in to comment.