Coverage for python/lsst/afw/image/_visitInfo.py: 12%

54 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-06-15 02:47 -0700

1# This file is part of afw. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

5# (https://www.lsst.org). 

6# See the COPYRIGHT file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# This program is free software: you can redistribute it and/or modify 

10# it under the terms of the GNU General Public License as published by 

11# the Free Software Foundation, either version 3 of the License, or 

12# (at your option) any later version. 

13# 

14# This program is distributed in the hope that it will be useful, 

15# but WITHOUT ANY WARRANTY; without even the implied warranty of 

16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

17# GNU General Public License for more details. 

18# 

19# You should have received a copy of the GNU General Public License 

20# along with this program. If not, see <https://www.gnu.org/licenses/>. 

21"""This file only exists to deprecate the Filter and FilterProperty classes. 

22""" 

23 

24from lsst.utils.deprecated import deprecate_pybind11 

25from lsst.utils import continueClass 

26from ._imageLib import VisitInfo 

27 

28 

29__all__ = [] 

30 

31 

32@continueClass 

33class VisitInfo: # noqa: F811 

34 

35 def __deepcopy__(self, memo=None): 

36 return self 

37 

38 def copyWith( 

39 self, 

40 exposureId=None, 

41 exposureTime=None, 

42 darkTime=None, 

43 date=None, 

44 ut1=None, 

45 era=None, 

46 boresightRaDec=None, 

47 boresightAzAlt=None, 

48 boresightAirmass=None, 

49 boresightRotAngle=None, 

50 rotType=None, 

51 observatory=None, 

52 weather=None, 

53 instrumentLabel=None, 

54 id=None, 

55 focusZ=None, 

56 observationType=None, 

57 scienceProgram=None, 

58 observationReason=None, 

59 object=None, 

60 hasSimulatedContent=None, 

61 ): 

62 if exposureId is None: 

63 # Note: exposureId is deprecated and `VisitInfo` no longer contains 

64 # an `exposureId` property, so we use the getter until 

65 # this is removed in DM-32138. 

66 exposureId = self.getExposureId() 

67 if exposureTime is None: 

68 exposureTime = self.exposureTime 

69 if darkTime is None: 

70 darkTime = self.darkTime 

71 if date is None: 

72 date = self.date 

73 if ut1 is None: 

74 ut1 = self.ut1 

75 if era is None: 

76 era = self.era 

77 if boresightRaDec is None: 

78 boresightRaDec = self.boresightRaDec 

79 if boresightAzAlt is None: 

80 boresightAzAlt = self.boresightAzAlt 

81 if boresightAirmass is None: 

82 boresightAirmass = self.boresightAirmass 

83 if boresightRotAngle is None: 

84 boresightRotAngle = self.boresightRotAngle 

85 if rotType is None: 

86 rotType = self.rotType 

87 if observatory is None: 

88 observatory = self.observatory 

89 if weather is None: 

90 weather = self.weather 

91 if instrumentLabel is None: 

92 instrumentLabel = self.instrumentLabel 

93 if id is None: 

94 id = self.id 

95 if focusZ is None: 

96 focusZ = self.focusZ 

97 if observationType is None: 

98 observationType = self.observationType 

99 if scienceProgram is None: 

100 scienceProgram = self.scienceProgram 

101 if observationReason is None: 

102 observationReason = self.observationReason 

103 if object is None: 

104 object = self.object 

105 if hasSimulatedContent is None: 

106 hasSimulatedContent = self.hasSimulatedContent 

107 

108 return VisitInfo( 

109 exposureId=exposureId, 

110 exposureTime=exposureTime, 

111 darkTime=darkTime, 

112 date=date, 

113 ut1=ut1, 

114 era=era, 

115 boresightRaDec=boresightRaDec, 

116 boresightAzAlt=boresightAzAlt, 

117 boresightAirmass=boresightAirmass, 

118 boresightRotAngle=boresightRotAngle, 

119 rotType=rotType, 

120 observatory=observatory, 

121 weather=weather, 

122 instrumentLabel=instrumentLabel, 

123 id=id, 

124 focusZ=focusZ, 

125 observationType=observationType, 

126 scienceProgram=scienceProgram, 

127 observationReason=observationReason, 

128 object=object, 

129 hasSimulatedContent=hasSimulatedContent, 

130 ) 

131 

132 

133VisitInfo.getExposureId = deprecate_pybind11( 

134 VisitInfo.getExposureId, 

135 reason="Replaced by VisitInfo.id for full focal plane identifiers and by ExposureInfo.id for " 

136 "detector-level identifiers. Will be removed after v25.", 

137 version="v24.0")