示例#1
0
 def __init__(self,filter=None,sf10=True):
     """
     NAME:
        __init__
     PURPOSE:
        Initialize the zero extinction model
     INPUT:
        filter= filter to return the extinction in
        sf10= (True) if True, use the Schlafly & Finkbeiner calibrations
     OUTPUT:
        Instance
     HISTORY:
        2015-03-07 - Written - Bovy (IAS)
     """
     DustMap3D.__init__(self,filter=filter)
     self._sf10= sf10
     return None
示例#2
0
 def __init__(self, filter=None, sf10=True):
     """
     NAME:
        __init__
     PURPOSE:
        Initialize the combined dust map
     INPUT:
        filter= filter to return the extinction in
        sf10= (True) if True, use the Schlafly & Finkbeiner calibrations
     OUTPUT:
        object
     HISTORY:
        2015-07-28 - Started - Bovy (UofT)
     """
     DustMap3D.__init__(self, filter=filter)
     self._sf10 = sf10
     return None
示例#3
0
 def __init__(self,filter=None,sf10=True):
     """
     NAME:
        __init__
     PURPOSE:
        Initialize the combined dust map
     INPUT:
        filter= filter to return the extinction in
        sf10= (True) if True, use the Schlafly & Finkbeiner calibrations
     OUTPUT:
        object
     HISTORY:
        2015-07-28 - Started - Bovy (UofT)
     """
     DustMap3D.__init__(self,filter=filter)
     self._sf10= sf10
     return None
示例#4
0
 def __init__(self,filter=None,sf10=True):
     """
     NAME:
        __init__
     PURPOSE:
        Initialize the Sale14 dust map
     INPUT:
        filter= filter to return the extinction in
        sf10= (True) if True, use the Schlafly & Finkbeiner calibrations
     OUTPUT:
        object
     HISTORY:
        2015-03-08 - Started - Bovy (IAS)
     """
     DustMap3D.__init__(self,filter=filter)
     self._sf10= sf10
     #Read the maps
     sys.stdout.write('\r'+"Reading Sale et al. (2014) data file ...\r")
     sys.stdout.flush()
     self._saledata= asciitable.read(os.path.join(_saledir,
                                                  'Amap.dat'),
                                     readme=os.path.join(_saledir,
                                                         'ReadMe'),
                                     Reader=asciitable.cds.Cds,
                                     guess=False,
                                     fill_values=[('', '-999')])
     sys.stdout.write('\r'+_ERASESTR+'\r')
     sys.stdout.flush()
     # Some summaries
     self._dl= self._saledata['lmax']-self._saledata['lmin']
     self._db= self._saledata['b_max']-self._saledata['b_min']
     self._lmin= numpy.amin(self._saledata['lmin'])
     self._lmax= numpy.amax(self._saledata['lmax'])
     self._bmin= numpy.amin(self._saledata['b_min'])
     self._bmax= numpy.amax(self._saledata['b_max'])
     self._ndistbin= 150
     self._ds= numpy.linspace(0.05,14.95,self._ndistbin)
     # For dust_vals
     self._sintheta= numpy.sin((90.-self._saledata['GLAT'])*_DEGTORAD)
     self._costheta= numpy.cos((90.-self._saledata['GLAT'])*_DEGTORAD)
     self._sinphi= numpy.sin(self._saledata['GLON']*_DEGTORAD)
     self._cosphi= numpy.cos(self._saledata['GLON']*_DEGTORAD)
     self._intps= numpy.zeros(len(self._saledata),dtype='object') #array to cache interpolated extinctions
     return None
示例#5
0
 def __init__(self, filter=None, sf10=True):
     """
     NAME:
        __init__
     PURPOSE:
        Initialize the Marshall06 dust map
     INPUT:
        filter= filter to return the extinction in
        sf10= (True) if True, use the Schlafly & Finkbeiner calibrations
     OUTPUT:
        object
     HISTORY:
        2013-11-24 - Started - Bovy (IAS)
     """
     DustMap3D.__init__(self, filter=filter)
     self._sf10 = sf10
     #Read the maps
     sys.stdout.write('\r' +
                      "Reading Marshall et al. (2006) data file ...\r")
     sys.stdout.flush()
     self._marshalldata = asciitable.read(
         os.path.join(_marshalldir, 'table1.dat'),
         readme=os.path.join(_marshalldir, 'ReadMe'),
         Reader=asciitable.cds.Cds,
         guess=False,
         fill_values=[('', '-999')])
     sys.stdout.write('\r' + _ERASESTR + '\r')
     sys.stdout.flush()
     #Sort the data on l and then b
     negIndx = self._marshalldata['GLON'] > 180.
     self._marshalldata['GLON'][
         negIndx] = self._marshalldata['GLON'][negIndx] - 360.
     sortIndx = numpy.arange(len(self._marshalldata))
     keyArray = (self._marshalldata['GLON'] +
                 self._marshalldata['GLAT'] / 100.).data
     sortIndx = sorted(sortIndx, key=lambda x: keyArray[x])
     self._marshalldata = self._marshalldata[sortIndx]
     self._dl = 0.25
     self._db = 0.25
     self._intps = numpy.zeros(
         len(self._marshalldata),
         dtype='object')  #array to cache interpolated extinctions
     return None
示例#6
0
 def __init__(self, filter=None, sf10=True, interp=True, noloop=False):
     """
     NAME:
        __init__
     PURPOSE:
        Initialize the SFD dust map
     INPUT:
        sf10= (True) if True, use the Schlafly & Finkbeiner calibrations
        filter= filter to return the extinction in
        interp= (True) if True, interpolate using the nearest pixels
        noloop= (False) if True, don't loop through the glons
     OUTPUT:
        object
     HISTORY:
        2013-11-24 - Started - Bovy (IAS)
     """
     DustMap3D.__init__(self, filter=filter)
     self._sf10 = sf10
     self._interp = interp
     self._noloop = noloop
     return None
示例#7
0
文件: SFD.py 项目: surhud/mwdust
 def __init__(self,filter=None,sf10=True,interp=True,noloop=False):
     """
     NAME:
        __init__
     PURPOSE:
        Initialize the SFD dust map
     INPUT:
        sf10= (True) if True, use the Schlafly & Finkbeiner calibrations
        filter= filter to return the extinction in
        interp= (True) if True, interpolate using the nearest pixels
        noloop= (False) if True, don't loop through the glons
     OUTPUT:
        object
     HISTORY:
        2013-11-24 - Started - Bovy (IAS)
     """
     DustMap3D.__init__(self,filter=filter)
     self._sf10= sf10
     self._interp= interp
     self._noloop= noloop
     return None
示例#8
0
 def __init__(self, filter=None, sf10=True):
     """
     NAME:
        __init__
     PURPOSE:
        Initialize the Drimmel03 dust map
     INPUT:
        filter= filter to return the extinction in
        sf10= (True) if True, use the Schlafly & Finkbeiner calibrations
     OUTPUT:
        object
     HISTORY:
        2013-12-10 - Started - Bovy (IAS)
     """
     DustMap3D.__init__(self, filter=filter)
     self._sf10 = sf10
     #Read the maps
     drimmelMaps = read_Drimmel.readDrimmelAll()
     self._drimmelMaps = drimmelMaps
     #Sines and cosines of sky positions of COBE pixels
     self._rf_sintheta = numpy.sin(numpy.pi / 2. -
                                   self._drimmelMaps['rf_glat'] * _DEGTORAD)
     self._rf_costheta = numpy.cos(numpy.pi / 2. -
                                   self._drimmelMaps['rf_glat'] * _DEGTORAD)
     self._rf_sinphi = numpy.sin(self._drimmelMaps['rf_glon'] * _DEGTORAD)
     self._rf_cosphi = numpy.cos(self._drimmelMaps['rf_glon'] * _DEGTORAD)
     #Various setups
     self._xsun = -8.
     self._zsun = 0.015
     #Global grids
     self._nx_disk, self._ny_disk, self._nz_disk = 151, 151, 51
     self._dx_disk, self._dy_disk, self._dz_disk = 0.2, 0.2, 0.02
     self._nx_ori, self._ny_ori, self._nz_ori = 76, 151, 51
     self._dx_ori, self._dy_ori, self._dz_ori = 0.05, 0.05, 0.02
     #Local grids
     self._nx_diskloc, self._ny_diskloc, self._nz_diskloc = 31, 31, 51
     self._dx_diskloc, self._dy_diskloc, self._dz_diskloc = 0.05, 0.05, 0.02
     self._nx_ori2, self._ny_ori2, self._nz_ori2 = 101, 201, 51
     self._dx_ori2, self._dy_ori2, self._dz_ori2 = 0.02, 0.02, 0.02
     return None
示例#9
0
 def __init__(self,filter=None,sf10=True):
     """
     NAME:
        __init__
     PURPOSE:
        Initialize the Marshall06 dust map
     INPUT:
        filter= filter to return the extinction in
        sf10= (True) if True, use the Schlafly & Finkbeiner calibrations
     OUTPUT:
        object
     HISTORY:
        2013-11-24 - Started - Bovy (IAS)
     """
     DustMap3D.__init__(self,filter=filter)
     self._sf10= sf10
     #Read the maps
     sys.stdout.write('\r'+"Reading Marshall et al. (2006) data file ...\r")
     sys.stdout.flush()
     self._marshalldata= asciitable.read(os.path.join(_marshalldir,
                                                      'table1.dat'),
                                         readme=os.path.join(_marshalldir,
                                                             'ReadMe'),
                                         Reader=asciitable.cds.Cds,
                                         guess=False,
                                         fill_values=[('', '-999')])
     sys.stdout.write('\r'+_ERASESTR+'\r')
     sys.stdout.flush()
     #Sort the data on l and then b
     negIndx= self._marshalldata['GLON'] > 180.
     self._marshalldata['GLON'][negIndx]= self._marshalldata['GLON'][negIndx]-360.
     sortIndx= numpy.arange(len(self._marshalldata))
     keyArray= (self._marshalldata['GLON']+self._marshalldata['GLAT']/100.).data
     sortIndx= sorted(sortIndx,key=lambda x: keyArray[x])
     self._marshalldata= self._marshalldata[sortIndx]
     self._dl= 0.25
     self._db= 0.25
     self._intps= numpy.zeros(len(self._marshalldata),dtype='object') #array to cache interpolated extinctions
     return None
示例#10
0
文件: Green15.py 项目: surhud/mwdust
 def __init__(self,filter=None,sf10=True,load_samples=False,
              interpk=1):
     """
     NAME:
        __init__
     PURPOSE:
        Initialize the Green et al. (2015) dust map
     INPUT:
        filter= filter to return the extinction in
        sf10= (True) if True, use the Schlafly & Finkbeiner calibrations
        load_samples= (False) if True, also load the samples
        interpk= (1) interpolation order
     OUTPUT:
        object
     HISTORY:
        2015-03-02 - Started - Bovy (IAS)
     """
     DustMap3D.__init__(self,filter=filter)
     self._sf10= sf10
     #Read the map
     with h5py.File(os.path.join(_greendir,'dust-map-3d.h5'),'r') \
             as greendata:
         self._pix_info= greendata['/pixel_info'][:]
         if load_samples:
             self._samples= greendata['/samples'][:]
         self._best_fit= greendata['/best_fit'][:]
         self._GR= greendata['/GRDiagnostic'][:]
     # Utilities
     self._distmods= numpy.linspace(4.,19.,31)
     self._minnside= numpy.amin(self._pix_info['nside'])
     self._maxnside= numpy.amax(self._pix_info['nside'])
     nlevels= int(numpy.log2(self._maxnside//self._minnside))+1
     self._nsides= [self._maxnside//2**ii for ii in range(nlevels)]
     self._indexArray= numpy.arange(len(self._pix_info['healpix_index']))
     # For the interpolation
     self._intps= numpy.zeros(len(self._pix_info['healpix_index']),
                              dtype='object') #array to cache interpolated extinctions
     self._interpk= interpk
     return None
示例#11
0
 def __init__(self,filter=None,sf10=True):
     """
     NAME:
        __init__
     PURPOSE:
        Initialize the Drimmel03 dust map
     INPUT:
        filter= filter to return the extinction in
        sf10= (True) if True, use the Schlafly & Finkbeiner calibrations
     OUTPUT:
        object
     HISTORY:
        2013-12-10 - Started - Bovy (IAS)
     """
     DustMap3D.__init__(self,filter=filter)
     self._sf10= sf10
     #Read the maps
     drimmelMaps= read_Drimmel.readDrimmelAll()
     self._drimmelMaps= drimmelMaps
     #Sines and cosines of sky positions of COBE pixels
     self._rf_sintheta= numpy.sin(numpy.pi/2.-self._drimmelMaps['rf_glat']*_DEGTORAD)
     self._rf_costheta= numpy.cos(numpy.pi/2.-self._drimmelMaps['rf_glat']*_DEGTORAD)
     self._rf_sinphi= numpy.sin(self._drimmelMaps['rf_glon']*_DEGTORAD)
     self._rf_cosphi= numpy.cos(self._drimmelMaps['rf_glon']*_DEGTORAD)
     #Various setups
     self._xsun= -8.
     self._zsun= 0.015
     #Global grids
     self._nx_disk, self._ny_disk, self._nz_disk= 151, 151, 51
     self._dx_disk, self._dy_disk, self._dz_disk= 0.2, 0.2, 0.02
     self._nx_ori, self._ny_ori, self._nz_ori= 76, 151, 51
     self._dx_ori, self._dy_ori, self._dz_ori= 0.05, 0.05, 0.02
     #Local grids
     self._nx_diskloc, self._ny_diskloc, self._nz_diskloc= 31, 31, 51
     self._dx_diskloc, self._dy_diskloc, self._dz_diskloc= 0.05, 0.05, 0.02
     self._nx_ori2, self._ny_ori2, self._nz_ori2= 101, 201, 51
     self._dx_ori2, self._dy_ori2, self._dz_ori2= 0.02, 0.02, 0.02
     return None