LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions
ast Namespace Reference

AST wrapper classes and functions. More...

Namespaces

namespace  detail
 

Classes

class  Channel
 Channel provides input/output of AST objects. More...
 
class  ChebyDomain
 The domain over which a Chebyshev polynomial is defined; returned by ChebyMap.getDomain. More...
 
class  ChebyMap
 A ChebyMap is a form of Mapping which performs a Chebyshev polynomial transformation. More...
 
class  CmpFrame
 A CmpFrame is a compound Frame which allows two component Frames (of any class) to be merged together to form a more complex Frame. More...
 
class  CmpMap
 Abstract base class for SeriesMap and ParallelMap. More...
 
class  DirectionPoint
 Struct returned by Frame::offset2 containing a direction and a point. More...
 
class  FileStream
 File-based source or sink (not both) for channels. More...
 
class  FitsChan
 A specialized form of Channel which reads and writes FITS header cards. More...
 
class  FitsTable
 
class  FoundValue
 A value and associated validity flag. More...
 
class  Frame
 Frame is used to represent a coordinate system. More...
 
class  FrameDict
 A FrameSet whose frames can be referenced by domain name. More...
 
class  FrameMapping
 Struct returned by Frame::pickAxes containing a frame and a mapping. More...
 
class  FrameSet
 A FrameSet consists of a set of one or more Frames (which describe coordinate systems), connected together by Mappings (which describe how the coordinate systems are inter-related). More...
 
class  KeyMap
 KeyMap is used to store a set of values with associated keys which identify the values. More...
 
class  LutMap
 LutMap is a specialised form of Mapping which transforms 1-dimensional coordinates by using linear interpolation in a lookup table. More...
 
class  MapBox
 Object to compute the bounding box which just encloses another box after it has been transformed by a mapping. More...
 
class  Mapping
 An abstract base class for objects which transform one set of coordinates to another. More...
 
class  MapSplit
 A Mapping split off as a subset of another Mapping. More...
 
class  MathMap
 A MathMap is a Mapping which allows you to specify a set of forward and/or inverse transformation functions using arithmetic operations and mathematical functions similar to those available in C. More...
 
class  MatrixMap
 MatrixMap is a form of Mapping which performs a general linear transformation. More...
 
class  NormMap
 A Mapping which normalises coordinate values using the norm method of the supplied Frame. More...
 
class  NReadValue
 Struct returned by Frame::unformat containing the number of characters read and corresponding value. More...
 
class  Object
 Abstract base class for all AST objects. More...
 
class  ParallelMap
 A parallel compound mapping where the first Mapping is used to transform the lower numbered coordinates of each point and the second Mapping is used to transform the remaining coordinates. More...
 
class  PcdMap
 A PcdMap is a non-linear Mapping which transforms 2-dimensional positions to correct for the radial distortion introduced by some cameras and telescopes. More...
 
class  PermMap
 A Mapping which permutes the order of coordinates, and possibly also changes the number of coordinates, between its input and output. More...
 
class  PolyMap
 PolyMap is a Mapping which performs a general polynomial transformation. More...
 
class  QuadApprox
 A quadratic approximation to a 2D Mapping. More...
 
class  RateMap
 RateMap is a Mapping which represents a single element of the Jacobian matrix of another Mapping. More...
 
class  ResolvedPoint
 Struct returned by Frame::resolve containing a point and the resolved vector components. More...
 
class  SeriesMap
 A series compound mapping where the first Mapping is used to transform the coordinates of each point and the second Mapping is then applied to the result. More...
 
class  ShiftMap
 ShiftMap is a linear Mapping which shifts each axis by a specified constant value. More...
 
class  SkyFrame
 SkyFrame is a specialised form of Frame which describes celestial longitude/latitude coordinate systems. More...
 
class  SlaMap
 SlaMap is a specialised form of Mapping which can be used to represent a sequence of conversions between standard celestial (longitude, latitude) coordinate systems. More...
 
class  SpecFrame
 A specialised form of one-dimensional Frame which represents various coordinate systems used to describe positions within an electro-magnetic spectrum. More...
 
class  SphMap
 A SphMap is a Mapping which transforms points from a 3-dimensional Cartesian coordinate system into a 2-dimensional spherical coordinate system (longitude and latitude on a unit sphere centred at the origin). More...
 
class  Stream
 A stream for ast::Channel. More...
 
class  StringStream
 String-based source and sink for channels. More...
 
class  Table
 
class  TimeFrame
 A TimeFrame is a specialised form of one-dimensional Frame which represents various coordinate systems used to describe positions in time. More...
 
class  TimeMap
 A TimeMap is a specialised form of 1-dimensional Mapping which can be used to represent a sequence of conversions between standard time coordinate systems. More...
 
class  TranMap
 TranMap is a Mapping which combines the forward transformation of a supplied Mapping with the inverse transformation of another supplied Mapping, ignoring the un-used transformation in each Mapping (indeed the un-used transformation need not exist). More...
 
class  UnitMap
 A UnitMap is a unit (null) Mapping that has no effect on the coordinates supplied to it. More...
 
class  UnitNormMap
 The forward transformation of a UnitNormMap subtracts the specified centre and then transforms the resulting vector to a unit vector and the vector norm. More...
 
class  WcsMap
 Map from a spherical system to a cartesian system using standard FITS sky coordinate projections. More...
 
class  WinMap
 A WinMap is a linear Mapping which transforms a rectangular window in one coordinate system into a similar window in another coordinate system by scaling and shifting each axis (the window edges being parallel to the coordinate axes). More...
 
class  XmlChan
 XmlChan provides input/output of AST objects. More...
 
class  ZoomMap
 A Mapping which "zooms" a set of points about the origin by multiplying all coordinate values by the same scale factor. More...
 

Typedefs

using Array2D = ndarray::Array<double, 2, 2>
 2D array of const double; typically used for lists of const points
 
using ConstArray2D = ndarray::Array<const double, 2, 2>
 2D array of const double; typically used for lists of const points
 
using PointI = std::vector<int>
 Vector of ints; typically used for the bounds of Mapping.tranGridForward and inverse.
 
using PointD = std::vector<double>
 Vector of double; used for bounds, points.
 

Enumerations

enum class  DataType {
  IntType = AST__INTTYPE , ShortIntType = AST__SINTTYPE , ByteType = AST__BYTETYPE , DoubleType = AST__DOUBLETYPE ,
  FloatType = AST__FLOATTYPE , StringType = AST__STRINGTYPE , ObjectType = AST__OBJECTTYPE , PointerType = AST__POINTERTYPE ,
  UndefinedType = AST__UNDEFTYPE , BadType = AST__BADTYPE
}
 Data types held by a KeyMap. More...
 
enum class  FitsKeyState { ABSENT = 0 , NOVALUE , PRESENT }
 Enums describing the presence or absence of a FITS keyword. More...
 
enum class  CardType {
  NOTYPE = AST__NOTYPE , COMMENT = AST__COMMENT , INT = AST__INT , FLOAT = AST__FLOAT ,
  STRING = AST__STRING , COMPLEXF = AST__COMPLEXF , COMPLEXI = AST__COMPLEXI , LOGICAL = AST__LOGICAL ,
  CONTINUE = AST__CONTINUE , UNDEF = AST__UNDEF
}
 Enums describing the FITS card type. More...
 
enum class  WcsType {
  AZP = AST__AZP , SZP = AST__SZP , TAN = AST__TAN , STG = AST__STG ,
  SIN = AST__SIN , ARC = AST__ARC , ZPN = AST__ZPN , ZEA = AST__ZEA ,
  AIR = AST__AIR , CYP = AST__CYP , CEA = AST__CEA , CAR = AST__CAR ,
  MER = AST__MER , SFL = AST__SFL , PAR = AST__PAR , MOL = AST__MOL ,
  AIT = AST__AIT , COP = AST__COP , COE = AST__COE , COD = AST__COD ,
  COO = AST__COO , BON = AST__BON , PCO = AST__PCO , TSC = AST__TSC ,
  CSC = AST__CSC , QSC = AST__QSC , NCP = AST__NCP , GLS = AST__GLS ,
  TPN = AST__TPN , HPX = AST__HPX , XPH = AST__XPH , WCSBAD = AST__WCSBAD
}
 WCS types that give the projection type code (in upper case) as used in the FITS-WCS "CTYPEi" keyword. More...
 

Functions

void assertOK (AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
 Throw std::runtime_error if AST's state is bad.
 
bool escapes (int include=-1)
 Control whether graphical escape sequences are included in strings.
 
int ast_version (void)
 
std::shared_ptr< FrameSetappend (FrameSet const &first, FrameSet const &second)
 Construct a FrameSet that performs two transformations in series.
 
std::shared_ptr< MappingmakeRadialMapping (std::vector< double > const &center, Mapping const &mapping1d)
 Construct a radially symmetric mapping from a 1-dimensional mapping.
 
void wrapBase (WrapperCollection &)
 
void wrapChannel (WrapperCollection &)
 
void wrapChebyMap (WrapperCollection &)
 
void wrapCmpFrame (WrapperCollection &)
 
void wrapCmpMap (WrapperCollection &)
 
void wrapFitsChan (WrapperCollection &)
 
void wrapFitsTable (WrapperCollection &)
 
void wrapFrame (WrapperCollection &)
 
void wrapFrameDict (WrapperCollection &)
 
void wrapFrameSet (WrapperCollection &)
 
void wrapFunctional (WrapperCollection &)
 
void wrapKeyMap (WrapperCollection &)
 
void wrapLutMap (WrapperCollection &)
 
void wrapMapBox (WrapperCollection &)
 
void wrapMapping (WrapperCollection &)
 
void wrapMapSplit (WrapperCollection &)
 
void wrapMathMap (WrapperCollection &)
 
void wrapMatrixMap (WrapperCollection &)
 
void wrapNormMap (WrapperCollection &)
 
void wrapObject (WrapperCollection &)
 
void wrapParallelMap (WrapperCollection &)
 
void wrapPcdMap (WrapperCollection &)
 
void wrapPermMap (WrapperCollection &)
 
void wrapPolyMap (WrapperCollection &)
 
void wrapQuadApprox (WrapperCollection &)
 
void wrapRateMap (WrapperCollection &)
 
void wrapSeriesMap (WrapperCollection &)
 
void wrapShiftMap (WrapperCollection &)
 
void wrapSkyFrame (WrapperCollection &)
 
void wrapSlaMap (WrapperCollection &)
 
void wrapSpecFrame (WrapperCollection &)
 
void wrapSphMap (WrapperCollection &)
 
void wrapStream (WrapperCollection &)
 
void wrapTable (WrapperCollection &)
 
void wrapTimeFrame (WrapperCollection &)
 
void wrapTimeMap (WrapperCollection &)
 
void wrapTranMap (WrapperCollection &)
 
void wrapUnitMap (WrapperCollection &)
 
void wrapUnitNormMap (WrapperCollection &)
 
void wrapWcsMap (WrapperCollection &)
 
void wrapWinMap (WrapperCollection &)
 
void wrapXmlChan (WrapperCollection &)
 
void wrapZoomMap (WrapperCollection &)
 
 PYBIND11_MODULE (_astshimLib, mod)
 
void wrapChannel (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapChebyMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapCmpFrame (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapCmpMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapFitsChan (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapFitsTable (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapDirectionPoint (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapNReadValue (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapResolvedPoint (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapFrameMapping (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapFrame (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapFrameDict (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapFrameSet (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapFunctional (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapKeyMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapLutMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapMapBox (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapMapping (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapMapSplit (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapMathMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapMatrixMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapNormMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapObject (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapParallelMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapPcdMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapPermMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapPolyMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapQuadApprox (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapRateMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapSeriesMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapShiftMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapSkyFrame (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapSlaMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapSpecFrame (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapSphMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapStream (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapTable (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapTimeFrame (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapTimeMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapTranMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapUnitMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapUnitNormMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapWcsMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapWinMap (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapXmlChan (lsst::utils::python::WrapperCollection &wrappers)
 
void wrapZoomMap (lsst::utils::python::WrapperCollection &wrappers)
 
ConstArray2D arrayFromVector (std::vector< double > const &vec, int nAxes)
 Reshape a vector as a 2-dimensional array that shares the same memory.
 
Array2D arrayFromVector (std::vector< double > &vec, int nAxes)
 Reshape a vector as a 2-dimensional array that shares the same memory.
 

Detailed Description

AST wrapper classes and functions.

Typedef Documentation

◆ Array2D

using ast::Array2D = ndarray::Array<double, 2, 2>

2D array of const double; typically used for lists of const points

Definition at line 42 of file base.h.

◆ ConstArray2D

using ast::ConstArray2D = ndarray::Array<const double, 2, 2>

2D array of const double; typically used for lists of const points

Definition at line 46 of file base.h.

◆ PointD

using ast::PointD = std::vector<double>

Vector of double; used for bounds, points.

Also used to store a list of points as sequential data, as an alternative to Array2D and ConstArray2D

Definition at line 57 of file base.h.

◆ PointI

using ast::PointI = std::vector<int>

Vector of ints; typically used for the bounds of Mapping.tranGridForward and inverse.

Definition at line 50 of file base.h.

Enumeration Type Documentation

◆ CardType

enum class ast::CardType
strong

Enums describing the FITS card type.

Enumerator
NOTYPE 

card does not exist (card number invalid)

COMMENT 

card is a comment-style card with no "=" (COMMENT, HISTORY, ...)

INT 

integer

FLOAT 

float

STRING 

string

COMPLEXF 

complex floating point

COMPLEXI 

complex integer

LOGICAL 

boolean

CONTINUE 

CONTINUE card.

UNDEF 

card has no value

Definition at line 49 of file FitsChan.h.

49 {
50 NOTYPE = AST__NOTYPE,
51 COMMENT = AST__COMMENT,
52 INT = AST__INT,
53 FLOAT = AST__FLOAT,
54 STRING = AST__STRING,
55 COMPLEXF = AST__COMPLEXF,
56 COMPLEXI = AST__COMPLEXI,
57 LOGICAL = AST__LOGICAL,
58 CONTINUE = AST__CONTINUE,
59 UNDEF = AST__UNDEF,
60};
@ NOTYPE
card does not exist (card number invalid)
@ CONTINUE
CONTINUE card.
@ LOGICAL
boolean
@ COMPLEXI
complex integer
@ INT
integer
@ COMPLEXF
complex floating point
@ STRING
string
@ UNDEF
card has no value
@ COMMENT
card is a comment-style card with no "=" (COMMENT, HISTORY, ...)

◆ DataType

enum class ast::DataType
strong

Data types held by a KeyMap.

Enumerator
IntType 
ShortIntType 
ByteType 
DoubleType 
FloatType 
StringType 
ObjectType 
PointerType 
UndefinedType 
BadType 

Definition at line 62 of file base.h.

62 {
63 IntType = AST__INTTYPE,
64 ShortIntType = AST__SINTTYPE,
65 ByteType = AST__BYTETYPE,
66 DoubleType = AST__DOUBLETYPE,
67 FloatType = AST__FLOATTYPE,
68 StringType = AST__STRINGTYPE,
69 ObjectType = AST__OBJECTTYPE,
70 PointerType = AST__POINTERTYPE,
71 UndefinedType = AST__UNDEFTYPE,
72 BadType = AST__BADTYPE
73};

◆ FitsKeyState

enum class ast::FitsKeyState
strong

Enums describing the presence or absence of a FITS keyword.

Enumerator
ABSENT 

keyword is not present

NOVALUE 

keyword is present, but has no value

PRESENT 

keyword is present and has a value

Definition at line 40 of file FitsChan.h.

40 {
41 ABSENT = 0,
42 NOVALUE,
43 PRESENT
44};
@ NOVALUE
keyword is present, but has no value
@ PRESENT
keyword is present and has a value
@ ABSENT
keyword is not present

◆ WcsType

enum class ast::WcsType
strong

WCS types that give the projection type code (in upper case) as used in the FITS-WCS "CTYPEi" keyword.

You should consult the FITS-WCS paper for a list of the available projections. The additional code of WcsType::TPN can be supplied which represents a TAN projection with polynomial correction terms as defined in an early draft of the FITS-WCS paper.

These have the same value as the corresponding AST__ constant, e.g. WcsType::TAN = AST__TAN.

I am not sure what AST__WCSBAD is used for, but I included it anyway.

Enumerator
AZP 
SZP 
TAN 
STG 
SIN 
ARC 
ZPN 
ZEA 
AIR 
CYP 
CEA 
CAR 
MER 
SFL 
PAR 
MOL 
AIT 
COP 
COE 
COD 
COO 
BON 
PCO 
TSC 
CSC 
QSC 
NCP 
GLS 
TPN 
HPX 
XPH 
WCSBAD 

Definition at line 48 of file WcsMap.h.

48 {
49 AZP = AST__AZP,
50 SZP = AST__SZP,
51 TAN = AST__TAN,
52 STG = AST__STG,
53 SIN = AST__SIN,
54 ARC = AST__ARC,
55 ZPN = AST__ZPN,
56 ZEA = AST__ZEA,
57 AIR = AST__AIR,
58 CYP = AST__CYP,
59 CEA = AST__CEA,
60 CAR = AST__CAR,
61 MER = AST__MER,
62 SFL = AST__SFL,
63 PAR = AST__PAR,
64 MOL = AST__MOL,
65 AIT = AST__AIT,
66 COP = AST__COP,
67 COE = AST__COE,
68 COD = AST__COD,
69 COO = AST__COO,
70 BON = AST__BON,
71 PCO = AST__PCO,
72 TSC = AST__TSC,
73 CSC = AST__CSC,
74 QSC = AST__QSC,
75 NCP = AST__NCP,
76 GLS = AST__GLS,
77 TPN = AST__TPN,
78 HPX = AST__HPX,
79 XPH = AST__XPH,
80 WCSBAD = AST__WCSBAD,
81};

Function Documentation

◆ append()

std::shared_ptr< FrameSet > ast::append ( FrameSet const & first,
FrameSet const & second )

Construct a FrameSet that performs two transformations in series.

When used as a Mapping, the FrameSet shall apply first, followed by second. Its inverse shall apply the inverse of second, followed by the inverse of first. The concatenation is only valid if first.getCurrent() and second.getBase() have the same number of axes.

The new FrameSet shall contain all Frames and Mappings from first, followed by all Frames and Mappings from second, preserving their original order. The current frame of first shall be connected to the base frame of second by a UnitMap. The new set's base frame shall be the base frame of first, and its current frame shall be the current frame of second.

The FrameSet shall be independent of the input arguments, so changes to the original FrameSets (in particular, reassignments of their base or current frames) shall not affect it.

Parameters
first,secondthe FrameSets to concatenate.
Returns
a pointer to a combined FrameSet as described above

Example: if first has 3 frames and secondhas 4, then the result shall contain 7 frames, of which frames 1-3 are the same as frames 1-3 of first, in order, and frames 4-7 are the same as frames 1-4 of second, in order.

Definition at line 33 of file functional.cc.

33 {
34 std::shared_ptr<FrameSet> const merged = first.copy();
35 std::shared_ptr<FrameSet> const newFrames = second.copy();
36
37 newFrames->setCurrent(FrameSet::BASE);
38 int const joinNAxes = first.getFrame(FrameSet::CURRENT)->getNAxes();
39 merged->addFrame(FrameSet::CURRENT, UnitMap(joinNAxes), *newFrames);
40
41 // All frame numbers from `second` have been offset in `merged` by number of frames in `first`
42 int const mergedCurrent = first.getNFrame() + second.getCurrent();
43 merged->setCurrent(mergedCurrent);
44
45 return merged;
46}
A UnitMap is a unit (null) Mapping that has no effect on the coordinates supplied to it.
Definition UnitMap.h:44

◆ arrayFromVector() [1/2]

Array2D ast::arrayFromVector ( std::vector< double > & vec,
int nAxes )

Reshape a vector as a 2-dimensional array that shares the same memory.

To convert a vector of coefficients to an array of coefficients for PolyMap or ChebyMap, call this with nAxes = nPoints / width, where width is the number of elements in each coefficient: width = nOut + 2 for forward coefficients, nIn + 2 for inverse coefficients.

Parameters
[in]vecVector of points, with all values for one axis first, then the next axes, and so on, e.g. x1, x2, ...xnPt, y1, y2, ...ynNpt
[in]nAxesNumber of axes per point
Returns
2-dimensional array with dimensions (nPts, nAxes)
Exceptions
std::runtime_errorif vec length is not a multiple of nAxes
Warning
You must hold onto the original vector until you are done with the returned array, else the array will be corrupted. (However, the Python version returns a copy, to avoid memory issues.)

Definition at line 69 of file base.cc.

69 {
70 int nPoints = vec.size() / nAxes;
71 if (nPoints * nAxes != vec.size()) {
73 os << "vec length = " << vec.size() << " not a multiple of nAxes = " << nAxes;
74 throw std::runtime_error(os.str());
75 }
76 Array2D::Index shape = ndarray::makeVector(nAxes, nPoints);
77 Array2D::Index strides = ndarray::makeVector(nPoints, 1);
78 return external(vec.data(), shape, strides);
79}
std::ostream * os
Definition Schema.cc:557
T data(T... args)
T size(T... args)

◆ arrayFromVector() [2/2]

ConstArray2D ast::arrayFromVector ( std::vector< double > const & vec,
int nAxes )

Reshape a vector as a 2-dimensional array that shares the same memory.

To convert a vector of coefficients to an array of coefficients for PolyMap or ChebyMap, call this with nAxes = nPoints / width, where width is the number of elements in each coefficient: width = nOut + 2 for forward coefficients, nIn + 2 for inverse coefficients.

Parameters
[in]vecVector of points, with all values for one axis first, then the next axes, and so on, e.g. x1, x2, ...xnPt, y1, y2, ...ynNpt
[in]nAxesNumber of axes per point
Returns
2-dimensional array with dimensions (nPts, nAxes)
Exceptions
std::runtime_errorif vec length is not a multiple of nAxes
Warning
You must hold onto the original vector until you are done with the returned array, else the array will be corrupted. (However, the Python version returns a copy, to avoid memory issues.)

Definition at line 65 of file base.cc.

65 {
66 return static_cast<ConstArray2D>(arrayFromVector(const_cast<std::vector<double> &>(vec), nAxes));
67}
ndarray::Array< const double, 2, 2 > ConstArray2D
2D array of const double; typically used for lists of const points
Definition base.h:46
ConstArray2D arrayFromVector(std::vector< double > const &vec, int nAxes)
Reshape a vector as a 2-dimensional array that shares the same memory.
Definition base.cc:65

◆ assertOK()

void ast::assertOK ( AstObject * rawPtr1 = nullptr,
AstObject * rawPtr2 = nullptr )

Throw std::runtime_error if AST's state is bad.

Parameters
rawPtr1An AST object to free if status is bad
rawPtr2An AST object to free if status is bad
Note
on the first call an error handler is registered that saves error messages to a buffer.

Definition at line 49 of file base.cc.

49 {
50 // Construct ErrorHandler once, the first time this function is called.
51 // This is done to initialize `errorMsgStream` and register `reportError` as the AST error handler.
52 // See https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use
53 static ErrorHandler *errHandler = new ErrorHandler();
54 if (!astOK) {
55 if (rawPtr1) {
56 astAnnul(rawPtr1);
57 }
58 if (rawPtr2) {
59 astAnnul(rawPtr2);
60 }
61 throw std::runtime_error(errHandler->getErrMsg());
62 }
63}

◆ ast_version()

int ast::ast_version ( void )
inline

Definition at line 147 of file base.h.

147 {
148 return astVersion;
149}

◆ escapes()

bool ast::escapes ( int include = -1)
inline

Control whether graphical escape sequences are included in strings.

The Plot class defines a set of escape sequences which can be included within a text string in order to control the appearance of sub-strings within the text. (See the Escape attribute for a description of these escape sequences). It is usually inappropriate for AST to return strings containing such escape sequences when called by application code. For instance, an application which displays the value of the Title attribute of a Frame usually does not want the displayed string to include potentially long escape sequences which a human read would have difficuly interpreting. Therefore the default behaviour is for AST to strip out such escape sequences when called by application code. This default behaviour can be changed using this function.

Parameters
[in]includePossible values are:
  • -1 (or any negative value) to return the current value without changing it.
  • 0 to not include escape sequences,
  • 1 (or any positive value) to include escape sequences,
Returns
the previous value (or current value if include is negative).

Notes:

  • This function also controls whether the AST function astStripEscapes removes escape sequences from the supplied string, or returns the supplied string without change.
  • Unlike the AST function astEscapes, this function will not attempt to execute if an error has already occurred.

Definition at line 140 of file base.h.

140 {
141 assertOK();
142 int ret = astEscapes(include);
143 assertOK();
144 return ret;
145}
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Throw std::runtime_error if AST's state is bad.
Definition base.cc:49

◆ makeRadialMapping()

std::shared_ptr< Mapping > ast::makeRadialMapping ( std::vector< double > const & center,
Mapping const & mapping1d )

Construct a radially symmetric mapping from a 1-dimensional mapping.

The transform will be symmetrical about the specified center. The forward transform is as follows: input -> unitNormMap -> input norm -> mapping1d -> output norm -> unitNormMap inverse -> output -> unit vector ----------------------------> where unitNormMap is UnitNormMap(center)

The returned mapping will support forward and/or inverse transformation as mapping1d does.

Parameters
[in]centerCenter of radial symmetry
[in]mapping1d1-dimensional mapping
Returns
a mapping that is radially symmetric about the center and has nIn = nOut = center.size()
Exceptions
std::invalid_argumentif mapping1d has nIn or nOut != 1
std::runtime_errorif center is empty

Definition at line 48 of file functional.cc.

48 {
49 auto naxes = center.size();
50 if (mapping1d.getNIn() != 1) {
51 throw std::invalid_argument("mapping1d has " + std::to_string(mapping1d.getNIn()) +
52 " inputs, instead of 1");
53 }
54 if (mapping1d.getNOut() != 1) {
55 throw std::invalid_argument("mapping1d has " + std::to_string(mapping1d.getNOut()) +
56 " outputs, instead of 1");
57 }
58 auto unitNormMap = UnitNormMap(center);
59 return std::make_shared<Mapping>(
60 unitNormMap.then(UnitMap(naxes).under(mapping1d)).then(*unitNormMap.inverted()));
61}
T to_string(T... args)

◆ PYBIND11_MODULE()

ast::PYBIND11_MODULE ( _astshimLib ,
mod  )

Definition at line 76 of file _astshimLib.cc.

76 {
78 lsst::utils::python::WrapperCollection wrappers(mod, "astshim");
79 wrapBase(wrappers);
80 wrapObject(wrappers);
81 wrapKeyMap(wrappers);
82 wrapMapping(wrappers);
83 wrapTable(wrappers);
84 wrapChannel(wrappers);
85 wrapCmpMap(wrappers);
86 wrapFrame(wrappers);
87 wrapFrameSet(wrappers);
88 wrapMapBox(wrappers);
89 wrapMapSplit(wrappers);
90
91 wrapChebyMap(wrappers);
92 wrapCmpFrame(wrappers);
93 wrapFitsChan(wrappers);
94 wrapFitsTable(wrappers);
95 wrapFrameDict(wrappers);
96 wrapFunctional(wrappers);
97 wrapLutMap(wrappers);
98 wrapMathMap(wrappers);
99 wrapMatrixMap(wrappers);
100 wrapNormMap(wrappers);
101 wrapParallelMap(wrappers);
102 wrapPcdMap(wrappers);
103 wrapPermMap(wrappers);
104 wrapPolyMap(wrappers);
105 wrapQuadApprox(wrappers);
106 wrapRateMap(wrappers);
107 wrapSeriesMap(wrappers);
108 wrapShiftMap(wrappers);
109 wrapSkyFrame(wrappers);
110 wrapSlaMap(wrappers);
111 wrapSpecFrame(wrappers);
112 wrapSphMap(wrappers);
113 wrapStream(wrappers);
114 wrapTimeFrame(wrappers);
115 wrapTimeMap(wrappers);
116 wrapTranMap(wrappers);
117 wrapUnitMap(wrappers);
118 wrapUnitNormMap(wrappers);
119 wrapWcsMap(wrappers);
120 wrapWinMap(wrappers);
121 wrapXmlChan(wrappers);
122 wrapZoomMap(wrappers);
123 wrappers.finish();
124}
A helper class for subdividing pybind11 module across multiple translation units (i....
Definition python.h:242
void wrapKeyMap(WrapperCollection &)
void wrapTranMap(WrapperCollection &)
void wrapFitsTable(WrapperCollection &)
void wrapXmlChan(WrapperCollection &)
void wrapShiftMap(WrapperCollection &)
void wrapMathMap(WrapperCollection &)
void wrapRateMap(WrapperCollection &)
void wrapZoomMap(WrapperCollection &)
void wrapObject(WrapperCollection &)
void wrapMapSplit(WrapperCollection &)
void wrapPolyMap(WrapperCollection &)
void wrapUnitMap(WrapperCollection &)
void wrapMapBox(WrapperCollection &)
void wrapMapping(WrapperCollection &)
void wrapCmpFrame(WrapperCollection &)
void wrapFrameSet(WrapperCollection &)
void wrapChannel(WrapperCollection &)
void wrapParallelMap(WrapperCollection &)
void wrapSlaMap(WrapperCollection &)
void wrapSphMap(WrapperCollection &)
void wrapSeriesMap(WrapperCollection &)
void wrapNormMap(WrapperCollection &)
void wrapCmpMap(WrapperCollection &)
void wrapUnitNormMap(WrapperCollection &)
void wrapStream(WrapperCollection &)
void wrapQuadApprox(WrapperCollection &)
void wrapPcdMap(WrapperCollection &)
void wrapSpecFrame(WrapperCollection &)
void wrapFunctional(WrapperCollection &)
void wrapChebyMap(WrapperCollection &)
void wrapFrameDict(WrapperCollection &)
void wrapWinMap(WrapperCollection &)
void wrapFrame(WrapperCollection &)
void wrapWcsMap(WrapperCollection &)
void wrapLutMap(WrapperCollection &)
void wrapTable(WrapperCollection &)
void wrapTimeFrame(WrapperCollection &)
void wrapMatrixMap(WrapperCollection &)
void wrapTimeMap(WrapperCollection &)
void wrapPermMap(WrapperCollection &)
void wrapSkyFrame(WrapperCollection &)
void wrapFitsChan(WrapperCollection &)

◆ wrapBase()

void ast::wrapBase ( WrapperCollection & wrappers)

Definition at line 34 of file base.cc.

34 {
35 wrappers.module.def("assertOK", &assertOK, "rawObj1"_a = nullptr, "rawObj2"_a = nullptr);
36 wrappers.module.def("escapes", &escapes, "include"_a = -1);
37 wrappers.module.def("astVersion", &ast_version);
38
39 // Make a deep copy to avoid memory issues in Python
40 wrappers.module.def("arrayFromVector", [](std::vector<double> const& data, int nAxes) {
41 auto const arrayShallow = arrayFromVector(data, nAxes);
42 Array2D arrayDeep = allocate(arrayShallow.getShape());
43 arrayDeep.deep() = arrayShallow;
44 return arrayDeep;
45 }, "vec"_a, "nAxes"_a);
46
47 wrappers.wrapType(py::enum_<DataType>(wrappers.module, "DataType"), [](auto &mod, auto &enm) {
48 enm.value("IntType", DataType::IntType);
49 enm.value("ShortIntType", DataType::ShortIntType);
50 enm.value("ByteType", DataType::ByteType);
51 enm.value("DoubleType", DataType::DoubleType);
52 enm.value("FloatType", DataType::FloatType);
53 enm.value("StringType", DataType::StringType);
54 enm.value("ObjectType", DataType::ObjectType);
55 enm.value("PointerType", DataType::PointerType);
56 enm.value("UndefinedType", DataType::UndefinedType);
57 enm.value("BadType", DataType::BadType);
58 enm.export_values();
59 });
60}
char * data
Definition BaseRecord.cc:61
ndarray::Array< double, 2, 2 > Array2D
2D array of const double; typically used for lists of const points
Definition base.h:42

◆ wrapChannel() [1/2]

void ast::wrapChannel ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 36 of file channel.cc.

36 {
37 using PyChannel = py::class_<Channel, std::shared_ptr<Channel>, Object>;
38 wrappers.wrapType(PyChannel(wrappers.module, "Channel"), [](auto &mod, auto &cls) {
39
40 cls.def(py::init<Stream &, std::string const &>(), "stream"_a, "options"_a = "");
41
42 cls.def_property("comment", &Channel::getComment, &Channel::setComment);
43 cls.def_property("full", &Channel::getFull, &Channel::setFull);
44 cls.def_property("indent", &Channel::getIndent, &Channel::setIndent);
45 cls.def_property("reportLevel", &Channel::getReportLevel, &Channel::setReportLevel);
46 cls.def_property("skip", &Channel::getSkip, &Channel::setSkip);
47 cls.def_property("strict", &Channel::getStrict, &Channel::setStrict);
48
49 cls.def("copy", &Channel::copy);
50 cls.def("read", &Channel::read);
51 cls.def("write", &Channel::write, "object"_a);
52 cls.def("warnings", &Channel::warnings);
53 });
54}
Abstract base class for all AST objects.
Definition Object.h:51

◆ wrapChannel() [2/2]

void ast::wrapChannel ( WrapperCollection & )

◆ wrapChebyMap() [1/2]

void ast::wrapChebyMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 38 of file chebyMap.cc.

38 {
39 using PyChebyDomain = py::class_<ChebyDomain, std::shared_ptr<ChebyDomain>>;
40 wrappers.wrapType(PyChebyDomain(wrappers.module, "ChebyDomain"), [](auto &mod, auto &cls) {
41
42 cls.def(py::init<std::vector<double> const &, std::vector<double> const &>(), "lbnd"_a, "ubnd"_a);
43 cls.def_readonly("lbnd", &ChebyDomain::lbnd);
44 cls.def_readonly("ubnd", &ChebyDomain::ubnd);
45 });
46
47 using PyChebyMap = py::class_<ChebyMap, std::shared_ptr<ChebyMap>, Mapping>;
48 wrappers.wrapType(PyChebyMap(wrappers.module, "ChebyMap"), [](auto &mod, auto &cls) {
49
50 cls.def(py::init<ConstArray2D const &, ConstArray2D const &, std::vector<double> const &,
51 std::vector<double> const &, std::vector<double> const &, std::vector<double> const &,
52 std::string const &>(),
53 "coeff_i"_a, "coeff_i"_a, "lbnds_f"_a, "ubnds_f"_a, "lbnds_i"_a, "ubnds_i"_a, "options"_a = "");
54 cls.def(py::init<ConstArray2D const &, int, std::vector<double> const &, std::vector<double> const &,
55 std::string const &>(),
56 "coeff_i"_a, "nout"_a, "lbnds_f"_a, "ubnds_f"_a, "options"_a = "");
57 cls.def(py::init<ChebyMap const &>());
58
59 cls.def("copy", &ChebyMap::copy);
60 cls.def("getDomain", &ChebyMap::getDomain, "forward"_a);
61 cls.def("polyTran",
62 py::overload_cast<bool, double, double, int, std::vector<double> const &,
63 std::vector<double> const &>(&ChebyMap::polyTran, py::const_),
64 "forward"_a, "acc"_a, "maxacc"_a, "maxorder"_a, "lbnd"_a, "ubnd"_a);
65 cls.def("polyTran", py::overload_cast<bool, double, double, int>(&ChebyMap::polyTran, py::const_),
66 "forward"_a, "acc"_a, "maxacc"_a, "maxorder"_a);
67 });
68}
An abstract base class for objects which transform one set of coordinates to another.
Definition Mapping.h:59

◆ wrapChebyMap() [2/2]

void ast::wrapChebyMap ( WrapperCollection & )

◆ wrapCmpFrame() [1/2]

void ast::wrapCmpFrame ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 35 of file cmpFrame.cc.

35 {
36 using PyCmpFrame = py::class_<CmpFrame, std::shared_ptr<CmpFrame>, Frame>;
37 wrappers.wrapType(PyCmpFrame(wrappers.module, "CmpFrame"), [](auto &mod, auto &cls) {
38 cls.def(py::init<Frame const &, Frame const &, std::string const &>(), "frame1"_a, "frame2"_a,
39 "options"_a = "");
40 cls.def(py::init<CmpFrame const &>());
41 cls.def("__getitem__", &CmpFrame::operator[], py::is_operator());
42 cls.def("__len__", [](CmpFrame const &) { return 2; });
43 cls.def("copy", &CmpFrame::copy);
44 });
45}
Frame is used to represent a coordinate system.
Definition Frame.h:157

◆ wrapCmpFrame() [2/2]

void ast::wrapCmpFrame ( WrapperCollection & )

◆ wrapCmpMap() [1/2]

void ast::wrapCmpMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 33 of file cmpMap.cc.

33 {
34 using PrCmpMap = py::class_<CmpMap, std::shared_ptr<CmpMap>, Mapping>;
35 wrappers.wrapType(PrCmpMap(wrappers.module, "CmpMap"), [](auto &mod, auto &cls) {
36 cls.def(py::init<Mapping const &, Mapping const &, bool, std::string const &>(), "map1"_a, "map2"_a,
37 "series"_a, "options"_a = "");
38 cls.def(py::init<CmpMap const &>());
39 cls.def("__getitem__", &CmpMap::operator[], py::is_operator());
40 cls.def("__len__", [](CmpMap const &) { return 2; });
41 cls.def("copy", &CmpMap::copy);
42 cls.def_property_readonly("series", &CmpMap::getSeries);
43 });
44}

◆ wrapCmpMap() [2/2]

void ast::wrapCmpMap ( WrapperCollection & )

◆ wrapDirectionPoint()

void ast::wrapDirectionPoint ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 36 of file frame.cc.

36 {
37 wrappers.wrapType(py::class_<DirectionPoint>(wrappers.module, "DirectionPoint"), [](auto &mod, auto &cls) {
38 cls.def(py::init<double, PointD>(), "direction"_a, "point"_a);
39 cls.def_readwrite("direction", &DirectionPoint::direction);
40 cls.def_readwrite("point", &DirectionPoint::point);
41 });
42}

◆ wrapFitsChan() [1/2]

void ast::wrapFitsChan ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 51 of file fitsChan.cc.

51 {
52 wrappers.wrapType(py::enum_<FitsKeyState>(wrappers.module, "FitsKeyState"), [](auto &mod, auto &enm) {
53 enm.value("ABSENT", FitsKeyState::ABSENT);
54 enm.value("NOVALUE", FitsKeyState::NOVALUE);
55 enm.value("PRESENT", FitsKeyState::PRESENT);
56 enm.export_values();
57 });
58
59 wrappers.wrapType(py::enum_<CardType>(wrappers.module, "CardType"), [](auto &mod, auto &enm) {
60 enm.value("NOTYPE", CardType::NOTYPE);
61 enm.value("COMMENT", CardType::COMMENT);
62 enm.value("INT", CardType::INT);
63 enm.value("FLOAT", CardType::FLOAT);
64 enm.value("STRING", CardType::STRING);
65 enm.value("COMPLEXF", CardType::COMPLEXF);
66 enm.value("COMPLEXI", CardType::COMPLEXI);
67 enm.value("LOGICAL", CardType::LOGICAL);
68 enm.value("CONTINUE", CardType::CONTINUE);
69 enm.value("UNDEF", CardType::UNDEF);
70 enm.export_values();
71 });
72
73 // Wrap FoundValue struct for returning various types
74 wrapFoundValue<std::string>(wrappers, "S");
75 wrapFoundValue<std::complex<double>>(wrappers, "CF");
76 wrapFoundValue<double>(wrappers, "F");
77 wrapFoundValue<int>(wrappers, "I");
78 wrapFoundValue<bool>(wrappers, "L");
79
80 // Wrap FitsChan
81 using PyFitsChan = py::class_<FitsChan, std::shared_ptr<FitsChan>, Channel>;
82 wrappers.wrapType(PyFitsChan(wrappers.module, "FitsChan"), [](auto &mod, auto &cls) {
83 cls.def(py::init<Stream &, std::string const &>(), "stream"_a, "options"_a = "");
84
85 cls.def_property("carLin", &FitsChan::getCarLin, &FitsChan::setCarLin);
86 cls.def_property("cdMatrix", &FitsChan::getCDMatrix, &FitsChan::setCDMatrix);
87 cls.def_property("clean", &FitsChan::getClean, &FitsChan::setClean);
88 cls.def_property("defB1950", &FitsChan::getDefB1950, &FitsChan::setDefB1950);
89 cls.def_property("encoding", &FitsChan::getEncoding, &FitsChan::setEncoding);
90 cls.def_property("fitsAxisOrder", &FitsChan::getFitsAxisOrder, &FitsChan::setFitsAxisOrder);
91 cls.def_property("fitsDigits", &FitsChan::getFitsDigits, &FitsChan::setFitsDigits);
92 cls.def_property_readonly("nCard", &FitsChan::getNCard);
93 cls.def_property_readonly("nKey", &FitsChan::getNKey);
94 cls.def_property("iwc", &FitsChan::getIwc, &FitsChan::setIwc);
95 cls.def_property("sipOK", &FitsChan::getSipOK, &FitsChan::setSipOK);
96 cls.def_property("sipReplace", &FitsChan::getSipReplace, &FitsChan::setSipReplace);
97 cls.def_property("tabOK", &FitsChan::getTabOK, &FitsChan::setTabOK);
98 cls.def_property("polyTan", &FitsChan::getPolyTan, &FitsChan::setPolyTan);
99 cls.def_property("warnings", &FitsChan::getWarnings, &FitsChan::setWarnings);
100 cls.def_property("fitsTol", &FitsChan::getFitsTol, &FitsChan::setFitsTol);
101
102 cls.def("delFits", &FitsChan::delFits);
103 cls.def("emptyFits", &FitsChan::emptyFits);
104 cls.def("findFits", &FitsChan::findFits, "name"_a, "inc"_a);
105 cls.def("getFitsCF", &FitsChan::getFitsCF, "name"_a = "", "defval"_a = std::complex<double>(0, 0));
106 cls.def("getFitsCN", &FitsChan::getFitsCN, "name"_a = "", "defval"_a = "");
107 cls.def("getFitsF", &FitsChan::getFitsF, "name"_a = "", "defval"_a = 0);
108 cls.def("getFitsI", &FitsChan::getFitsI, "name"_a = "", "defval"_a = 0);
109 cls.def("getFitsL", &FitsChan::getFitsL, "name"_a = "", "defval"_a = false);
110 cls.def("getFitsS", &FitsChan::getFitsS, "name"_a = "", "defval"_a = "");
111 cls.def("getAllCardNames", &FitsChan::getAllCardNames);
112 cls.def("getAllWarnings", &FitsChan::getAllWarnings);
113 cls.def("getCard", &FitsChan::getCard);
114 cls.def("getCardComm", &FitsChan::getCardComm);
115 cls.def("getCardName", &FitsChan::getCardName);
116 cls.def("getCardType", &FitsChan::getCardType);
117 cls.def("getTables", &FitsChan::getTables);
118 cls.def("purgeWcs", &FitsChan::purgeWcs);
119 cls.def("putCards", &FitsChan::putCards, "cards"_a);
120 cls.def("putFits", &FitsChan::putFits, "card"_a, "overwrite"_a);
121 cls.def("readFits", &FitsChan::readFits);
122 cls.def("retainFits", &FitsChan::retainFits);
123 cls.def("setFitsCF", &FitsChan::setFitsCF, "name"_a, "value"_a, "comment"_a = "", "overwrite"_a = false);
124 cls.def("setFitsCM", &FitsChan::setFitsCM, "comment"_a = "", "overwrite"_a = false);
125 cls.def("setFitsCN", &FitsChan::setFitsCN, "name"_a, "value"_a, "comment"_a = "", "overwrite"_a = false);
126 cls.def("setFitsF", &FitsChan::setFitsF, "name"_a, "value"_a, "comment"_a = "", "overwrite"_a = false);
127 cls.def("setFitsI", &FitsChan::setFitsI, "name"_a, "value"_a, "comment"_a = "", "overwrite"_a = false);
128 cls.def("setFitsL", &FitsChan::setFitsL, "name"_a, "value"_a, "comment"_a = "", "overwrite"_a = false);
129 cls.def("setFitsS", &FitsChan::setFitsS, "name"_a, "value"_a, "comment"_a = "", "overwrite"_a = false);
130 cls.def("setFitsU", &FitsChan::setFitsU, "name"_a, "comment"_a = "", "overwrite"_a = false);
131 cls.def("showFits", &FitsChan::showFits);
132 cls.def("testFits", &FitsChan::testFits, "name"_a = "");
133 cls.def("writeFits", &FitsChan::writeFits);
134 cls.def("clearCard", &FitsChan::clearCard);
135 cls.def("setCard", &FitsChan::setCard, "i"_a);
136 });
137}
Channel provides input/output of AST objects.
Definition Channel.h:60

◆ wrapFitsChan() [2/2]

void ast::wrapFitsChan ( WrapperCollection & )

◆ wrapFitsTable() [1/2]

void ast::wrapFitsTable ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 39 of file fitsTable.cc.

39 {
40 using PyFitsTable = py::class_<FitsTable, std::shared_ptr<FitsTable>, Table>;
41 wrappers.wrapType(PyFitsTable(wrappers.module, "FitsTable"), [](auto &mod, auto &cls) {
42 cls.def(py::init<std::string const &>(), "options"_a = "");
43 cls.def(py::init<FitsChan const &, std::string const &>(), "header"_a, "options"_a = "");
44 cls.def("getTableHeader", &FitsTable::getTableHeader);
45 cls.def("columnSize", &FitsTable::columnSize, "column"_a);
46 cls.def("getColumnData1D", &FitsTable::getColumnData1D, "column"_a);
47 });
48}

◆ wrapFitsTable() [2/2]

void ast::wrapFitsTable ( WrapperCollection & )

◆ wrapFrame() [1/2]

void ast::wrapFrame ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 69 of file frame.cc.

69 {
70 wrapDirectionPoint(wrappers);
71 wrapNReadValue(wrappers);
72 wrapResolvedPoint(wrappers);
73 wrapFrameMapping(wrappers);
74
75 using PyFrame = py::class_<Frame, std::shared_ptr<Frame>, Mapping>;
76 wrappers.wrapType(PyFrame(wrappers.module, "Frame"), [](auto &mod, auto &cls) {
77 cls.def(py::init<int, std::string const &>(), "naxes"_a, "options"_a = "");
78 cls.def(py::init<Frame const &>());
79
80 cls.def_property("activeUnit", &Frame::getActiveUnit, &Frame::setActiveUnit);
81 cls.def_property("alignSystem", &Frame::getAlignSystem, &Frame::setAlignSystem);
82 cls.def_property("domain", &Frame::getDomain, &Frame::setDomain);
83 cls.def_property("dut1", &Frame::getDut1, &Frame::setDut1);
84 cls.def_property("epoch", &Frame::getEpoch, py::overload_cast<double>(&Frame::setEpoch));
85 cls.def_property("matchEnd", &Frame::getMatchEnd, &Frame::setMatchEnd);
86 cls.def_property("maxAxes", &Frame::getMaxAxes, &Frame::setMaxAxes);
87 cls.def_property("minAxes", &Frame::getMinAxes, &Frame::setMinAxes);
88 cls.def_property_readonly("nAxes", &Frame::getNAxes);
89 cls.def_property("obsAlt", &Frame::getObsAlt, &Frame::setObsAlt);
90 cls.def_property("obsLat", &Frame::getObsLat, &Frame::setObsLat);
91 cls.def_property("obsLon", &Frame::getObsLon, &Frame::setObsLon);
92 cls.def_property("permute", &Frame::getPermute, &Frame::setPermute);
93 cls.def_property("preserveAxes", &Frame::getPreserveAxes, &Frame::setPreserveAxes);
94 cls.def_property("system", &Frame::getSystem, &Frame::setSystem);
95 cls.def_property("title", &Frame::getTitle, &Frame::setTitle);
96
97 cls.def("copy", &Frame::copy);
98 cls.def("angle", &Frame::angle, "a"_a, "b"_a, "c"_a);
99 cls.def("axAngle", &Frame::axAngle, "a"_a, "b"_a, "axis"_a);
100 cls.def("axDistance", &Frame::axDistance, "axis"_a, "v1"_a, "v2"_a);
101 cls.def("axOffset", &Frame::axOffset, "axis"_a, "v1"_a, "dist"_a);
102 cls.def("convert", &Frame::convert, "to"_a, "domainlist"_a = "");
103 cls.def("distance", &Frame::distance, "point1"_a, "point2"_a);
104 cls.def("findFrame", &Frame::findFrame, "template"_a, "domainlist"_a = "");
105 cls.def("format", &Frame::format, "axis"_a, "value"_a);
106 cls.def("getBottom", &Frame::getBottom, "axis"_a);
107 cls.def("getDigits", py::overload_cast<>(&Frame::getDigits, py::const_));
108 cls.def("getDigits", py::overload_cast<int>(&Frame::getDigits, py::const_), "axis"_a);
109 cls.def("getDirection", &Frame::getDirection, "axis"_a);
110 cls.def("getFormat", &Frame::getFormat, "axis"_a);
111 cls.def("getInternalUnit", &Frame::getInternalUnit);
112 cls.def("getLabel", &Frame::getLabel);
113 cls.def("getSymbol", &Frame::getSymbol, "axis"_a);
114 cls.def("getNormUnit", &Frame::getNormUnit, "axis"_a);
115 cls.def("getSymbol", &Frame::getSymbol, "axis"_a);
116 cls.def("getTop", &Frame::getTop, "axis"_a);
117 cls.def("getUnit", &Frame::getUnit, "axis"_a);
118 cls.def("intersect", &Frame::intersect, "a1"_a, "a2"_a, "b1"_a, "b2"_a);
119 cls.def("matchAxes", &Frame::matchAxes, "other"_a);
120 cls.def("under", &Frame::under, "next"_a);
121 cls.def("norm", &Frame::norm, "value"_a);
122 cls.def("offset", &Frame::offset, "point1"_a, "point2"_a, "offset"_a);
123 cls.def("offset2", &Frame::offset2, "point1"_a, "angle"_a, "offset"_a);
124 cls.def("permAxes", &Frame::permAxes, "perm"_a);
125 cls.def("pickAxes", &Frame::pickAxes, "axes"_a);
126 cls.def("resolve", &Frame::resolve, "point1"_a, "point2"_a, "point3"_a);
127 cls.def("setDigits", py::overload_cast<int>(&Frame::setDigits), "digits"_a);
128 cls.def("setDigits", py::overload_cast<int, int>(&Frame::setDigits), "axis"_a, "digits"_a);
129 cls.def("setDirection", &Frame::setDirection, "direction"_a, "axis"_a);
130
131 // keep setEpoch(string); use the epoch property to deal with it as a float
132 cls.def("setEpoch", py::overload_cast<std::string const &>(&Frame::setEpoch), "epoch"_a);
133 cls.def("setFormat", &Frame::setFormat, "axis"_a, "format"_a"format");
134 cls.def("setLabel", &Frame::setLabel, "axis"_a, "label"_a);
135 cls.def("setSymbol", &Frame::setSymbol, "axis"_a, "symbol"_a);
136 cls.def("setTop", &Frame::setTop, "axis"_a, "top"_a);
137 cls.def("setUnit", &Frame::setUnit, "axis"_a, "unit"_a);
138 cls.def("unformat", &Frame::unformat, "axis"_a, "str"_a);
139 });
140}
void wrapFrameMapping(lsst::utils::python::WrapperCollection &wrappers)
Definition frame.cc:61
void wrapResolvedPoint(lsst::utils::python::WrapperCollection &wrappers)
Definition frame.cc:52
void wrapNReadValue(lsst::utils::python::WrapperCollection &wrappers)
Definition frame.cc:44
void wrapDirectionPoint(lsst::utils::python::WrapperCollection &wrappers)
Definition frame.cc:36

◆ wrapFrame() [2/2]

void ast::wrapFrame ( WrapperCollection & )

◆ wrapFrameDict() [1/2]

void ast::wrapFrameDict ( lsst::utils::python::WrapperCollection & wrappers)

Override standard pickling support so we get a FrameDict back, instead of a FrameSet

Definition at line 66 of file frameDict.cc.

66 {
67 using PyFrameDictMaker = py::class_<FrameDictMaker, std::shared_ptr<FrameDictMaker>>;
68 static auto clsMaker = wrappers.wrapType(PyFrameDictMaker(wrappers.module, "FrameDictMaker"), [](auto &mod, auto &cls) {
69 cls.def(py::init<>());
70 cls.def("__call__", &FrameDictMaker::operator());
71 cls.def("__reduce__",
72 [cls](FrameDictMaker const &self) { return py::make_tuple(cls, py::tuple()); });
73 });
74
75 using PyFrameDict = py::class_<FrameDict, std::shared_ptr<FrameDict>, FrameSet>;
76 wrappers.wrapType(PyFrameDict(wrappers.module, "FrameDict"), [](auto &mod, auto &cls) {
77
78 cls.def(py::init<Frame const &, std::string const &>(), "frame"_a, "options"_a = "");
79 cls.def(py::init<Frame const &, Mapping const &, Frame const &, std::string const &>(), "baseFrame"_a,
80 "mapping"_a, "currentFrame"_a, "options"_a = "");
81 cls.def(py::init<FrameSet const &>(), "frameSet"_a);
82 cls.def(py::init<FrameDict const &>());
83
84 cls.def("copy", &FrameDict::copy);
85
86 cls.def("addFrame", py::overload_cast<int, Mapping const &, Frame const &>(&FrameDict::addFrame),
87 "iframe"_a, "map"_a, "frame"_a);
88 cls.def("addFrame",
89 py::overload_cast<std::string const &, Mapping const &, Frame const &>(&FrameDict::addFrame),
90 "domain"_a, "map"_a, "frame"_a);
91 cls.def("getAllDomains", &FrameDict::getAllDomains);
92 cls.def("getFrame", py::overload_cast<int, bool>(&FrameDict::getFrame, py::const_), "index"_a,
93 "copy"_a = true);
94 cls.def("getFrame", py::overload_cast<std::string const &, bool>(&FrameDict::getFrame, py::const_),
95 "domain"_a, "copy"_a = true);
96 cls.def("getMapping", py::overload_cast<int, int>(&FrameDict::getMapping, py::const_),
97 "from"_a = FrameDict::BASE, "to"_a = FrameDict::CURRENT);
98 cls.def("getMapping", py::overload_cast<int, std::string const &>(&FrameDict::getMapping, py::const_),
99 "from"_a = FrameDict::BASE, "to"_a = FrameDict::CURRENT);
100 cls.def("getMapping", py::overload_cast<std::string const &, int>(&FrameDict::getMapping, py::const_),
101 "from"_a = FrameDict::BASE, "to"_a = FrameDict::CURRENT);
102 cls.def("getMapping",
103 py::overload_cast<std::string const &, std::string const &>(&FrameDict::getMapping, py::const_),
104 "from"_a = FrameDict::BASE, "to"_a = FrameDict::CURRENT);
105 cls.def("getIndex", &FrameDict::getIndex, "domain"_a);
106 cls.def("hasDomain", &FrameDict::hasDomain, "domain"_a);
107 cls.def("mirrorVariants", py::overload_cast<int>(&FrameDict::mirrorVariants), "index"_a);
108 cls.def("mirrorVariants", py::overload_cast<std::string const &>(&FrameDict::mirrorVariants), "domain"_a);
109 cls.def("remapFrame", py::overload_cast<int, Mapping &>(&FrameDict::remapFrame), "index"_a, "map"_a);
110 cls.def("remapFrame", py::overload_cast<std::string const &, Mapping &>(&FrameDict::remapFrame),
111 "domain"_a, "map"_a);
112 cls.def("removeFrame", py::overload_cast<int>(&FrameDict::removeFrame), "index"_a);
113 cls.def("removeFrame", py::overload_cast<std::string const &>(&FrameDict::removeFrame), "domain"_a);
114 cls.def("setBase", py::overload_cast<int>(&FrameDict::setBase), "index"_a);
115 cls.def("setBase", py::overload_cast<std::string const &>(&FrameDict::setBase), "domain"_a);
116 cls.def("setCurrent", py::overload_cast<int>(&FrameDict::setCurrent), "index"_a);
117 cls.def("setCurrent", py::overload_cast<std::string const &>(&FrameDict::setCurrent), "domain"_a);
118 cls.def("setDomain", &FrameDict::setDomain, "domain"_a);
119
121 cls.def("__reduce__", [](Object const &self) {
122 std::string state = self.show(false);
123 auto unpickleArgs = py::make_tuple(state);
124 return py::make_tuple(clsMaker(), unpickleArgs);
125 });
126 });
127}

◆ wrapFrameDict() [2/2]

void ast::wrapFrameDict ( WrapperCollection & )

◆ wrapFrameMapping()

void ast::wrapFrameMapping ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 61 of file frame.cc.

61 {
62 wrappers.wrapType(py::class_<FrameMapping>(wrappers.module, "FrameMapping"), [](auto &mod, auto &cls) {
63 cls.def(py::init<std::shared_ptr<Frame>, std::shared_ptr<Mapping>>(), "frame"_a, "mapping"_a);
64 cls.def_readwrite("frame", &FrameMapping::frame);
65 cls.def_readwrite("mapping", &FrameMapping::mapping);
66 });
67}

◆ wrapFrameSet() [1/2]

void ast::wrapFrameSet ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 33 of file frameSet.cc.

33 {
34 using PyFrameSet = py::class_<FrameSet, std::shared_ptr<FrameSet>, Frame>;
35 wrappers.wrapType(PyFrameSet(wrappers.module, "FrameSet"), [](auto &mod, auto &cls) {
36 cls.def(py::init<Frame const &, std::string const &>(), "frame"_a, "options"_a = "");
37 cls.def(py::init<Frame const &, Mapping const &, Frame const &, std::string const &>(), "baseFrame"_a,
38 "mapping"_a, "currentFrame"_a, "options"_a = "");
39 cls.def(py::init<Frame const &>());
40
41 // def_readonly_static makes in only available in the class, not instances, so...
42 cls.attr("BASE") = py::cast(AST__BASE);
43 cls.attr("CURRENT") = py::cast(AST__CURRENT);
44 cls.attr("NOFRAME") = py::cast(AST__NOFRAME);
45
46 cls.def_property("base", &FrameSet::getBase, &FrameSet::setBase);
47 cls.def_property("current", &FrameSet::getCurrent, &FrameSet::setCurrent);
48 cls.def_property_readonly("nFrame", &FrameSet::getNFrame);
49
50 cls.def("copy", &FrameSet::copy);
51 cls.def("addAxes", &FrameSet::addAxes);
52 cls.def("addFrame", &FrameSet::addFrame, "iframe"_a, "map"_a, "frame"_a);
53 cls.def("addVariant", &FrameSet::addVariant, "map"_a, "name"_a);
54 cls.def("getAllVariants", &FrameSet::getAllVariants);
55 cls.def("getFrame", &FrameSet::getFrame, "iframe"_a, "copy"_a = true);
56 cls.def("getMapping", &FrameSet::getMapping, "from"_a = FrameSet::BASE, "to"_a = FrameSet::CURRENT);
57 cls.def("getVariant", &FrameSet::getVariant);
58 cls.def("mirrorVariants", &FrameSet::mirrorVariants, "iframe"_a);
59 cls.def("remapFrame", &FrameSet::remapFrame, "iframe"_a, "map"_a);
60 cls.def("removeFrame", &FrameSet::removeFrame, "iframe"_a);
61 cls.def("renameVariant", &FrameSet::renameVariant, "name"_a);
62 });
63}

◆ wrapFrameSet() [2/2]

void ast::wrapFrameSet ( WrapperCollection & )

◆ wrapFunctional() [1/2]

void ast::wrapFunctional ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 33 of file functional.cc.

33 {
34 wrappers.module.def("append", &append, "first"_a, "second"_a);
35 wrappers.module.def("makeRadialMapping", &makeRadialMapping, "center"_a, "mapping1d"_a);
36}

◆ wrapFunctional() [2/2]

void ast::wrapFunctional ( WrapperCollection & )

◆ wrapKeyMap() [1/2]

void ast::wrapKeyMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 36 of file keyMap.cc.

36 {
37 using PyKeyMap = py::class_<KeyMap, std::shared_ptr<KeyMap>, Object> ;
38 wrappers.wrapType(PyKeyMap (wrappers.module, "KeyMap"), [](auto &mod, auto &cls) {
39
40
41 cls.def(py::init<std::string const &>(), "options"_a = "");
42
43 cls.def("copy", &KeyMap::copy);
44 cls.def("defined", &KeyMap::defined, "key"_a);
45 cls.def("key", &KeyMap::key, "ind"_a);
46 cls.def("hasKey", &KeyMap::hasKey, "key"_a);
47 cls.def("length", &KeyMap::length);
48 cls.def("__len__", &KeyMap::size);
49
50 cls.def("getD", py::overload_cast<std::string const &, int>(&KeyMap::getD, py::const_), "key"_a, "ind"_a);
51 cls.def("getD", py::overload_cast<std::string const &>(&KeyMap::getD, py::const_), "key"_a);
52 cls.def("getF", py::overload_cast<std::string const &, int>(&KeyMap::getF, py::const_), "key"_a, "ind"_a);
53 cls.def("getF", py::overload_cast<std::string const &>(&KeyMap::getF, py::const_), "key"_a);
54 cls.def("getI", py::overload_cast<std::string const &, int>(&KeyMap::getI, py::const_), "key"_a, "ind"_a);
55 cls.def("getI", py::overload_cast<std::string const &>(&KeyMap::getI, py::const_), "key"_a);
56 cls.def("getS", py::overload_cast<std::string const &, int>(&KeyMap::getS, py::const_), "key"_a, "ind"_a);
57 cls.def("getS", py::overload_cast<std::string const &>(&KeyMap::getS, py::const_), "key"_a);
58 cls.def("getB", py::overload_cast<std::string const &, int>(&KeyMap::getB, py::const_), "key"_a, "ind"_a);
59 cls.def("getB", py::overload_cast<std::string const &>(&KeyMap::getB, py::const_), "key"_a);
60 cls.def("getC", py::overload_cast<std::string const &, int>(&KeyMap::getC, py::const_), "key"_a, "ind"_a);
61 cls.def("getC", py::overload_cast<std::string const &>(&KeyMap::getC, py::const_), "key"_a);
62 cls.def("getA", py::overload_cast<std::string const &, int>(&KeyMap::getA, py::const_), "key"_a, "ind"_a);
63 cls.def("getA", py::overload_cast<std::string const &>(&KeyMap::getA, py::const_), "key"_a);
64
65 cls.def("putD", py::overload_cast<std::string const &, double, std::string const &>(&KeyMap::putD),
66 "key"_a, "value"_a, "comment"_a = "");
67 cls.def("putD",
68 py::overload_cast<std::string const &, std::vector<double> const &, std::string const &>(
69 &KeyMap::putD),
70 "key"_a, "vec"_a, "comment"_a = "");
71 cls.def("putF", py::overload_cast<std::string const &, float, std::string const &>(&KeyMap::putF),
72 "key"_a, "value"_a, "comment"_a = "");
73 cls.def("putF",
74 py::overload_cast<std::string const &, std::vector<float> const &, std::string const &>(
75 &KeyMap::putF),
76 "key"_a, "vec"_a, "comment"_a = "");
77 cls.def("putI", py::overload_cast<std::string const &, int, std::string const &>(&KeyMap::putI), "key"_a,
78 "value"_a, "comment"_a = "");
79 cls.def("putI",
80 py::overload_cast<std::string const &, std::vector<int> const &, std::string const &>(
81 &KeyMap::putI),
82 "key"_a, "vec"_a, "comment"_a = "");
83 cls.def("putS", py::overload_cast<std::string const &, short int, std::string const &>(&KeyMap::putS),
84 "key"_a, "value"_a, "comment"_a = "");
85 cls.def("putS",
86 py::overload_cast<std::string const &, std::vector<short int> const &, std::string const &>(
87 &KeyMap::putS),
88 "key"_a, "vec"_a, "comment"_a = "");
89 cls.def("putB", py::overload_cast<std::string const &, char unsigned, std::string const &>(&KeyMap::putB),
90 "key"_a, "value"_a, "comment"_a = "");
91 cls.def("putB",
92 py::overload_cast<std::string const &, std::vector<char unsigned> const &, std::string const &>(
93 &KeyMap::putB),
94 "key"_a, "vec"_a, "comment"_a = "");
95 cls.def("putC",
96 py::overload_cast<std::string const &, std::string const &, std::string const &>(&KeyMap::putC),
97 "key"_a, "value"_a, "comment"_a = "");
98 cls.def("putC",
99 py::overload_cast<std::string const &, std::vector<std::string> const &, std::string const &>(
100 &KeyMap::putC),
101 "key"_a, "vec"_a, "comment"_a = "");
102 cls.def("putA",
103 py::overload_cast<std::string const &, Object const &, std::string const &>(&KeyMap::putA),
104 "key"_a, "value"_a, "comment"_a = "");
105 cls.def("putA",
106 py::overload_cast<std::string const &, std::vector<std::shared_ptr<Object const>> const &,
107 std::string const &>(&KeyMap::putA),
108 "key"_a, "vec"_a, "comment"_a = "");
109
110 cls.def("putU", py::overload_cast<std::string const &, std::string const &>(&KeyMap::putU), "key"_a,
111 "comment"_a = "");
112
113 // there no need to wrap float, short int and unsigned char versions since the type of the key
114 // is already known and the data will be cast
115 // list int first, then float because the first match is used
116 cls.def("append", py::overload_cast<std::string const &, int>(&KeyMap::append), "key"_a, "value"_a);
117 cls.def("append", py::overload_cast<std::string const &, double>(&KeyMap::append), "key"_a, "value"_a);
118 cls.def("append", py::overload_cast<std::string const &, std::string const &>(&KeyMap::append), "key"_a,
119 "value"_a);
120 cls.def("append", py::overload_cast<std::string const &, Object const &>(&KeyMap::append), "key"_a,
121 "value"_a);
122
123 // there no need to wrap float, short int and unsigned char versions since the type of the key
124 // is already known and the data will be cast
125 // list int first, then float because the first match is used
126 cls.def("replace", py::overload_cast<std::string const &, int, int>(&KeyMap::replace), "key"_a, "ind"_a,
127 "value"_a);
128 cls.def("replace", py::overload_cast<std::string const &, int, double>(&KeyMap::replace), "key"_a,
129 "ind"_a, "value"_a);
130 cls.def("replace", py::overload_cast<std::string const &, int, std::string const &>(&KeyMap::replace),
131 "key"_a, "ind"_a, "value"_a);
132 cls.def("replace", py::overload_cast<std::string const &, int, Object const &>(&KeyMap::replace), "key"_a,
133 "ind"_a, "value"_a);
134
135 cls.def("remove", &KeyMap::remove, "key"_a);
136 cls.def("rename", &KeyMap::rename, "oldKey"_a, "newKey"_a);
137 cls.def("type", &KeyMap::type, "key"_a);
138 });
139}

◆ wrapKeyMap() [2/2]

void ast::wrapKeyMap ( WrapperCollection & )

◆ wrapLutMap() [1/2]

void ast::wrapLutMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 37 of file lutMap.cc.

37 {
38 using PyLutMap = py::class_<LutMap, std::shared_ptr<LutMap>, Mapping>;
39 wrappers.wrapType(PyLutMap(wrappers.module, "LutMap"), [](auto &mod, auto &cls) {
40 cls.def(py::init<std::vector<double> const &, double, double, std::string const &>(), "lut"_a, "start"_a,
41 "inc"_a, "options"_a = "");
42 cls.def(py::init<LutMap const &>());
43 cls.def_property_readonly("lutEpsilon", &LutMap::getLutEpsilon);
44 cls.def_property_readonly("lutInterp", &LutMap::getLutInterp);
45 cls.def("copy", &LutMap::copy);
46 });
47}

◆ wrapLutMap() [2/2]

void ast::wrapLutMap ( WrapperCollection & )

◆ wrapMapBox() [1/2]

void ast::wrapMapBox ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 35 of file mapBox.cc.

35 {
36 using PyMapBox = py::class_<MapBox>;
37 wrappers.wrapType(PyMapBox(wrappers.module, "MapBox"), [](auto &mod, auto &cls) {
38 cls.def(py::init<Mapping const &, std::vector<double> const &, std::vector<double> const &, int, int>(),
39 "map"_a, "lbnd"_a, "ubnd"_a, "minOutCoord"_a = 1, "maxOutCoord"_a = 0);
40 cls.def_readonly("lbndIn", &MapBox::lbndIn);
41 cls.def_readonly("ubndIn", &MapBox::ubndIn);
42 cls.def_readonly("minOutCoord", &MapBox::minOutCoord);
43 cls.def_readonly("maxOutCoord", &MapBox::maxOutCoord);
44 cls.def_readonly("lbndOut", &MapBox::lbndOut);
45 cls.def_readonly("ubndOut", &MapBox::ubndOut);
46 cls.def_readonly("xl", &MapBox::xl);
47 cls.def_readonly("xu", &MapBox::xu);
48 });
49}

◆ wrapMapBox() [2/2]

void ast::wrapMapBox ( WrapperCollection & )

◆ wrapMapping() [1/2]

void ast::wrapMapping ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 38 of file mapping.cc.

38 {
39using PyMapping = py::class_<Mapping, std::shared_ptr<Mapping>, Object>;
40 wrappers.wrapType(PyMapping(wrappers.module, "Mapping"), [](auto &mod, auto &cls) {
41 cls.def_property_readonly("nIn", &Mapping::getNIn);
42 cls.def_property_readonly("nOut", &Mapping::getNOut);
43 cls.def_property_readonly("isSimple", &Mapping::getIsSimple);
44 cls.def_property_readonly("hasForward", &Mapping::hasForward);
45 cls.def_property_readonly("hasInverse", &Mapping::hasInverse);
46 cls.def_property_readonly("isInverted", &Mapping::isInverted);
47 cls.def_property_readonly("isLinear", &Mapping::getIsLinear);
48 cls.def_property("report", &Mapping::getReport, &Mapping::setReport);
49 cls.def("copy", &Mapping::copy);
50 cls.def("inverted", &Mapping::inverted);
51 cls.def("linearApprox", &Mapping::linearApprox, "lbnd"_a, "ubnd"_a, "tol"_a);
52 cls.def("then", &Mapping::then, "next"_a);
53 cls.def("under", &Mapping::under, "next"_a);
54 cls.def("rate", &Mapping::rate, "at"_a, "ax1"_a, "ax2"_a);
55 cls.def("simplified", &Mapping::simplified);
56 // wrap the overloads of applyForward, applyInverse, tranGridForward and tranGridInverse that return a new
57 // result
58 cls.def("applyForward", py::overload_cast<ConstArray2D const &>(&Mapping::applyForward, py::const_),
59 "from"_a);
60 cls.def("applyForward",
61 py::overload_cast<std::vector<double> const &>(&Mapping::applyForward, py::const_), "from"_a);
62 cls.def("applyInverse", py::overload_cast<ConstArray2D const &>(&Mapping::applyInverse, py::const_),
63 "from"_a);
64 cls.def("applyInverse",
65 py::overload_cast<std::vector<double> const &>(&Mapping::applyInverse, py::const_), "from"_a);
66 cls.def("tranGridForward",
67 py::overload_cast<PointI const &, PointI const &, double, int, int>(&Mapping::tranGridForward,
68 py::const_),
69 "lbnd"_a, "ubnd"_a, "tol"_a, "maxpix"_a, "nPoints"_a);
70 cls.def("tranGridInverse",
71 py::overload_cast<PointI const &, PointI const &, double, int, int>(&Mapping::tranGridInverse,
72 py::const_),
73 "lbnd"_a, "ubnd"_a, "tol"_a, "maxpix"_a, "nPoints"_a);
74 });
75}

◆ wrapMapping() [2/2]

void ast::wrapMapping ( WrapperCollection & )

◆ wrapMapSplit() [1/2]

void ast::wrapMapSplit ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 36 of file mapSplit.cc.

36 {
37 using PyMapSplit = py::class_<MapSplit>;
38 wrappers.wrapType(PyMapSplit(wrappers.module, "MapSplit"), [](auto &mod, auto &cls) {
39 cls.def(py::init<Mapping const &, std::vector<int> const &>(), "map"_a, "in"_a);
40 cls.def_readonly("splitMap", &MapSplit::splitMap);
41 cls.def_readonly("origIn", &MapSplit::origIn);
42 cls.def_readonly("origOut", &MapSplit::origOut);
43 });
44}

◆ wrapMapSplit() [2/2]

void ast::wrapMapSplit ( WrapperCollection & )

◆ wrapMathMap() [1/2]

void ast::wrapMathMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 38 of file mathMap.cc.

38 {
39using PyMathMap = py::class_<MathMap, std::shared_ptr<MathMap>, Mapping>;
40 wrappers.wrapType(PyMathMap(wrappers.module, "MathMap"), [](auto &mod, auto &cls) {
41 cls.def(py::init<int, int, std::vector<std::string> const &, std::vector<std::string> const &,
42 std::string const &>(),
43 "nin"_a, "nout"_a, "fwd"_a, "ref"_a, "options"_a = "");
44 cls.def(py::init<MathMap const &>());
45 cls.def_property_readonly("seed", &MathMap::getSeed);
46 cls.def_property_readonly("simpFI", &MathMap::getSimpFI);
47 cls.def_property_readonly("simpIF", &MathMap::getSimpIF);
48 cls.def("copy", &MathMap::copy);
49 });
50}

◆ wrapMathMap() [2/2]

void ast::wrapMathMap ( WrapperCollection & )

◆ wrapMatrixMap() [1/2]

void ast::wrapMatrixMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 35 of file matrixMap.cc.

35 {
36 using PyMatrixMap = py::class_<MatrixMap, std::shared_ptr<MatrixMap>, Mapping>;
37 wrappers.wrapType(PyMatrixMap(wrappers.module, "MatrixMap"), [](auto &mod, auto &cls) {
38 cls.def(py::init<ConstArray2D const &, std::string const &>(), "matrix"_a, "options"_a = "");
39 cls.def(py::init<std::vector<double> const &, std::string const &>(), "diag"_a, "options"_a = "");
40 cls.def(py::init<MatrixMap const &>());
41 cls.def("copy", &MatrixMap::copy);
42 });
43}

◆ wrapMatrixMap() [2/2]

void ast::wrapMatrixMap ( WrapperCollection & )

◆ wrapNormMap() [1/2]

void ast::wrapNormMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 36 of file normMap.cc.

36 {
37 using PyNormMap = py::class_<NormMap, std::shared_ptr<NormMap>, Mapping>;
38 wrappers.wrapType(PyNormMap(wrappers.module, "NormMap"), [](auto &mod, auto &cls) {
39 cls.def(py::init<Frame const &, std::string const &>(), "frame"_a, "options"_a = "");
40 cls.def(py::init<NormMap const &>());
41 cls.def("copy", &NormMap::copy);
42 });
43}

◆ wrapNormMap() [2/2]

void ast::wrapNormMap ( WrapperCollection & )

◆ wrapNReadValue()

void ast::wrapNReadValue ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 44 of file frame.cc.

44 {
45 wrappers.wrapType(py::class_<NReadValue>(wrappers.module, "NReadValue"), [](auto &mod, auto &cls) {
46 cls.def(py::init<int, double>(), "nread"_a, "value"_a);
47 cls.def_readwrite("nread", &NReadValue::nread);
48 cls.def_readwrite("value", &NReadValue::value);
49 });
50}

◆ wrapObject() [1/2]

void ast::wrapObject ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 57 of file object.cc.

57 {
58 using PyObjectMaker = py::class_<ObjectMaker, std::shared_ptr<ObjectMaker>>;
59 static auto makerCls = wrappers.wrapType(PyObjectMaker(wrappers.module, "ObjectMaker"), [](auto &mod, auto &cls) {
60 cls.def(py::init<>());
61 cls.def("__call__", &ObjectMaker::operator());
62 cls.def("__reduce__",
63 [cls](ObjectMaker const &self) { return py::make_tuple(cls, py::tuple()); });
64 });
65
66 using PyObject = py::class_<Object, std::shared_ptr<Object>>;
67 wrappers.wrapType(PyObject(wrappers.module, "Object"), [](auto &mod, auto &cls) {
68 cls.def_static("fromString", &Object::fromString);
69 // do not wrap fromAstObject because it uses a bare AST pointer
70 cls.def("__str__", &Object::getClassName);
71 cls.def("__repr__", [](Object const &self) { return "astshim." + self.getClassName(); });
72 cls.def("__eq__", &Object::operator==, py::is_operator());
73 cls.def("__ne__", &Object::operator!=, py::is_operator());
74
75 cls.def_property_readonly("className", &Object::getClassName);
76 cls.def_property("id", &Object::getID, &Object::setID);
77 cls.def_property("ident", &Object::getIdent, &Object::setIdent);
78 cls.def_property_readonly("objSize", &Object::getObjSize);
79 cls.def_property("useDefs", &Object::getUseDefs, &Object::setUseDefs);
80
81 cls.def("copy", &Object::copy);
82 cls.def("clear", &Object::clear, "attrib"_a);
83 cls.def("hasAttribute", &Object::hasAttribute, "attrib"_a);
84 cls.def("getNObject", &Object::getNObject);
85 cls.def("getRefCount", &Object::getRefCount);
86 cls.def("lock", &Object::lock, "wait"_a);
87 cls.def("same", &Object::same, "other"_a);
88 // do not wrap the ostream version of show, since there is no obvious Python equivalent to ostream
89 cls.def("show", py::overload_cast<bool>(&Object::show, py::const_), "showComments"_a = true);
90
91 cls.def("test", &Object::test, "attrib"_a);
92 cls.def("unlock", &Object::unlock, "report"_a = false);
93 // do not wrap getRawPtr, since it returns a bare AST pointer
94
95 // add pickling support
96 cls.def("__reduce__", [](Object const &self) {
97 std::string state = self.show(false);
98 auto unpickleArgs = py::make_tuple(state);
99 return py::make_tuple(makerCls(), unpickleArgs);
100 });
101 });
102}

◆ wrapObject() [2/2]

void ast::wrapObject ( WrapperCollection & )

◆ wrapParallelMap() [1/2]

void ast::wrapParallelMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 36 of file parallelMap.cc.

36 {
37 using PyParallelMap = py::class_<ParallelMap, std::shared_ptr<ParallelMap>, CmpMap>;
38 wrappers.wrapType(PyParallelMap(wrappers.module, "ParallelMap"), [](auto &mod, auto &cls) {
39 cls.def(py::init<Mapping const &, Mapping const &, std::string const &>(), "map1"_a, "map2"_a,
40 "options"_a = "");
41 cls.def(py::init<ParallelMap const &>());
42 cls.def("copy", &ParallelMap::copy);
43 });
44}
Abstract base class for SeriesMap and ParallelMap.
Definition CmpMap.h:60

◆ wrapParallelMap() [2/2]

void ast::wrapParallelMap ( WrapperCollection & )

◆ wrapPcdMap() [1/2]

void ast::wrapPcdMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 37 of file pcdMap.cc.

37 {
38 using PyPcdMap = py::class_<PcdMap, std::shared_ptr<PcdMap>, Mapping>;
39 wrappers.wrapType(PyPcdMap(wrappers.module, "PcdMap"), [](auto &mod, auto &cls) {
40 cls.def(py::init<double, std::vector<double> const &, std::string const &>(), "disco"_a, "pcdcen"_a,
41 "options"_a = "");
42 cls.def(py::init<PcdMap const &>());
43 cls.def_property_readonly("disco", &PcdMap::getDisco);
44 cls.def_property_readonly("pcdCen", py::overload_cast<>(&PcdMap::getPcdCen, py::const_));
45 cls.def("copy", &PcdMap::copy);
46 });
47}

◆ wrapPcdMap() [2/2]

void ast::wrapPcdMap ( WrapperCollection & )

◆ wrapPermMap() [1/2]

void ast::wrapPermMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 37 of file permMap.cc.

37 {
38 using PyPermMap = py::class_<PermMap, std::shared_ptr<PermMap>, Mapping>;
39 wrappers.wrapType(PyPermMap (wrappers.module, "PermMap"), [](auto &mod, auto &cls) {
40 cls.def(py::init<std::vector<int> const &, std::vector<int> const &, std::vector<double> const &,
41 std::string const &>(),
42 "inperm"_a, "outperm"_a, "constant"_a = std::vector<double>(), "options"_a = "");
43 cls.def(py::init<PermMap const &>());
44
45 cls.def("copy", &PermMap::copy);
46 });
47}

◆ wrapPermMap() [2/2]

void ast::wrapPermMap ( WrapperCollection & )

◆ wrapPolyMap() [1/2]

void ast::wrapPolyMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 38 of file polyMap.cc.

38 {
39 using PyPolyMap = py::class_<PolyMap, std::shared_ptr<PolyMap>, Mapping>;
40 wrappers.wrapType(PyPolyMap (wrappers.module, "PolyMap"), [](auto &mod, auto &cls) {
41 cls.def(py::init<ConstArray2D const &, ConstArray2D const &, std::string const &>(), "coeff_f"_a,
42 "coeff_i"_a, "options"_a = "IterInverse=0");
43 cls.def(py::init<ConstArray2D const &, int, std::string const &>(), "coeff_f"_a, "nout"_a,
44 "options"_a = "IterInverse=0");
45 cls.def(py::init<PolyMap const &>());
46 cls.def_property_readonly("iterInverse", &PolyMap::getIterInverse);
47 cls.def_property_readonly("nIterInverse", &PolyMap::getNIterInverse);
48 cls.def_property_readonly("tolInverse", &PolyMap::getTolInverse);
49 cls.def("copy", &PolyMap::copy);
50 cls.def("polyTran", &PolyMap::polyTran, "forward"_a, "acc"_a, "maxacc"_a, "maxorder"_a, "lbnd"_a,
51 "ubnd"_a);
52 });
53}

◆ wrapPolyMap() [2/2]

void ast::wrapPolyMap ( WrapperCollection & )

◆ wrapQuadApprox() [1/2]

void ast::wrapQuadApprox ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 34 of file quadApprox.cc.

34 {
35 using PyQuadApprox = py::class_<QuadApprox>;
36 wrappers.wrapType(PyQuadApprox(wrappers.module, "QuadApprox"), [](auto &mod, auto &cls) {
37 cls.def(py::init<Mapping const &, std::vector<double> const &, std::vector<double> const &, int, int>(),
38 "map"_a, "lbnd"_a, "ubnd"_a, "nx"_a = 3, "ny"_a = 3);
39 cls.def_readonly("fit", &QuadApprox::fit);
40 cls.def_readonly("rms", &QuadApprox::rms);
41 });
42}

◆ wrapQuadApprox() [2/2]

void ast::wrapQuadApprox ( WrapperCollection & )

◆ wrapRateMap() [1/2]

void ast::wrapRateMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 35 of file rateMap.cc.

35 {
36 using PyRateMap = py::class_<RateMap, std::shared_ptr<RateMap>, Mapping> ;
37 wrappers.wrapType(PyRateMap(wrappers.module, "RateMap"), [](auto &mod, auto &cls) {
38 cls.def(py::init<Mapping const &, int, int, std::string const &>(), "map"_a, "ax1"_a, "ax2"_a,
39 "options"_a = "");
40 cls.def(py::init<RateMap const &>());
41 cls.def("copy", &RateMap::copy);
42 });
43}

◆ wrapRateMap() [2/2]

void ast::wrapRateMap ( WrapperCollection & )

◆ wrapResolvedPoint()

void ast::wrapResolvedPoint ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 52 of file frame.cc.

52 {
53 wrappers.wrapType(py::class_<ResolvedPoint> (wrappers.module, "ResolvedPoint"), [](auto &mod, auto &cls) {
54 cls.def(py::init<int>(), "naxes"_a);
55 cls.def_readwrite("point", &ResolvedPoint::point);
56 cls.def_readwrite("d1", &ResolvedPoint::d1);
57 cls.def_readwrite("d2", &ResolvedPoint::d2);
58 });
59}

◆ wrapSeriesMap() [1/2]

void ast::wrapSeriesMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 36 of file seriesMap.cc.

36 {
37 using PySeriesMap = py::class_<SeriesMap, std::shared_ptr<SeriesMap>, CmpMap>;
38 wrappers.wrapType(PySeriesMap(wrappers.module, "SeriesMap"), [](auto &mod, auto &cls) {
39 cls.def(py::init<Mapping const &, Mapping const &, std::string const &>(), "map1"_a, "map2"_a,
40 "options"_a = "");
41 cls.def(py::init<SeriesMap const &>());
42 cls.def("copy", &SeriesMap::copy);
43 });
44}

◆ wrapSeriesMap() [2/2]

void ast::wrapSeriesMap ( WrapperCollection & )

◆ wrapShiftMap() [1/2]

void ast::wrapShiftMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 37 of file shiftMap.cc.

37 {
38 using PyShiftMap = py::class_<ShiftMap, std::shared_ptr<ShiftMap>, Mapping>;
39 wrappers.wrapType(PyShiftMap(wrappers.module, "ShiftMap"), [](auto &mod, auto &cls) {
40 cls.def(py::init<std::vector<double> const &, std::string const &>(), "shift"_a, "options"_a = "");
41 cls.def(py::init<ShiftMap const &>());
42 cls.def("copy", &ShiftMap::copy);
43 });
44}

◆ wrapShiftMap() [2/2]

void ast::wrapShiftMap ( WrapperCollection & )

◆ wrapSkyFrame() [1/2]

void ast::wrapSkyFrame ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 37 of file skyFrame.cc.

37 {
38 using PySkyFrame = py::class_<SkyFrame, std::shared_ptr<SkyFrame>, Frame>;
39 wrappers.wrapType(PySkyFrame(wrappers.module, "SkyFrame"), [](auto &mod, auto &cls) {
40
41 cls.def(py::init<std::string const &>(), "options"_a = "");
42 cls.def(py::init<SkyFrame const &>());
43
44 cls.def("copy", &SkyFrame::copy);
45
46 cls.def_property("alignOffset", &SkyFrame::getAlignOffset, &SkyFrame::setAlignOffset);
47 cls.def_property("asTime", [](SkyFrame const &self) {
48 return std::make_pair(self.getAsTime(1), self.getAsTime(2));
49 },
50 [](SkyFrame &self, std::pair<bool, bool> asTime) {
51 self.setAsTime(1, asTime.first);
52 self.setAsTime(2, asTime.second);
53 });
54 cls.def_property("alignOffset", &SkyFrame::getAlignOffset, &SkyFrame::setAlignOffset);
55 cls.def_property("equinox", &SkyFrame::getEquinox, &SkyFrame::setEquinox);
56 cls.def_property_readonly("latAxis", &SkyFrame::getLatAxis);
57 cls.def_property_readonly("lonAxis", &SkyFrame::getLonAxis);
58 cls.def_property("negLon", &SkyFrame::getNegLon, &SkyFrame::setNegLon);
59 cls.def_property("projection", &SkyFrame::getProjection, &SkyFrame::setProjection);
60 cls.def_property("skyRefIs", &SkyFrame::getSkyRefIs, &SkyFrame::setSkyRefIs);
61 cls.def_property("skyTol", &SkyFrame::getSkyTol, &SkyFrame::setSkyTol);
62
63 cls.def("getAsTime", &SkyFrame::getAsTime, "axis"_a);
64 cls.def("getIsLatAxis", &SkyFrame::getIsLatAxis, "axis"_a);
65 cls.def("getIsLonAxis", &SkyFrame::getIsLonAxis, "axis"_a);
66 cls.def("getSkyRef", &SkyFrame::getSkyRef);
67 cls.def("getSkyRefP", &SkyFrame::getSkyRefP);
68 cls.def("setAsTime", &SkyFrame::setAsTime, "axis"_a, "asTime"_a);
69 cls.def("setEquinox", &SkyFrame::setEquinox);
70 cls.def("setNegLon", &SkyFrame::setNegLon);
71 cls.def("setProjection", &SkyFrame::setProjection);
72 cls.def("setSkyRef", &SkyFrame::setSkyRef);
73 cls.def("setSkyRefP", &SkyFrame::setSkyRefP);
74 cls.def("skyOffsetMap", &SkyFrame::skyOffsetMap);
75 });
76}
SkyFrame is a specialised form of Frame which describes celestial longitude/latitude coordinate syste...
Definition SkyFrame.h:66

◆ wrapSkyFrame() [2/2]

void ast::wrapSkyFrame ( WrapperCollection & )

◆ wrapSlaMap() [1/2]

void ast::wrapSlaMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 37 of file slaMap.cc.

37 {
38 using PySlaMap = py::class_<SlaMap, std::shared_ptr<SlaMap>, Mapping>;
39 wrappers.wrapType(PySlaMap(wrappers.module, "SlaMap"), [](auto &mod, auto &cls) {
40 cls.def(py::init<std::string const &>(), "options"_a = "");
41 cls.def(py::init<SlaMap const &>());
42 cls.def("copy", &SlaMap::copy);
43 cls.def("add", &SlaMap::add, "cvt"_a, "args"_a = std::vector<double>());
44 });
45}

◆ wrapSlaMap() [2/2]

void ast::wrapSlaMap ( WrapperCollection & )

◆ wrapSpecFrame() [1/2]

void ast::wrapSpecFrame ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 39 of file specFrame.cc.

39 {
40 using PySpecFrame= py::class_<SpecFrame, std::shared_ptr<SpecFrame>, Frame>;
41 wrappers.wrapType(PySpecFrame(wrappers.module, "SpecFrame"), [](auto &mod, auto &cls) {
42 cls.def(py::init<std::string const &>(), "options"_a = "");
43 cls.def(py::init<SpecFrame const &>());
44
45 cls.def("copy", &SpecFrame::copy);
46
47 cls.def("getAlignSpecOffset", &SpecFrame::getAlignSpecOffset);
48 cls.def("getAlignStdOfRest", &SpecFrame::getAlignStdOfRest);
49 cls.def("getRefDec", &SpecFrame::getRefDec);
50 cls.def("getRefRA", &SpecFrame::getRefRA);
51 cls.def("getRefPos", py::overload_cast<SkyFrame const &>(&SpecFrame::getRefPos, py::const_), "frame"_a);
52 cls.def("getRefPos", py::overload_cast<>(&SpecFrame::getRefPos, py::const_));
53 cls.def("getRestFreq", &SpecFrame::getRestFreq);
54 cls.def("getSourceSys", &SpecFrame::getSourceSys);
55 cls.def("getSourceVel", &SpecFrame::getSourceVel);
56 cls.def("getSourceVRF", &SpecFrame::getSourceVRF);
57 cls.def("getSpecOrigin", &SpecFrame::getSpecOrigin);
58 cls.def("getStdOfRest", &SpecFrame::getStdOfRest);
59
60 cls.def("setAlignSpecOffset", &SpecFrame::setAlignSpecOffset, "align"_a);
61 cls.def("setAlignStdOfRest", &SpecFrame::setAlignStdOfRest, "stdOfRest"_a);
62 cls.def("setRefDec", &SpecFrame::setRefDec, "refDec"_a);
63 cls.def("setRefRA", &SpecFrame::setRefRA, "refRA"_a);
64 cls.def("setRefPos", py::overload_cast<SkyFrame const &, double, double>(&SpecFrame::setRefPos),
65 "frame"_a, "lon"_a, "lat"_a);
66 cls.def("setRefPos", py::overload_cast<double, double>(&SpecFrame::setRefPos), "ra"_a, "dec"_a);
67 cls.def("setRestFreq", py::overload_cast<double>(&SpecFrame::setRestFreq), "freq"_a);
68 cls.def("setRestFreq", py::overload_cast<std::string const &>(&SpecFrame::setRestFreq), "freq"_a);
69 cls.def("setSourceSys", &SpecFrame::setSourceSys, "system"_a);
70 cls.def("setSourceVel", &SpecFrame::setSourceVel, "vel"_a);
71 cls.def("setSourceVRF", &SpecFrame::setSourceVRF, "vrf"_a);
72 cls.def("setSpecOrigin", &SpecFrame::setSpecOrigin, "origin"_a);
73 cls.def("setStdOfRest", &SpecFrame::setStdOfRest, "stdOfRest"_a);
74 });
75}

◆ wrapSpecFrame() [2/2]

void ast::wrapSpecFrame ( WrapperCollection & )

◆ wrapSphMap() [1/2]

void ast::wrapSphMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 34 of file sphMap.cc.

34 {
35 using PySphMap=py::class_<SphMap, std::shared_ptr<SphMap>, Mapping>;
36 wrappers.wrapType(PySphMap(wrappers.module, "SphMap"), [](auto &mod, auto &cls) {
37
38 cls.def(py::init<std::string const &>(), "options"_a = "");
39 cls.def(py::init<SphMap const &>());
40
41 cls.def_property_readonly("unitRadius", &SphMap::getUnitRadius);
42 cls.def_property_readonly("polarLong", &SphMap::getPolarLong);
43
44 cls.def("copy", &SphMap::copy);
45 });
46}

◆ wrapSphMap() [2/2]

void ast::wrapSphMap ( WrapperCollection & )

◆ wrapStream() [1/2]

void ast::wrapStream ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 34 of file stream.cc.

34 {
35 using PyStream = py::class_<Stream, std::shared_ptr<Stream>>;
36 wrappers.wrapType(PyStream(wrappers.module, "Stream"), [](auto &mod, auto &clsStream) {
37
38 clsStream.def(py::init<std::istream *, std::ostream *>(), "istream"_a, "ostream"_a);
39 clsStream.def(py::init<>());
40
41 clsStream.def_property_readonly("isFits", &Stream::getIsFits);
42 clsStream.def_property_readonly("hasStdStream", &Stream::hasStdStream);
43
44 clsStream.def("source", &Stream::source);
45 clsStream.def("sink", &Stream::sink, "str"_a);
46 });
47
48 using PyFileStream = py::class_<FileStream, std::shared_ptr<FileStream>, Stream>;
49 wrappers.wrapType(PyFileStream(wrappers.module, "FileStream"), [](auto &mod, auto &clsFileStream) {
50 clsFileStream.def(py::init<std::string const &, bool>(), "path"_a, "doWrite"_a = false);
51
52 clsFileStream.def_property_readonly("path", &FileStream::getPath);
53 });
54
55 using PyStringStream = py::class_<StringStream, std::shared_ptr<StringStream>, Stream>;
56 wrappers.wrapType(PyStringStream(wrappers.module, "StringStream"), [](auto &mod, auto &clsStringStream) {
57 clsStringStream.def(py::init<std::string const &>(), "data"_a = "");
58
59 clsStringStream.def("getSourceData", &StringStream::getSourceData);
60 clsStringStream.def("getSinkData", &StringStream::getSinkData);
61 clsStringStream.def("sinkToSource", &StringStream::sinkToSource);
62 });
63}
A stream for ast::Channel.
Definition Stream.h:41

◆ wrapStream() [2/2]

void ast::wrapStream ( WrapperCollection & )

◆ wrapTable() [1/2]

void ast::wrapTable ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 37 of file table.cc.

37 {
38 using PyTable = py::class_<Table, std::shared_ptr<Table>, KeyMap>;
39 wrappers.wrapType(
40 PyTable(wrappers.module, "Tsble"), [](auto &mod, auto &cls) {
41 cls.def(py::init<std::string const &>(), "options"_a = "");
42
43 cls.def("columnName", &Table::columnName, "index"_a);
44 cls.def("columnType", &Table::columnType, "column"_a);
45 cls.def("columnLength", &Table::columnLength, "column"_a);
46 cls.def("columnNdim", &Table::columnNdim, "column"_a);
47 cls.def("columnUnit", &Table::columnUnit, "column"_a);
48 cls.def("columnLenC", &Table::columnLenC, "column"_a);
49 cls.def("columnShape", &Table::columnShape, "column"_a);
50 cls.def_property_readonly("nColumn", &Table::getNColumn);
51 cls.def_property_readonly("nRow", &Table::getNRow);
52 });
53}
KeyMap is used to store a set of values with associated keys which identify the values.
Definition KeyMap.h:83

◆ wrapTable() [2/2]

void ast::wrapTable ( WrapperCollection & )

◆ wrapTimeFrame() [1/2]

void ast::wrapTimeFrame ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 37 of file timeFrame.cc.

37 {
38 using PyTimeFrame=py::class_<TimeFrame, std::shared_ptr<TimeFrame>, Frame>;
39 wrappers.wrapType(PyTimeFrame(wrappers.module, "TimeFrame"), [](auto &mod, auto &cls) {
40
41 cls.def(py::init<std::string const &>(), "options"_a = "");
42 cls.def(py::init<TimeFrame const &>());
43
44 cls.def_property("alignTimeScale", &TimeFrame::getAlignTimeScale, &TimeFrame::setAlignTimeScale);
45 cls.def_property("ltOffset", &TimeFrame::getLTOffset, &TimeFrame::setLTOffset);
46 cls.def_property("timeOrigin", &TimeFrame::getTimeOrigin, &TimeFrame::setTimeOrigin);
47 cls.def_property("timeScale", &TimeFrame::getTimeScale, &TimeFrame::setTimeScale);
48
49 cls.def("copy", &TimeFrame::copy);
50 cls.def("currentTime", &TimeFrame::currentTime);
51 });
52}

◆ wrapTimeFrame() [2/2]

void ast::wrapTimeFrame ( WrapperCollection & )

◆ wrapTimeMap() [1/2]

void ast::wrapTimeMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 37 of file timeMap.cc.

37 {
38 using PyTimeMap= py::class_<TimeMap, std::shared_ptr<TimeMap>, Mapping> ;
39 wrappers.wrapType(PyTimeMap(wrappers.module, "TimeMap"), [](auto &mod, auto &cls) {
40
41 cls.def(py::init<std::string const &>(), "options"_a = "");
42 cls.def(py::init<TimeMap const &>());
43
44 cls.def("copy", &TimeMap::copy);
45 cls.def("add", &TimeMap::add, "cvt"_a, "args"_a);
46 });
47}

◆ wrapTimeMap() [2/2]

void ast::wrapTimeMap ( WrapperCollection & )

◆ wrapTranMap() [1/2]

void ast::wrapTranMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 35 of file tranMap.cc.

35 {
36 using PyTranMap = py::class_<TranMap, std::shared_ptr<TranMap>, Mapping>;
37 wrappers.wrapType(PyTranMap(wrappers.module, "TranMap"), [](auto &mod, auto &cls) {
38 cls.def(py::init<Mapping const &, Mapping const &, std::string const &>(), "map1"_a, "map2"_a,
39 "options"_a = "");
40 cls.def(py::init<TranMap const &>());
41
42 cls.def("__getitem__", &TranMap::operator[], py::is_operator());
43 cls.def("__len__", [](TranMap const &) { return 2; });
44
45 cls.def("copy", &TranMap::copy);
46 });
47}

◆ wrapTranMap() [2/2]

void ast::wrapTranMap ( WrapperCollection & )

◆ wrapUnitMap() [1/2]

void ast::wrapUnitMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 35 of file unitMap.cc.

35 {
36 using PyUnitMap = py::class_<UnitMap, std::shared_ptr<UnitMap>, Mapping>;
37 wrappers.wrapType(PyUnitMap(wrappers.module, "UnitMap"), [](auto &mod, auto &cls) {
38 cls.def(py::init<int, std::string const &>(), "ncoord"_a, "options"_a = "");
39 cls.def(py::init<UnitMap const &>());
40 cls.def("copy", &UnitMap::copy);
41 });
42}

◆ wrapUnitMap() [2/2]

void ast::wrapUnitMap ( WrapperCollection & )

◆ wrapUnitNormMap() [1/2]

void ast::wrapUnitNormMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 37 of file unitNormMap.cc.

37 {
38 using PyUnitNormapMap=py::class_<UnitNormMap, std::shared_ptr<UnitNormMap>, Mapping> ;
39 wrappers.wrapType(PyUnitNormapMap (wrappers.module, "UnitNormMap"), [](auto &mod, auto &cls) {
40
41 cls.def(py::init<std::vector<double> const &, std::string const &>(), "centre"_a, "options"_a = "");
42 cls.def(py::init<UnitNormMap const &>());
43
44 cls.def("copy", &UnitNormMap::copy);
45 });
46}

◆ wrapUnitNormMap() [2/2]

void ast::wrapUnitNormMap ( WrapperCollection & )

◆ wrapWcsMap() [1/2]

void ast::wrapWcsMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 36 of file wcsMap.cc.

36 {
37 using PyWcsType=py::enum_<WcsType>;
38 wrappers.wrapType(PyWcsType(wrappers.module, "WcsType"), [](auto &mod, auto &enm) {
39 enm.value("AZP", WcsType::AZP);
40 enm.value("SZP", WcsType::SZP);
41 enm.value("TAN", WcsType::TAN);
42 enm.value("STG", WcsType::STG);
43 enm.value("SIN", WcsType::SIN);
44 enm.value("ARC", WcsType::ARC);
45 enm.value("ZPN", WcsType::ZPN);
46 enm.value("ZEA", WcsType::ZEA);
47 enm.value("AIR", WcsType::AIR);
48 enm.value("CYP", WcsType::CYP);
49 enm.value("CEA", WcsType::CEA);
50 enm.value("CAR", WcsType::CAR);
51 enm.value("MER", WcsType::MER);
52 enm.value("SFL", WcsType::SFL);
53 enm.value("PAR", WcsType::PAR);
54 enm.value("MOL", WcsType::MOL);
55 enm.value("AIT", WcsType::AIT);
56 enm.value("COP", WcsType::COP);
57 enm.value("COE", WcsType::COE);
58 enm.value("COD", WcsType::COD);
59 enm.value("COO", WcsType::COO);
60 enm.value("BON", WcsType::BON);
61 enm.value("PCO", WcsType::PCO);
62 enm.value("TSC", WcsType::TSC);
63 enm.value("CSC", WcsType::CSC);
64 enm.value("QSC", WcsType::QSC);
65 enm.value("NCP", WcsType::NCP);
66 enm.value("GLS", WcsType::GLS);
67 enm.value("TPN", WcsType::TPN);
68 enm.value("HPX", WcsType::HPX);
69 enm.value("XPH", WcsType::XPH);
70 enm.value("WCSBAD", WcsType::WCSBAD);
71 enm.export_values();
72 });
73
74 using PyWcsMap= py::class_<WcsMap, std::shared_ptr<WcsMap>, Mapping>;
75 wrappers.wrapType(PyWcsMap (wrappers.module, "WcsMap"), [](auto &mod, auto &cls) {
76
77 cls.def(py::init<int, WcsType, int, int, std::string const &>(), "ncoord"_a, "type"_a, "lonax"_a,
78 "latax"_a, "options"_a = "");
79 cls.def(py::init<WcsMap const &>());
80
81 cls.def_property_readonly("natLat", &WcsMap::getNatLat);
82 cls.def_property_readonly("natLon", &WcsMap::getNatLon);
83 cls.def_property_readonly("wcsType", &WcsMap::getWcsType);
84 cls.def_property_readonly("wcsAxis", &WcsMap::getWcsAxis);
85
86 cls.def("copy", &WcsMap::copy);
87 cls.def("getPVi_m", &WcsMap::getPVi_m, "i"_a, "m"_a);
88 cls.def("getPVMax", &WcsMap::getPVMax);
89 });
90}

◆ wrapWcsMap() [2/2]

void ast::wrapWcsMap ( WrapperCollection & )

◆ wrapWinMap() [1/2]

void ast::wrapWinMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 37 of file winMap.cc.

37 {
38 using PyWinMap = py::class_<WinMap, std::shared_ptr<WinMap>, Mapping>;
39 wrappers.wrapType(PyWinMap(wrappers.module, "WinMap"), [](auto &mod, auto &cls) {
40
41 cls.def(py::init<std::vector<double> const &, std::vector<double> const &, std::vector<double> const &,
42 std::vector<double> const &, std::string const &>(),
43 "ina"_a, "inb"_a, "outa"_a, "outb"_a, "options"_a = "");
44 cls.def(py::init<WinMap const &>());
45
46 cls.def("copy", &WinMap::copy);
47 });
48}

◆ wrapWinMap() [2/2]

void ast::wrapWinMap ( WrapperCollection & )

◆ wrapXmlChan() [1/2]

void ast::wrapXmlChan ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 35 of file xmlChan.cc.

35 {
36 using PyXmlChan=py::class_<XmlChan, std::shared_ptr<XmlChan>, Channel>;
37 wrappers.wrapType(PyXmlChan(wrappers.module, "XmlChan"), [](auto &mod, auto &cls) {
38
39 cls.def(py::init<Stream &, std::string const &>(), "stream"_a, "options"_a = "");
40
41 cls.def_property("xmlFormat", &XmlChan::getXmlFormat, &XmlChan::setXmlFormat);
42 cls.def_property("xmlLength", &XmlChan::getXmlLength, &XmlChan::setXmlLength);
43 cls.def_property("xmlPrefix", &XmlChan::getXmlPrefix, &XmlChan::setXmlPrefix);
44 });
45}

◆ wrapXmlChan() [2/2]

void ast::wrapXmlChan ( WrapperCollection & )

◆ wrapZoomMap() [1/2]

void ast::wrapZoomMap ( lsst::utils::python::WrapperCollection & wrappers)

Definition at line 35 of file zoomMap.cc.

35 {
36 using PyZoomMap = py::class_<ZoomMap, std::shared_ptr<ZoomMap>, Mapping>;
37 wrappers.wrapType(PyZoomMap(wrappers.module, "ZoomMap"), [](auto &mod, auto &cls) {
38 cls.def(py::init<int, double, std::string const &>(),"ncoord"_a, "zoom"_a, "options"_a = "");
39 cls.def(py::init<ZoomMap const &>());
40 cls.def_property_readonly("zoom", &ZoomMap::getZoom);
41 cls.def("copy", &ZoomMap::copy);
42 });
43}

◆ wrapZoomMap() [2/2]

void ast::wrapZoomMap ( WrapperCollection & )