All this class does, apart from constructing itself, is know how to save itself to a Record and how to convert itself to an LCRegion. The conversion allows you to apply a WCBox constructed with one CoordinateSystem to another CoordinateSystem. That is, you can apply a WCBox from this image to that image.
The flexibility of the CoordinateSystem class should be kept in mind when using this class. Recall that a CoordinateSystem has world and pixel axes, and that these axes can be independently removed and independently (re)ordered.
During construction, the length of the world coordinate vectors may be smaller than the number world axes in the supplied CoordinateSystem. It is assumed that the units of the world coordinates are the same as those encapsulated in the construction CoordinateSystem and in the same order as specified (either intrinsically, or by the world axes specification vectors).
The following rules are followed during conversion to an LCRegion.
Note that when determining whether a world axis from one CoordinateSystemis present on another, it is considered to not be a match if two coordinates of the same type (e.g. DirectionCoordinate) have different specific types (e.g. J2000 and GALACTIC, or TOPO and LSR for a SpectralCoordinate)
cSys = [ra, dec, freq];
cSys2 = [ra, dec];
blc = [,,];
trc = [,,];
shape = [,];
WCBox box(blc, trc, cSys);
LCRegion* pR = box.toLCRegion(cSys2, shape);
The resultant LCBox will have corners converted
according to
blcLC(0) <- blc(0);
blcLC(1) <- blc(1);
trcLC(0) <- trc(0);
trcLC(1) <- trc(1);
cSys = [ra, dec, freq];
cSys2 = [freq, stokes];
blc = [,,];
trc = [,,];
shape = [,];
WCBox box(blc, trc, cSys);
LCRegion* pR = box.toLCRegion(cSys2, shape);
The resultant LCBox will have corners converted according to
blcLC(0) <- blc(2);
blcLC(1) = 0;
trcLC(0) <- trc(2);
trcLC(1) = shape(1) - 1;
cSys = [ra, dec];
cSys2 = [ra, dec, freq];
blc = [,];
trc = [,];
shape = [,,];
WCBox box(blc, trc, cSys);
LCRegion* pR = box.toLCRegion(cSys2, shape);
The resultant LCBox will have corners converted according to
blcLC(0) <- blc(0);
blcLC(1) <- blc(1);
blcLC(2) = 0l
trcLC(0) <- trc(0);
trcLC(1) <- trc(1);
trcLC(2) = shape(2)-1;
cSys = [ra, dec, freq];
cSys2 = [freq, ra, dec];
blc = [,,];
trc = [,,];
shape = [,,];
WCBox box(blc, trc, cSys);
LCRegion* pR = box.toLCRegion(cSys2, shape);
The resultant LCBox will have corners converted according to
blcLC(0) <- blc(2);
blcLC(1) <- blc(0);
blcLC(2) <- blc(1);
trcLC(0) <- trc(2);
trcLC(1) <- trc(0);
trcLC(2) <- trc(1);
cSys = [ra, dec, freq], [0, 1, 2];
cSys2 = [freq, ra, dec, stokes], [3, 0, 2, 1];
blc = [,,];
trc = [,,];
shape = [,,,];
WCBox box(blc, trc, cSys);
LCRegion* pR = box.toLCRegion(cSys2, shape);
Take the first world axis of cSys2 as an example. First, "freq" is found as the world axis number 2 in cSys. Then, when it is converted to a pixel coordinate, it will turn up as the value on pixel axis 1. The supplied shape must be appropriate to a [stokes, freq, dec, ra] lattice. The resultant LCBox will therefore have corners converted according to
blcLC(0) = 0
blcLC(1) <- blc(2);
blcLC(2) <- blc(1);
blcLC(3) <- blc(0);
trcLC(0) = shape(0)-1;
trcLC(1) <- trc(2);
trcLC(2) <- trc(1);
trcLC(3) <- trc(0);
Construct from vectors of world coordinates defining the box corners. It is assumed that the order of the values is in the order of the pixel axes in the given coordinate system.
Construct from vectors of world coordinates defining the box corners. You specify the pixel axis order of the world values.
Construct from the bounding box of an LCRegion.
Copy constructor (reference semantics [except for CoordinateSystem])
Destructor
Assignment (copy semantics)
Comparison
Clone a WCBox object.
WCBox can extend a region.
Make a new box from the given axesin this box.
Convert to an LCRegion using the supplied CoordinateSystem and shape.
Convert the WCBox object to a record. The record can be used to make the object persistent. The tableName argument can be used by derived classes (e.g. LCPagedMask) to put very large objects.
Convert to a WCBox from a record.
Returns WCBox
Return region type. Returns the class name
Check units of quanta are consistent with CoordinateSystem
Convert relative pixels to absolute or fill in defaults