LSSTApplications  16.0-10-g0ee56ad+5,16.0-11-ga33d1f2+5,16.0-12-g3ef5c14+3,16.0-12-g71e5ef5+18,16.0-12-gbdf3636+3,16.0-13-g118c103+3,16.0-13-g8f68b0a+3,16.0-15-gbf5c1cb+4,16.0-16-gfd17674+3,16.0-17-g7c01f5c+3,16.0-18-g0a50484+1,16.0-20-ga20f992+8,16.0-21-g0e05fd4+6,16.0-21-g15e2d33+4,16.0-22-g62d8060+4,16.0-22-g847a80f+4,16.0-25-gf00d9b8+1,16.0-28-g3990c221+4,16.0-3-gf928089+3,16.0-32-g88a4f23+5,16.0-34-gd7987ad+3,16.0-37-gc7333cb+2,16.0-4-g10fc685+2,16.0-4-g18f3627+26,16.0-4-g5f3a788+26,16.0-5-gaf5c3d7+4,16.0-5-gcc1f4bb+1,16.0-6-g3b92700+4,16.0-6-g4412fcd+3,16.0-6-g7235603+4,16.0-69-g2562ce1b+2,16.0-8-g14ebd58+4,16.0-8-g2df868b+1,16.0-8-g4cec79c+6,16.0-8-gadf6c7a+1,16.0-8-gfc7ad86,16.0-82-g59ec2a54a+1,16.0-9-g5400cdc+2,16.0-9-ge6233d7+5,master-g2880f2d8cf+3,v17.0.rc1
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 = argparse.ArgumentParser()
 
 help
 
 dest
 
 default
 
 type
 
 args = parser.parse_args()
 
 raCol
 
 decCol
 
 sigma
 
 mu
 

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:833

Variable Documentation

◆ args

lsst.synpipe.makeBlendedCat.args = parser.parse_args()

Definition at line 75 of file makeBlendedCat.py.

◆ decCol

lsst.synpipe.makeBlendedCat.decCol

Definition at line 78 of file makeBlendedCat.py.

◆ default

lsst.synpipe.makeBlendedCat.default

Definition at line 64 of file makeBlendedCat.py.

◆ dest

lsst.synpipe.makeBlendedCat.dest

Definition at line 62 of file makeBlendedCat.py.

◆ help

lsst.synpipe.makeBlendedCat.help

Definition at line 60 of file makeBlendedCat.py.

◆ mu

lsst.synpipe.makeBlendedCat.mu

Definition at line 79 of file makeBlendedCat.py.

◆ parser

lsst.synpipe.makeBlendedCat.parser = argparse.ArgumentParser()

Definition at line 59 of file makeBlendedCat.py.

◆ raCol

lsst.synpipe.makeBlendedCat.raCol

Definition at line 78 of file makeBlendedCat.py.

◆ sigma

lsst.synpipe.makeBlendedCat.sigma

Definition at line 79 of file makeBlendedCat.py.

◆ type

lsst.synpipe.makeBlendedCat.type

Definition at line 70 of file makeBlendedCat.py.