LSSTApplications
20.0.0
LSSTDataManagementBasePackage
|
◆ bytesToString()
Decode a std::string from a vector of uint8 returned by stringToBytes.
Definition at line 173 of file Utils.cc.
175 char const* charCArr =
reinterpret_cast<char const*
>(
bytes.getData());
◆ countFitsHeaderCards()
Definition at line 160 of file Utils.cc.
160 {
return prop.paramNames(
false).size(); }
◆ extractAmpExposureId()
Definition at line 132 of file Utils.cc.
133 if (properties->
isArray(
"ampExposureId")) {
137 if (ampExposureId < 0) {
140 return ampExposureId;
◆ extractAmpId()
◆ extractCcdExposureId()
Definition at line 121 of file Utils.cc.
122 if (properties->
isArray(
"ccdExposureId")) {
126 if (ccdExposureId < 0) {
129 return ccdExposureId;
◆ extractCcdId()
Definition at line 93 of file Utils.cc.
94 if (properties->
isArray(
"ccdId")) {
97 int ccdId = properties->
getAsInt(
"ccdId");
104 return static_cast<int>(ccdId);
◆ extractFpaExposureId()
Definition at line 79 of file Utils.cc.
80 if (properties->
isArray(
"fpaExposureId")) {
84 if (fpaExposureId < 0) {
87 if ((fpaExposureId & 0xfffffffe00000000LL) != 0LL) {
◆ extractOptionalFlag()
Returns true
if and only if properties
is non-null and contains a unique property with the given name that has type bool
and a value of true
.
Definition at line 153 of file Utils.cc.
◆ extractSliceId()
Definition at line 51 of file Utils.cc.
52 if (properties->
isArray(
"sliceId")) {
55 int sliceId = properties->
getAsInt(
"sliceId");
59 if (properties->
exists(
"universeSize") && !properties->
isArray(
"universeSize")) {
60 int universeSize = properties->
getAsInt(
"universeSize");
61 if (sliceId >= universeSize) {
◆ extractVisitId()
Definition at line 68 of file Utils.cc.
69 if (properties->
isArray(
"visitId")) {
72 int visitId = properties->
getAsInt(
"visitId");
◆ getItemName()
Extracts and returns the string-valued "itemName"
property from the given data property object.
- Exceptions
-
Definition at line 143 of file Utils.cc.
147 if (properties->
isArray(
"itemName")) {
◆ stringToBytes()
Encode a std::string as a vector of uint8.
Definition at line 162 of file Utils.cc.
163 auto nbytes = str.size() *
sizeof(char) /
sizeof(
std::uint8_t);
165 auto shape = ndarray::makeVector(nbytes);
166 auto strides = ndarray::makeVector(1);
169 ndarray::Array<std::uint8_t const, 1, 1> localArray = ndarray::external(byteCArr, shape, strides);
170 return ndarray::copy(localArray);
int getAsInt(std::string const &name) const
Get the last value for a bool/char/short/int property name (possibly hierarchical).
bool getAsBool(std::string const &name) const
Get the last value for a bool property name (possibly hierarchical).
Reports when the result of an operation cannot be represented by the destination type.
bool isArray(std::string const &name) const
Determine if a name (possibly hierarchical) has multiple values.
bool exists(std::string const &name) const
Determine if a name (possibly hierarchical) exists.
int64_t getAsInt64(std::string const &name) const
Get the last value for a bool/char/short/int/int64_t property name (possibly hierarchical).
std::string getAsString(std::string const &name) const
Get the last value for a string property name (possibly hierarchical).
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Reports invalid arguments.
Reports errors that are due to events beyond the control of the program.