LSST Applications  21.0.0+04719a4bac,21.0.0-1-ga51b5d4+f5e6047307,21.0.0-11-g2b59f77+a9c1acf22d,21.0.0-11-ga42c5b2+86977b0b17,21.0.0-12-gf4ce030+76814010d2,21.0.0-13-g1721dae+760e7a6536,21.0.0-13-g3a573fe+768d78a30a,21.0.0-15-g5a7caf0+f21cbc5713,21.0.0-16-g0fb55c1+b60e2d390c,21.0.0-19-g4cded4ca+71a93a33c0,21.0.0-2-g103fe59+bb20972958,21.0.0-2-g45278ab+04719a4bac,21.0.0-2-g5242d73+3ad5d60fb1,21.0.0-2-g7f82c8f+8babb168e8,21.0.0-2-g8f08a60+06509c8b61,21.0.0-2-g8faa9b5+616205b9df,21.0.0-2-ga326454+8babb168e8,21.0.0-2-gde069b7+5e4aea9c2f,21.0.0-2-gecfae73+1d3a86e577,21.0.0-2-gfc62afb+3ad5d60fb1,21.0.0-25-g1d57be3cd+e73869a214,21.0.0-3-g357aad2+ed88757d29,21.0.0-3-g4a4ce7f+3ad5d60fb1,21.0.0-3-g4be5c26+3ad5d60fb1,21.0.0-3-g65f322c+e0b24896a3,21.0.0-3-g7d9da8d+616205b9df,21.0.0-3-ge02ed75+a9c1acf22d,21.0.0-4-g591bb35+a9c1acf22d,21.0.0-4-g65b4814+b60e2d390c,21.0.0-4-gccdca77+0de219a2bc,21.0.0-4-ge8a399c+6c55c39e83,21.0.0-5-gd00fb1e+05fce91b99,21.0.0-6-gc675373+3ad5d60fb1,21.0.0-64-g1122c245+4fb2b8f86e,21.0.0-7-g04766d7+cd19d05db2,21.0.0-7-gdf92d54+04719a4bac,21.0.0-8-g5674e7b+d1bd76f71f,master-gac4afde19b+a9c1acf22d,w.2021.13
LSST Data Management Base Package
Namespaces | Classes | Functions
lsst::afw::coord Namespace Reference

Namespaces

 _refraction
 

Classes

class  Observatory
 Hold the location of an observatory. More...
 
class  Weather
 Basic weather information sufficient for a simple model for air mass or refraction. More...
 

Functions

std::ostreamoperator<< (std::ostream &os, Observatory const &obs)
 Print an Observatory to the stream. More...
 
std::ostreamoperator<< (std::ostream &os, Weather const &weath)
 print a Weather to an output stream More...
 
void wrapObservatory (WrapperCollection &)
 
void wrapWeather (WrapperCollection &)
 
 PYBIND11_MODULE (_coord, mod)
 

Function Documentation

◆ operator<<() [1/2]

std::ostream & lsst::afw::coord::operator<< ( std::ostream os,
Observatory const &  obs 
)

Print an Observatory to the stream.

Parameters
[in,out]osStream to print to
[in]obsthe Observatory to print

Definition at line 64 of file Observatory.cc.

64  {
65  os << obs.toString();
66  return os;
67 }
std::ostream * os
Definition: Schema.cc:746

◆ operator<<() [2/2]

std::ostream & lsst::afw::coord::operator<< ( std::ostream os,
Weather const &  weath 
)

print a Weather to an output stream

Definition at line 58 of file Weather.cc.

58  {
59  return os << "Weather(" << weath.getAirTemperature() << ", " << weath.getAirPressure() << ", "
60  << weath.getHumidity() << ")";
61 }

◆ PYBIND11_MODULE()

lsst::afw::coord::PYBIND11_MODULE ( _coord  ,
mod   
)

Definition at line 39 of file _coord.cc.

39  {
40  WrapperCollection wrappers(mod, "lsst.afw.coord");
41  wrapObservatory(wrappers);
42  wrapWeather(wrappers);
43  wrappers.finish();
44 }
void wrapObservatory(WrapperCollection &)
Definition: _observatory.cc:36
void wrapWeather(WrapperCollection &)
Definition: _weather.cc:39

◆ wrapObservatory()

void lsst::afw::coord::wrapObservatory ( WrapperCollection wrappers)

Definition at line 36 of file _observatory.cc.

36  {
37  wrappers.wrapType(
38  py::class_<Observatory, std::shared_ptr<Observatory>>(wrappers.module, "Observatory"),
39  [](auto& mod, auto& cls) {
40  /* Constructors */
41  cls.def(py::init<lsst::geom::Angle const, lsst::geom::Angle const, double const>());
42 
43  /* Operators */
44  cls.def(
45  "__eq__",
46  [](Observatory const& self, Observatory const& other) { return self == other; },
47  py::is_operator());
48  cls.def(
49  "__ne__",
50  [](Observatory const& self, Observatory const& other) { return self != other; },
51  py::is_operator());
52  cls.def("__str__", &Observatory::toString);
53  cls.def("__repr__", &Observatory::toString);
54 
55  /* Members */
56  cls.def("getLongitude", &Observatory::getLongitude);
57  cls.def("getLatitude", &Observatory::getLatitude);
58  cls.def("getElevation", &Observatory::getElevation);
59  cls.def("setLongitude", &Observatory::setLongitude, "longitude"_a);
60  cls.def("setLatitude", &Observatory::setLatitude, "latitude"_a);
61  cls.def("setElevation", &Observatory::setElevation, "elevation"_a);
62  });
63 }
ItemVariant const * other
Definition: Schema.cc:56

◆ wrapWeather()

void lsst::afw::coord::wrapWeather ( WrapperCollection wrappers)

Definition at line 39 of file _weather.cc.

39  {
40  wrappers.wrapType(py::class_<lsst::afw::coord::Weather>(wrappers.module, "Weather"), [](auto &mod,
41  auto &cls) {
42  /* Constructors */
43  cls.def(py::init<double, double, double>(), "airTemperature"_a, "airPressure"_a, "humidity"_a);
44  cls.def(py::init<Weather const &>(), "weather"_a);
45 
46  /* Operators */
47  cls.def(
48  "__eq__", [](Weather const &self, Weather const &other) { return self == other; },
49  py::is_operator());
50  cls.def(
51  "__ne__", [](Weather const &self, Weather const &other) { return self != other; },
52  py::is_operator());
53 
54  /* Members */
55  cls.def("getAirPressure", &lsst::afw::coord::Weather::getAirPressure);
56  cls.def("getAirTemperature", &lsst::afw::coord::Weather::getAirTemperature);
57  cls.def("getHumidity", &lsst::afw::coord::Weather::getHumidity);
58  utils::python::addOutputOp(cls, "__str__");
59  utils::python::addOutputOp(cls, "__repr__");
60  });
61 }
double getHumidity() const noexcept
get outside relative humidity (%)
Definition: Weather.h:70
double getAirPressure() const noexcept
get outside air pressure (Pascal)
Definition: Weather.h:67
double getAirTemperature() const noexcept
get outside air temperature (C)
Definition: Weather.h:64
void addOutputOp(PyClass &cls, std::string const &method)
Add __str__ or __repr__ method implemented by operator<<.
Definition: python.h:87