Beispiel #1
0
def get_ba(cubes):
    '''
    Return an array of b/a of the given cubes. 
    '''
    ba = []
    for f in cubes:
        print 'Computing b/a for %s' % f
        _K = fitsQ3DataCube(f)
        _pa, _ba = _K.getEllipseParams()
        ba.append(_ba)
    return np.array(ba)
Beispiel #2
0
    def readCALIFACube(self, fitsFile = False):
        self._initVars()

        if fitsFile:
            self.fitsFile = fitsFile

        self.K = fitsQ3DataCube(self.fitsFile)

        self.maskEmLines = np.ones_like(self.K.l_obs, dtype = np.bool)
        self.maskQFlag = self.maskEmLines
        self.maskLambdaConstrains = self.maskEmLines

        self._setVars()
Beispiel #3
0
 def __init__(self, db, target_vd=None, grating='none', nproc=None):
     IFSDecomposer.__init__(self)
     if grating == 'V500':
         disp_FWHM = self.dispFWHM_V500
     elif grating == 'V1200':
         disp_FWHM = self.dispFWHM_V1200
     elif grating == 'none':
         disp_FWHM = None
     else:
         raise Exception('Unknown grating type %s' % grating)
     self.name = califa_id_from_cube(db)
     self.K = fitsQ3DataCube(db, smooth=True)
     self.flux_unit = self.K.keywords['FLUX_UNIT']
     flux, error, flags, vel_FWHM = self._fixKinematics(target_vd, disp_FWHM, nproc)
     if disp_FWHM is not None:
         wl_FWHM = np.sqrt(vel_FWHM**2 + disp_FWHM**2)
     else:
         wl_FWHM = None
     logger.debug('Computing IFS from voronoi zone spectra...')
     flux = self.K.zoneToYX(flux, extensive=True, surface_density=False)
     error = self.K.zoneToYX(error, extensive=True, surface_density=False)
     flags = self.K.zoneToYX(flags, extensive=False).filled(True)
     self.loadData(self.K.l_obs, flux, error, flags, wl_FWHM)