def __init__( self , nlat=3 , nlon=4 , X=None ): super( XSkyMap , self ).__init__() if X == None: if nlat < 3 or nlon < 4: print "Make sure that nlat >=3, and nlon >=4." raise ValueError else: self._SkyMap__X = numpy.zeros( ( nlat , nlon ) , dtype='complex' ) self._SkyMap__sky = LISAresponse.mySpharmt( nlon , nlat ) else: nlat , nlon = X.shape self._SkyMap__X = numpy.copy( X ) self._SkyMap__sky = LISAresponse.mySpharmt( nlon , nlat ) return
def __init__(self, nlat=3, nlon=4, X=None): super(XSkyMap, self).__init__() if X == None: if nlat < 3 or nlon < 4: print "Make sure that nlat >=3, and nlon >=4." raise ValueError else: self._SkyMap__X = numpy.zeros((nlat, nlon), dtype='complex') self._SkyMap__sky = LISAresponse.mySpharmt(nlon, nlat) else: nlat, nlon = X.shape self._SkyMap__X = numpy.copy(X) self._SkyMap__sky = LISAresponse.mySpharmt(nlon, nlat) return
def getPixels(self): nlat = self.ntrunc + 30 nlon = 2*(nlat - 1) self.sky = LISAresponse.mySpharmt(nlon,nlat) if self.maptype in ['X','XX']: norm = 1e-45 elif self.maptype in ['P']: norm = 1 xlm = self.getMultipleMoments('p') * norm plm = self.getRealMultipleMoments('p') * norm qlm = self.getImagMultipleMoments('p') * norm self.pix = self.sky.spectogrd(xlm) self.pixp = self.sky.spectogrd(plm) self.pixq = self.sky.spectogrd(qlm) self.gotpix = True return self.pix, self.pixp, self.pixq
def getPixels(self): nlat = self.ntrunc + 30 nlon = 2 * (nlat - 1) self.sky = LISAresponse.mySpharmt(nlon, nlat) if self.maptype in ['X', 'XX']: norm = 1e-45 elif self.maptype in ['P']: norm = 1 xlm = self.getMultipleMoments('p') * norm plm = self.getRealMultipleMoments('p') * norm qlm = self.getImagMultipleMoments('p') * norm self.pix = self.sky.spectogrd(xlm) self.pixp = self.sky.spectogrd(plm) self.pixq = self.sky.spectogrd(qlm) self.gotpix = True return self.pix, self.pixp, self.pixq
def create_sky(self, nlon=6, nlat=4): self._SkyMap__sky = LISAresponse.mySpharmt(nlon, nlat) return
import cPickle import LISAresponse import Utilities4 as U4 sourcename = '' #Name your custom function something. mapdir = '' nlon = nlat = ntrunc = 20 sky = LISAresponse.mySpharmt( nlon , nlat ) X = numpy.zeros( ( nlat , nlon ) ) for i,lat in enumerate( sky.lats ): theta = ( 90 - lat ) / 180 * numpy.pi for k,lon in enumerate( sky.lons ): lon = lon / 180 * numpy.pi X[ i,k ] = #Enter your function here in terms of theta and lon skymap = U4.XSkyMap( X=X ) skymap.X_to_P() skymap.X_to_Q() skymap.ntrunc_equals( ntrunc ) skymap.P_to_plm() skymap.Q_to_qlm() skymap.plmqlm_to_xlm()
def create_sky( self , nlon=6 , nlat=4 ): self._SkyMap__sky = LISAresponse.mySpharmt( nlon , nlat ) return