lsst.astshim  21.0.0-2-g45278ab+e70536a077
Namespaces | Classes | Typedefs | Enumerations | Functions
ast Namespace Reference

AST wrapper classes and functions. More...

Namespaces

 detail
 

Classes

class  Channel
 
class  ChebyDomain
 
class  ChebyMap
 
class  CmpFrame
 
class  CmpMap
 
class  FoundValue
 
class  FitsChan
 
class  FitsTable
 
class  DirectionPoint
 
class  NReadValue
 
class  ResolvedPoint
 
class  FrameMapping
 
class  Frame
 
class  FrameDict
 
class  FrameSet
 
class  KeyMap
 
class  LutMap
 
class  MapBox
 
class  Mapping
 
class  MapSplit
 
class  MathMap
 
class  MatrixMap
 
class  NormMap
 
class  Object
 
class  ParallelMap
 
class  PcdMap
 
class  PermMap
 
class  PolyMap
 
class  QuadApprox
 
class  RateMap
 
class  SeriesMap
 
class  ShiftMap
 
class  SkyFrame
 
class  SlaMap
 
class  SpecFrame
 
class  SphMap
 
class  Stream
 
class  FileStream
 
class  StringStream
 
class  Table
 
class  TimeFrame
 
class  TimeMap
 
class  TranMap
 
class  UnitMap
 
class  UnitNormMap
 
class  WcsMap
 
class  WinMap
 
class  XmlChan
 
class  ZoomMap
 

Typedefs

using Array2D = ndarray::Array< double, 2, 2 >
 
using ConstArray2D = ndarray::Array< const double, 2, 2 >
 
using PointI = std::vector< int >
 
using PointD = std::vector< double >
 

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
}
 
enum class  FitsKeyState { ABSENT = 0 , NOVALUE , PRESENT }
 
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
}
 
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
}
 

Functions

void assertOK (AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
 
bool escapes (int include=-1)
 
int ast_version (void)
 
std::shared_ptr< FrameSetappend (FrameSet const &first, FrameSet const &second)
 
std::shared_ptr< MappingmakeRadialMapping (std::vector< double > const &center, Mapping const &mapping1d)
 
ConstArray2D arrayFromVector (std::vector< double > const &vec, int nAxes)
 
Array2D arrayFromVector (std::vector< double > &vec, int nAxes)
 

Detailed Description

AST wrapper classes and functions.

Typedef Documentation

◆ Array2D

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

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

◆ ConstArray2D

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

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

◆ PointD

using ast::PointD = typedef 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

◆ PointI

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

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

Enumeration Type Documentation

◆ CardType

enum 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

◆ DataType

enum ast::DataType
strong

Data types held by a KeyMap

Enumerator
IntType 
ShortIntType 
ByteType 
DoubleType 
FloatType 
StringType 
ObjectType 
PointerType 
UndefinedType 
BadType 

◆ FitsKeyState

enum 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

◆ WcsType

enum 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 

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.

◆ arrayFromVector() [1/2]

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

◆ 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.)

◆ 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.

◆ ast_version()

int ast::ast_version ( void  )
inline

◆ 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.

◆ 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