Skip to content

Commit

Permalink
Merge 7c4d7d6 into 886a8df
Browse files Browse the repository at this point in the history
  • Loading branch information
pnuu committed Jun 3, 2014
2 parents 886a8df + 7c4d7d6 commit 500d0bf
Showing 1 changed file with 6 additions and 43 deletions.
49 changes: 6 additions & 43 deletions mpop/satin/aapp1b.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@
from ConfigParser import ConfigParser
from mpop import CONFIG_PATH

<<<<<<< HEAD
LOGGER = logging.getLogger('aapp1b')
=======
logger = logging.getLogger('aapp1b')
>>>>>>> upstream/pre-master

def load(satscene, *args, **kwargs):
"""Read data from file and load it into *satscene*.
Expand All @@ -63,11 +59,8 @@ def load(satscene, *args, **kwargs):

options["calibrate"] = kwargs.get("calibrate", True)

<<<<<<< HEAD
LOGGER.info("Loading instrument '%s'" % satscene.instrument_name)
=======
logger.info("Loading instrument '%s'" % satscene.instrument_name)
>>>>>>> upstream/pre-master

try:
CASES[satscene.instrument_name](satscene, options)
except KeyError:
Expand All @@ -80,11 +73,8 @@ def load_avhrr(satscene, options):
raise IOError("No filename given, cannot load.")

chns = satscene.channels_to_load & set(AVHRR_CHANNEL_NAMES)
<<<<<<< HEAD
LOGGER.info("Loading channels " + str(sorted(list(chns))))
=======
logger.info("Loading channels " + str(sorted(list(chns))))
>>>>>>> upstream/pre-master

if len(chns) == 0:
return

Expand All @@ -109,11 +99,7 @@ def load_avhrr(satscene, options):

filename = file_list[0]

<<<<<<< HEAD
LOGGER.debug("Loading from " + filename)
=======
logger.debug("Loading from " + filename)
>>>>>>> upstream/pre-master

scene = AAPP1b(filename)
scene.read()
Expand All @@ -124,11 +110,9 @@ def load_avhrr(satscene, options):
try:
from pyresample import geometry
except ImportError, ex_:
<<<<<<< HEAD

LOGGER.debug("Could not load pyresample: " + str(ex_))
=======
logger.debug("Could not load pyresample: " + str(ex_))
>>>>>>> upstream/pre-master

satscene.lat = scene.lats
satscene.lon = scene.lons
else:
Expand Down Expand Up @@ -343,11 +327,8 @@ def read(self):
fp_.seek(10664 * 2, 1)
data = np.fromfile(fp_, dtype=_SCANTYPE)

<<<<<<< HEAD
LOGGER.debug("Reading time " + str(datetime.datetime.now() - tic))
=======
logger.debug("Reading time " + str(datetime.datetime.now() - tic))
>>>>>>> upstream/pre-master

self._header = header
self._data = data

Expand All @@ -361,11 +342,7 @@ def navigate(self):
try:
from geotiepoints import SatelliteInterpolator
except ImportError:
<<<<<<< HEAD
LOGGER.warning("Could not interpolate lon/lats, "
=======
logger.warning("Could not interpolate lon/lats, "
>>>>>>> upstream/pre-master
"python-geotiepoints missing.")
self.lons, self.lats = lons40km, lats40km
else:
Expand All @@ -384,11 +361,7 @@ def navigate(self):
along_track_order,
cross_track_order)
self.lons, self.lats = satint.interpolate()
<<<<<<< HEAD
LOGGER.debug("Navigation time " + str(datetime.datetime.now() - tic))
=======
logger.debug("Navigation time " + str(datetime.datetime.now() - tic))
>>>>>>> upstream/pre-master

def calibrate(self, chns=("1", "2", "3A", "3B", "4", "5"),
calibrate=1):
Expand Down Expand Up @@ -458,11 +431,7 @@ def calibrate(self, chns=("1", "2", "3A", "3B", "4", "5"),
else:
self.units['5'] = ''

<<<<<<< HEAD
LOGGER.debug("Calibration time " + str(datetime.datetime.now() - tic))
=======
logger.debug("Calibration time " + str(datetime.datetime.now() - tic))
>>>>>>> upstream/pre-master


def _vis_calibrate(data, chn, calib_type):
Expand All @@ -479,11 +448,7 @@ def _vis_calibrate(data, chn, calib_type):
return channel

if calib_type == 2:
<<<<<<< HEAD
LOGGER.info("Radiances are not yet supported for " +
=======
logger.info("Radiances are not yet supported for " +
>>>>>>> upstream/pre-master
"the VIS/NIR channels!")

mask1 = channel <= np.expand_dims(data["calvis"][:, chn, 2, 4], 1)
Expand Down Expand Up @@ -545,7 +510,6 @@ def _ir_calibrate(header, data, irchn, calib_type):
bandcor_2 = header['radtempcnv'][0, irchn, 1]/1e5
bandcor_3 = header['radtempcnv'][0, irchn, 2]/1e6

<<<<<<< HEAD
# Count to radiance conversion:
rad = k1_ * count*count + k2_*count + k3_

Expand All @@ -559,10 +523,9 @@ def _ir_calibrate(header, data, irchn, calib_type):
suspect_line_nums = np.repeat(idx[0], all_zero[:, 0])
if suspect_line_nums.any():
LOGGER.info("Suspect scan lines: " + str(suspect_line_nums))
=======

ir_const_1 = 1.1910659e-5
ir_const_2 = 1.438833
>>>>>>> upstream/pre-master

t_planck = (ir_const_2*cwnum) / np.log(1 + ir_const_1*cwnum*cwnum*cwnum/rad)

Expand Down

0 comments on commit 500d0bf

Please sign in to comment.