LSSTApplications  11.0-13-gbb96280,12.1.rc1,12.1.rc1+1,12.1.rc1+2,12.1.rc1+5,12.1.rc1+8,12.1.rc1-1-g06d7636+1,12.1.rc1-1-g253890b+5,12.1.rc1-1-g3d31b68+7,12.1.rc1-1-g3db6b75+1,12.1.rc1-1-g5c1385a+3,12.1.rc1-1-g83b2247,12.1.rc1-1-g90cb4cf+6,12.1.rc1-1-g91da24b+3,12.1.rc1-2-g3521f8a,12.1.rc1-2-g39433dd+4,12.1.rc1-2-g486411b+2,12.1.rc1-2-g4c2be76,12.1.rc1-2-gc9c0491,12.1.rc1-2-gda2cd4f+6,12.1.rc1-3-g3391c73+2,12.1.rc1-3-g8c1bd6c+1,12.1.rc1-3-gcf4b6cb+2,12.1.rc1-4-g057223e+1,12.1.rc1-4-g19ed13b+2,12.1.rc1-4-g30492a7
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 .subtractBackground import SubtractBackgroundTask
24 
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.ConfigurableField(
65  target=SubtractBackgroundTask,
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"