36 #include "boost/format.hpp" 52 namespace formatters {
55 if (properties->isArray(
"sliceId")) {
58 int sliceId = properties->getAsInt(
"sliceId");
62 if (properties->exists(
"universeSize") && !properties->isArray(
"universeSize")) {
63 int universeSize = properties->getAsInt(
"universeSize");
64 if (sliceId >= universeSize) {
72 if (properties->isArray(
"visitId")) {
75 int visitId = properties->getAsInt(
"visitId");
83 if (properties->isArray(
"fpaExposureId")) {
86 int64_t fpaExposureId = properties->getAsInt64(
"fpaExposureId");
87 if (fpaExposureId < 0) {
90 if ((fpaExposureId & 0xfffffffe00000000LL) != 0
LL) {
97 if (properties->isArray(
"ccdId")) {
100 int ccdId = properties->getAsInt(
"ccdId");
107 return static_cast<int>(ccdId);
111 if (properties->isArray(
"ampId")) {
114 int ampId = properties->getAsInt(
"ampId");
125 if (properties->isArray(
"ccdExposureId")) {
128 int64_t ccdExposureId = properties->getAsInt64(
"ccdExposureId");
129 if (ccdExposureId < 0) {
132 return ccdExposureId;
136 if (properties->isArray(
"ampExposureId")) {
139 int64_t ampExposureId = properties->getAsInt64(
"ampExposureId");
140 if (ampExposureId < 0) {
143 return ampExposureId;
150 if (properties->isArray(
"itemName")) {
153 return properties->getAsString(
"itemName");
157 if (properties && properties->exists(name)) {
158 return properties->getAsBool(name);
166 return LogicalLocation(policy->getString(itemName +
".tableNamePattern"), properties).locString();
172 std::string pattern(policy->getString(itemName +
".tableNamePattern"));
174 if (properties->exists(itemName +
".numSlices")) {
175 numSlices = properties->getAsInt(itemName +
".numSlices");
177 if (numSlices <= 0) {
183 for (
int i = 0; i < numSlices; ++i) {
184 props->set(
"sliceId", i);
199 db.createTableFromTemplate(name,
model);
221 auto shape = ndarray::makeVector(nbytes);
222 auto strides = ndarray::makeVector(1);
225 ndarray::Array<std::uint8_t const, 1, 1> localArray = ndarray::external(byteCArr, shape, strides);
226 return ndarray::copy(localArray);
231 char const* charCArr =
reinterpret_cast<char const*
>(bytes.getData());
table::Key< std::string > name
virtual void setPersistLocation(LogicalLocation const &location)
Set the database location to persist to.
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.
Interface for DbTsvStorage class.
Class for database storage with data loading from TSV files.
#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.
virtual void dropTable(std::string const &tableName)
Drop a table.