36 #include "boost/format.hpp" 52 namespace formatters {
67 for (
auto const & fullName : paramNames) {
69 auto name = (lastPeriod == std::string::npos) ? fullName : fullName.substr(lastPeriod + 1);
74 if (
name.size() > 8) {
75 out +=
"HIERARCH = " +
name;
80 if (type ==
typeid(
bool)) {
81 out += prop.get<
bool>(
name) ?
"1" :
"0";
82 }
else if (type ==
typeid(
int)) {
84 }
else if (type ==
typeid(
double)) {
86 }
else if (type ==
typeid(
float)) {
92 int const len = out.
size();
108 if (properties->isArray(
"sliceId")) {
111 int sliceId = properties->getAsInt(
"sliceId");
115 if (properties->exists(
"universeSize") && !properties->isArray(
"universeSize")) {
116 int universeSize = properties->getAsInt(
"universeSize");
117 if (sliceId >= universeSize) {
125 if (properties->isArray(
"visitId")) {
128 int visitId = properties->getAsInt(
"visitId");
136 if (properties->isArray(
"fpaExposureId")) {
139 int64_t fpaExposureId = properties->getAsInt64(
"fpaExposureId");
140 if (fpaExposureId < 0) {
143 if ((fpaExposureId & 0xfffffffe00000000LL) != 0
LL) {
146 return fpaExposureId;
150 if (properties->isArray(
"ccdId")) {
153 int ccdId = properties->getAsInt(
"ccdId");
160 return static_cast<int>(ccdId);
164 if (properties->isArray(
"ampId")) {
167 int ampId = properties->getAsInt(
"ampId");
178 if (properties->isArray(
"ccdExposureId")) {
181 int64_t ccdExposureId = properties->getAsInt64(
"ccdExposureId");
182 if (ccdExposureId < 0) {
185 return ccdExposureId;
189 if (properties->isArray(
"ampExposureId")) {
192 int64_t ampExposureId = properties->getAsInt64(
"ampExposureId");
193 if (ampExposureId < 0) {
196 return ampExposureId;
203 if (properties->isArray(
"itemName")) {
206 return properties->getAsString(
"itemName");
210 if (properties && properties->exists(name)) {
211 return properties->getAsBool(name);
219 return LogicalLocation(policy->getString(itemName +
".tableNamePattern"), properties).locString();
225 std::string pattern(policy->getString(itemName +
".tableNamePattern"));
227 if (properties->exists(itemName +
".numSlices")) {
228 numSlices = properties->getAsInt(itemName +
".numSlices");
230 if (numSlices <= 0) {
236 for (
int i = 0; i < numSlices; ++i) {
237 props->set(
"sliceId", i);
248 std::string model(policy->getString(itemName +
".templateTableName"));
252 db.createTableFromTemplate(name, model);
269 auto const allParamNames = prop.
paramNames(
false);
271 for (
auto const &
name: allParamNames) {
276 return formatFitsPropertiesImpl(desiredParamNames, prop);
286 auto shape = ndarray::makeVector(nbytes);
287 auto strides = ndarray::makeVector(1);
290 ndarray::Array<std::uint8_t const, 1, 1> localArray = ndarray::external(byteCArr, shape, strides);
291 return ndarray::copy(localArray);
296 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.
lsst::daf::base::PropertySet PropertySet
A base class for image defects.
Interface for DbTsvStorage class.
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Include files required for standard LSST Exception handling.
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.