46 if (
transform.getToEndpoint().getNAxes() != 1) {
48 "To EndPoint of transform must have 1 axis but has " +
58 ndarray::Array<double const, 1>
const&
y)
const {
59 if (
x.getSize<0>() !=
y.getSize<0>()) {
66 int const nPoints =
x.getSize<0>();
67 ndarray::Array<double, 2, 2> xy = ndarray::allocate(ndarray::makeVector(2, nPoints));
76 auto resShape = ndarray::makeVector(nPoints);
77 auto resStrides = ndarray::makeVector(1);
78 return ndarray::external(res2D.getData(), resShape, resStrides, res2D);
85 struct PersistenceHelper {
89 table::Key<table::Array<std::uint8_t>>
frameSet;
95 "frameSet",
"FrameSet contained in the Transform",
"", 0)) {}
97 PersistenceHelper(table::Schema
const& s) :
schema(s),
bbox(s[
"bbox"]),
frameSet(s[
"frameSet"]) {}
100 class TransformBoundedFieldFactory :
public table::io::PersistableFactory {
103 :
afw::table::io::PersistableFactory(
name) {}
106 CatalogVector
const& catalogs)
const override {
109 table::BaseRecord
const& record = catalogs.front().front();
110 PersistenceHelper
const keys(record.getSchema());
116 return std::make_shared<TransformBoundedField>(
bbox, *
transform);
120 std::string getTransformBoundedFieldPersistenceName() {
return "TransformBoundedField"; }
122 TransformBoundedFieldFactory registration(getTransformBoundedFieldPersistenceName());
127 return getTransformBoundedFieldPersistenceName();
133 PersistenceHelper
const keys;
144 auto newTransform =
Transform(newMapping);
145 return std::make_shared<TransformBoundedField>(
getBBox(), newTransform);
150 if (!rhsCasted)
return false;
152 return getBBox() == rhsCasted->getBBox() &&
156 std::string TransformBoundedField::toString()
const {
return "TransformBoundedField"; }
table::Key< std::string > name
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
#define LSST_ARCHIVE_ASSERT(EXPR)
An assertion macro used to validate the structure of an InputArchive.
SeriesMap then(Mapping const &next) const
Return a series compound mapping this(first(input)) containing shallow copies of the original.
void applyForward(ConstArray2D const &from, Array2D const &to) const
Perform a forward transformation on 2-D array, putting the results into a pre-allocated 2-D array.
A Mapping which "zooms" a set of points about the origin by multiplying all coordinate values by the ...
An abstract base class for 2-d functions defined on an integer bounding boxes.
lsst::geom::Box2I getBBox() const
Return the bounding box that defines the region where the field is valid.
std::shared_ptr< RecordT > addNew()
Create a new record, add it to the end of the catalog, and return a pointer to it.
An object passed to Persistable::write to allow it to persist itself.
void saveCatalog(BaseCatalog const &catalog)
Save a catalog in the archive.
BaseCatalog makeCatalog(Schema const &schema)
Return a new, empty catalog with the given schema.
An integer coordinate rectangle.
Reports invalid arguments.
def scale(algorithm, min, max=None, frame=None)
BoxKey< lsst::geom::Box2I > Box2IKey
A base class for image defects.
std::shared_ptr< table::io::Persistable > read(table::io::InputArchive const &archive, table::io::CatalogVector const &catalogs) const override