Skip to content
Browse files

support for rimo instead of instrument db

  • Loading branch information...
1 parent 68eca93 commit 8dad7e279d9fa25cdc838c8355a1b1a11ce04cb4 @zonca committed
Showing with 20 additions and 4 deletions.
  1. +10 −2 planck/LFI.py
  2. +9 −2 planck/pointing.py
  3. +1 −0 planck/ps.py
View
12 planck/LFI.py
@@ -49,7 +49,10 @@ def wn(self):
return self.get_instrument_db_field('net_KCMB')
def get_instrument_db_field(self, field):
- return self.inst.instrument_db(self)[field][0]
+ try:
+ return self.inst.instrument_db(self)[field][0]
+ except exceptions.ValueError:
+ return self.inst.instrument_db(self)[field.upper()][0]
def __getitem__(self, n):
return self.d[n]
@@ -98,9 +101,14 @@ def RCA_from_tag(tag):
def instrument_db(self,ch):
if not hasattr(self,'_instrument_db') or self._instrument_db is None:
import pyfits
+ if isinstance(self.instrument_db_file, list):
+ self.instrument_db_file = self.instrument_db_file[0]
self._instrument_db = np.array(pyfits.open(self.instrument_db_file,ignore_missing_end=True)[1].data)
l.warning('Loading instrumentdb %s' % self.instrument_db_file)
- det_index, = np.where([rad.strip().endswith(ch.tag) for rad in self._instrument_db['Radiometer']])
+ try:
+ det_index, = np.where([rad.strip().endswith(ch.tag) for rad in self._instrument_db['Radiometer']])
+ except exceptions.ValueError:
+ det_index, = np.where([rad.strip().endswith(ch.tag) for rad in self._instrument_db['DETECTOR']])
return self._instrument_db[det_index]
@property
View
11 planck/pointing.py
@@ -14,6 +14,7 @@
import correction
import glob
import os
+import exceptions
class IDBSiam:
def __init__(self, instrument_db, obt, Pxx=False):
@@ -24,10 +25,16 @@ def __init__(self, instrument_db, obt, Pxx=False):
l.warning("Using IDB: " + os.path.basename(instrument_db))
self.uv_angles = {}
for row in np.array(pyfits.open(instrument_db)[1].data):
- radtag = row["Radiometer"].strip()
+ try:
+ radtag = row["Radiometer"].strip()
+ except exceptions.IndexError:
+ radtag = row["DETECTOR"].strip()
self.uv_angles[radtag] = {}
for fi in ["theta_uv","phi_uv","psi_uv","psi_pol"]:
- self.uv_angles[radtag][fi]=np.radians(row[fi])
+ try:
+ self.uv_angles[radtag][fi]=np.radians(row[fi])
+ except exceptions.IndexError:
+ self.uv_angles[radtag][fi]=np.radians(row[fi.upper()])
if Pxx:
self.uv_angles[radtag]["psi_uv"]=0
self.uv_angles[radtag]["psi_pol"]=0
View
1 planck/ps.py
@@ -38,6 +38,7 @@ def smooth(m, arcmin, lmax = None):
config['infile'] = 'tempmap.fits'
config['outfile'] = 'tempmap_smoothed.fits'
config['fwhm_arcmin'] = arcmin
+ config['iter_order'] = 3
config.write()
if os.path.exists('tempmap_smoothed.fits'):
os.remove('tempmap_smoothed.fits')

0 comments on commit 8dad7e2

Please sign in to comment.
Something went wrong with that request. Please try again.