36 #include "boost/format.hpp" 51 namespace formatters {
54 if (properties->isArray(
"sliceId")) {
57 int sliceId = properties->getAsInt(
"sliceId");
61 if (properties->exists(
"universeSize") && !properties->isArray(
"universeSize")) {
62 int universeSize = properties->getAsInt(
"universeSize");
63 if (sliceId >= universeSize) {
71 if (properties->isArray(
"visitId")) {
74 int visitId = properties->getAsInt(
"visitId");
82 if (properties->isArray(
"fpaExposureId")) {
85 int64_t fpaExposureId = properties->getAsInt64(
"fpaExposureId");
86 if (fpaExposureId < 0) {
89 if ((fpaExposureId & 0xfffffffe00000000LL) != 0
LL) {
96 if (properties->isArray(
"ccdId")) {
99 int ccdId = properties->getAsInt(
"ccdId");
106 return static_cast<int>(ccdId);
110 if (properties->isArray(
"ampId")) {
113 int ampId = properties->getAsInt(
"ampId");
124 if (properties->isArray(
"ccdExposureId")) {
127 int64_t ccdExposureId = properties->getAsInt64(
"ccdExposureId");
128 if (ccdExposureId < 0) {
131 return ccdExposureId;
135 if (properties->isArray(
"ampExposureId")) {
138 int64_t ampExposureId = properties->getAsInt64(
"ampExposureId");
139 if (ampExposureId < 0) {
142 return ampExposureId;
149 if (properties->isArray(
"itemName")) {
152 return properties->getAsString(
"itemName");
156 if (properties && properties->exists(name)) {
157 return properties->getAsBool(name);
165 return LogicalLocation(policy->getString(itemName +
".tableNamePattern"), properties).locString();
171 std::string pattern(policy->getString(itemName +
".tableNamePattern"));
173 if (properties->exists(itemName +
".numSlices")) {
174 numSlices = properties->getAsInt(itemName +
".numSlices");
176 if (numSlices <= 0) {
182 for (
int i = 0; i < numSlices; ++i) {
183 props->set(
"sliceId", i);
196 auto shape = ndarray::makeVector(nbytes);
197 auto strides = ndarray::makeVector(1);
200 ndarray::Array<std::uint8_t const, 1, 1> localArray = ndarray::external(byteCArr, shape, strides);
201 return ndarray::copy(localArray);
206 char const* charCArr =
reinterpret_cast<char const*
>(bytes.getData());
Class for logical location of a persisted Persistable instance.
a container for holding hierarchical configuration data in memory.
std::vector< std::string > paramNames(bool topLevelOnly=true) const
A variant of names that excludes the names of subproperties.
Include files required for standard LSST Exception handling.
A base class for image defects.
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Class for storing generic metadata.
Interface for LogicalLocation class.