LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
findCosmicRaysConfig.py
Go to the documentation of this file.
1 #
2 # LSST Data Management System
3 # Copyright 2008-2015 AURA/LSST.
4 #
5 # This product includes software developed by the
6 # LSST Project (http://www.lsst.org/).
7 #
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the LSST License Statement and
19 # the GNU General Public License along with this program. If not,
20 # see <https://www.lsstcorp.org/LegalNotices/>.
21 #
22 import lsst.pex.config as pexConfig
23 from . import algorithmsLib
24 from . import detection
25 
26 class FindCosmicRaysConfig(pexConfig.Config):
27  """Config for the findCosmicRays function
28  """
29  nCrPixelMax = pexConfig.Field(
30  dtype = int,
31  doc = "maximum number of contaminated pixels",
32  default = 10000,
33  )
34  minSigma = pexConfig.Field(
35  dtype = float,
36  doc = "CRs must be > this many sky-sig above sky",
37  default = 6.0,
38  )
39  min_DN = pexConfig.Field(
40  dtype = float,
41  doc = "CRs must have > this many DN (== electrons/gain) in initial detection",
42  default = 150.0,
43  )
44  cond3_fac = pexConfig.Field(
45  dtype = float,
46  doc = "used in condition 3 for CR; see CR.cc code",
47  default = 2.5,
48  )
49  cond3_fac2 = pexConfig.Field(
50  dtype = float,
51  doc = "used in condition 3 for CR; see CR.cc code",
52  default = 0.6,
53  )
54  niteration = pexConfig.Field(
55  dtype = int,
56  doc = "number of times to look for contaminated pixels near known CR pixels",
57  default = 3,
58  )
59  keepCRs = pexConfig.Field(
60  dtype = bool,
61  doc = "Don't interpolate over CR pixels",
62  default = False,
63  )
64  background = pexConfig.ConfigField(
65  dtype = detection.estimateBackground.ConfigClass,
66  doc = "Background estimation configuration"
67  )
68 
69  def setDefaults(self):
70  self.background.useApprox = False
71  self.background.binSize = 100000
72  self.background.statisticsProperty = "MEDIAN"
73  self.background.undersampleStyle = "REDUCE_INTERP_ORDER"
74  self.background.algorithm = "AKIMA_SPLINE"