LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.01
LSSTDataManagementBasePackage
Functions | Variables
lsst.synpipe.makeBlendedCat Namespace Reference

Functions

def disturbRaDec (num, mu=0.6, sigma=0.6)
 
def makeBlendedCat (fakeCat, realCat, raCol='ra', decCol='dec', sigma=0.6, mu=0.6)
 

Variables

 parser
 
 args
 

Detailed Description

Make a catalog of fakes that are highly blended.

Function Documentation

◆ disturbRaDec()

def lsst.synpipe.makeBlendedCat.disturbRaDec (   num,
  mu = 0.6,
  sigma = 0.6 
)
Disturb the coordinate a little bit.

Definition at line 11 of file makeBlendedCat.py.

11 def disturbRaDec(num, mu=0.6, sigma=0.6):
12  """Disturb the coordinate a little bit."""
13  return (np.random.normal(mu, sigma, num) / 3600.0)
14 
15 
def disturbRaDec(num, mu=0.6, sigma=0.6)

◆ makeBlendedCat()

def lsst.synpipe.makeBlendedCat.makeBlendedCat (   fakeCat,
  realCat,
  raCol = 'ra',
  decCol = 'dec',
  sigma = 0.6,
  mu = 0.6 
)
Make a highly blended version of fake catalog.

Definition at line 17 of file makeBlendedCat.py.

17  sigma=0.6, mu=0.6):
18  """Make a highly blended version of fake catalog."""
19  # Fake catalog
20  if not os.path.isfile(fakeCat):
21  raise Exception('# Can not find input fake catalog : %s' % fakeCat)
22  else:
23  fakeTab = Table.read(fakeCat, format='fits')
24  nFake = len(fakeTab)
25  print("# There are %d fake galaxies in the catalog" % nFake)
26  # Name of the output catalog
27  blendTab = fakeCat.replace('.fits', '_highb.fits')
28 
29  # Real catalog
30  if not os.path.isfile(realCat):
31  raise Exception('# Can not find input real catalog : %s' % realCat)
32  else:
33  realTab = Table.read(realCat, format='fits')
34  nReal = len(realTab)
35  print("# There are %d real galaxies in the catalog" % nReal)
36 
37  # Randomly select nFake galaxies from the realCat
38  indices = random.sample(list(range(nReal)), nFake)
39 
40  # Replace the RA, DEC with a small shift
41  fakeTab.add_column(Column(realTab[indices][raCol], name='RA_ori'))
42  fakeTab.add_column(Column(realTab[indices][decCol], name='Dec_ori'))
43 
44  fakeTab['RA'] = (realTab[indices][raCol] + disturbRaDec(nFake,
45  mu=mu,
46  sigma=sigma))
47  fakeTab['Dec'] = (realTab[indices][decCol] + disturbRaDec(nFake,
48  mu=mu,
49  sigma=sigma))
50 
51  # Save the new catalog
52  fakeTab.write(blendTab, format='fits', overwrite=True)
53 
54  return fakeTab
55 
56 
def disturbRaDec(num, mu=0.6, sigma=0.6)
daf::base::PropertyList * list
Definition: fits.cc:903

Variable Documentation

◆ args

lsst.synpipe.makeBlendedCat.args

Definition at line 75 of file makeBlendedCat.py.

◆ parser

lsst.synpipe.makeBlendedCat.parser

Definition at line 59 of file makeBlendedCat.py.