LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
LSSTDataManagementBasePackage
makeVisitInfo.py
Go to the documentation of this file.
1 #
2 # LSST Data Management System
3 # Copyright 2016 LSST Corporation.
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 <http://www.lsstcorp.org/LegalNotices/>.
21 #
22 from __future__ import absolute_import
23 from __future__ import division
24 from __future__ import print_function
25 
26 from lsst.daf.base import DateTime
27 from lsst.afw.coord import Coord, IcrsCoord, Observatory, Weather
28 from lsst.afw.geom import Angle
29 from .imageLib import VisitInfo, RotType_UNKNOWN
30 
31 __all__ = ["makeVisitInfo"]
32 
33 nanFloat = float("nan")
34 nanAngle = Angle(nanFloat)
35 
36 
37 def makeVisitInfo(
38  exposureId=0,
39  exposureTime=nanFloat,
40  darkTime=nanFloat,
41  date=DateTime(),
42  ut1=nanFloat,
43  era=nanAngle,
44  boresightRaDec=IcrsCoord(nanAngle, nanAngle),
45  boresightAzAlt=Coord(nanAngle, nanAngle),
46  boresightAirmass=nanFloat,
47  boresightRotAngle=nanAngle,
48  rotType=RotType_UNKNOWN,
49  observatory=Observatory(nanAngle, nanAngle, nanFloat),
50  weather=Weather(nanFloat, nanFloat, nanFloat),
51 ):
52  """Make a VisitInfo from keyword arguments
53 
54  This function will be replaced by a VisitInfo constructor once we switch to pybind11
55  (it is too much hassle with SWIG).
56 
57  @param[in] exposureId exposure ID (int, defaults to 0)
58  @param[in] exposureTime exposure duration (shutter open time); (float, sec, defaults to NaN)
59  @param[in] darkTime time from CCD flush to readout, including shutter open time (despite the name);
60  (float, sec, defaults to NaN)
61  @param[in] date TAI (international atomic time) MJD date at middle of exposure
62  (lsst.daf.base.DateTime; defaults to date of unix epoch)
63  @param[in] ut1 UT1 (universal time) MJD date at middle of exposure (float, defaults to Nan)
64  @param[in] era earth rotation angle at middle of exposure
65  (lsst.afw.geom.Angle, defaults to Angle(Nan))
66  @param[in] boresightRaDec ICRS RA/Dec of boresight at middle of exposure
67  (lsst.afw.coord.IcrsCoord; defaults to IcrsCoord(Nan, Nan));
68  other Coord types are accepted and converted to Icrs
69  @param[in] boresightAzAlt refracted apparent topocentric Az/Alt of boresight at middle of exposure;
70  (lsst.afw.coord.Coord; defaults to Coord(Nan, Nan))
71  @param[in] boresightAirmass airmass at the boresight, relative to zenith at sea level
72  (float, defaults to Nan)
73  @param[in] boresightRotAngle rotation angle at boresight at middle of exposure;
74  see getBoresightRotAngle for details
75  (lsst.afw.geom.Angle, defaults to Angle(Nan))
76  @param[in] rotType rotation type; one of the lsst.afw.image.RotType_ constants,
77  defaults to RotType_UNKNOWN
78  @param[in] observatory observatory longitude, latitude and altitude,
79  (lsst.afw.coord.Observatory, defaults to Observatory(Angle(Nan), Angle(Nan), Nan))
80  @param[in] weather basic weather information for computing air mass,
81  (lsst.afw.coord.Weather, defaults to Weather(NaN, NaN, NaN))
82  """
83  return VisitInfo(
84  exposureId,
85  exposureTime,
86  darkTime,
87  date,
88  ut1,
89  era,
90  boresightRaDec.toIcrs(),
91  boresightAzAlt,
92  boresightAirmass,
93  boresightRotAngle,
94  rotType,
95  observatory,
96  weather,
97  )
Class for handling dates/times, including MJD, UTC, and TAI.
Definition: DateTime.h:62
Hold the location of an observatory.
Definition: Observatory.h:47
A class representing an Angle.
Definition: Angle.h:103
Basic weather information sufficient for a simple model for air mass or refraction.
Definition: Weather.h:36
This is the base class for spherical coordinates.
Definition: Coord.h:69
A class to handle Icrs coordinates (inherits from Coord)
Definition: Coord.h:156