Coverage for python/lsst/sims/photUtils/PhysicalParameters.py : 60%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
2from builtins import object
3__all__ = ["PhysicalParameters"]
5class PhysicalParameters(object):
6 """
7 A class to store physical constants and other immutable parameters
8 used by the sims_photUtils code
9 """
11 def __init__(self):
12 #the quantities below are in nanometers
13 self._minwavelen = 300.0
14 self._maxwavelen = 1150.0
15 self._wavelenstep = 0.1
17 self._lightspeed = 299792458.0 # speed of light, = 2.9979e8 m/s
18 self._planck = 6.626068e-27 # planck's constant, = 6.626068e-27 ergs*seconds
19 self._nm2m = 1.00e-9 # nanometers to meters conversion = 1e-9 m/nm
20 self._ergsetc2jansky = 1.00e23 # erg/cm2/s/Hz to Jansky units (fnu)
22 @property
23 def minwavelen(self):
24 """
25 minimum wavelength in nanometers
26 """
27 return self._minwavelen
29 @minwavelen.setter
30 def minwavelen(self, value):
31 raise RuntimeError('Cannot change the value of minwavelen')
34 @property
35 def maxwavelen(self):
36 """
37 maximum wavelength in nanometers
38 """
39 return self._maxwavelen
41 @maxwavelen.setter
42 def maxwavelen(self, value):
43 raise RuntimeError('Cannot change the value of maxwavelen')
46 @property
47 def wavelenstep(self):
48 """
49 wavelength step in nanometers
50 """
51 return self._wavelenstep
53 @wavelenstep.setter
54 def wavelenstep(self, value):
55 raise RuntimeError('Cannot change the value of wavelenstep')
58 @property
59 def lightspeed(self):
60 """
61 speed of light in meters per second
62 """
63 return self._lightspeed
65 @lightspeed.setter
66 def lightspeed(self, value):
67 raise RuntimeError('Cannot change the value of lightspeed ' +
68 '(Einstein does not approve)')
71 @property
72 def nm2m(self):
73 """
74 conversion factor to go from nm to m
75 """
76 return self._nm2m
78 @nm2m.setter
79 def nm2m(self, value):
80 raise RuntimeError('Cannot change the value of nm2m')
83 @property
84 def ergsetc2jansky(self):
85 """
86 conversion factor to go from ergs/sec/cm^2 to Janskys
87 """
88 return self._ergsetc2jansky
90 @ergsetc2jansky.setter
91 def ergsetc2jansky(self, value):
92 raise RuntimeError('Cannot change the value of ergsetc2Jansky')
95 @property
96 def planck(self):
97 """
98 Planck's constant in ergs*seconds
99 """
100 return self._planck
102 @planck.setter
103 def planck(self, value):
104 raise RuntimeError('Cannot change the value of planck')