Source
filler = TsysFiller( filename=filename, specif=specif, tsysif=tsysif, extrap=extrap, skip_channelaveraged=skipaveragedspw )
#*******************************************************************************
# ALMA - Atacama Large Millimeter Array
# Copyright (c) NAOJ - National Astronomical Observatory of Japan, 2011
# (in the framework of the ALMA collaboration).
# All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#*******************************************************************************
from scipy.interpolate import interp1d
from taskinit import gentools
import numpy
import string
_tb = gentools(['tb'])[0]
scaling={'GHz':1.0e-9,
'MHz':1.0e-6,
'kHz':1.0e-3,
'Hz':1.0}
#
# fillTsys( filename, specif, tsysif, mode )
#
# high level function to fill Tsys on spectral data
#
# Tsys is processed along the following three steps:
# 1. average within scan
# 2. if possible, linearly interpolate in time.
# 3. interpolate in frequency with specified mode if necessary
#
def fillTsys( filename, specif, tsysif=None, mode='linear', extrap=False, skipaveragedspw=True ):
"""
high level function to fill Tsys on spectral data
Tsys is processed along the following three steps:
1. average within scan
2. if possible, linearly interpolate in time.
3. interpolate in frequency with specified mode
filename -- input filename
specif -- IFNO for spectral data
tsysif -- IFNO for calibration (Tsys) data
default: None (try to find automatically)
options: any integer
mode -- interpolation mode along frequency axis
default: 'linear'
options: 'linear',,'nearest','zero',
'slinear','quadratic','cubic'
any integer specifying an order of
spline interpolation
extrap -- whether enable extrapolation or not