Coverage for python/lsst/sims/maf/maps/trilegalMap.py : 39%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Return the cumulative stellar luminosity function for each slicepoint. Units of stars per sq degree.
Parameters ---------- filtername : str Filter to use. Options of u,g,r,i,z,y nside : int (64) The HEALpix nside (can be 64 or 128) """ self.mapDir = os.path.join(getPackageDir('sims_maps'), 'TriMaps') self.filtername = filtername self.nside = nside
filename = 'TRIstarDensity_%s_nside_%i.npz' % (self.filtername, self.nside) starMap = np.load(os.path.join(self.mapDir, filename)) self.starMap = starMap['starDensity'].copy() self.starMapBins = starMap['bins'].copy() self.starmapNside = hp.npix2nside(np.size(self.starMap[:, 0])) # note, the trilegal maps are in galactic coordinates, and nested healpix. gal_l, gal_b = _hpid2RaDec(self.nside, np.arange(hp.nside2npix(self.nside)), nest=True)
# Convert that to RA,dec. Then do nearest neighbor lookup. ra, dec = _equatorialFromGalactic(gal_l, gal_b) self.tree = _buildTree(ra, dec)
self._readMap()
x, y, z = _xyz_from_ra_dec(slicePoints['ra'], slicePoints['dec'])
dist, indices = self.tree.query(list(zip(x, y, z)))
slicePoints['starLumFunc_%s' % self.filtername] = self.starMap[indices, :] slicePoints['starMapBins_%s' % self.filtername] = self.starMapBins return slicePoints |