LSSTApplications  18.1.0
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:885

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.