1#ifndef GainChannelNormalize_h
2#define GainChannelNormalize_h
17#include "HiCalTypes.h"
23#include "IException.h"
43 Module(
"GainChannelNormalize") {
52 void init(
const HiCalConf &conf) {
55 _history.add(
"Profile["+ prof.Name()+
"]");
57 double bin =
ToDouble(prof(
"Summing"));
59 double _normalizer = 128.0 / tdi / (bin*bin);
69 else if ( z.dim() == nsamps) {
73 std::ostringstream mess;
74 mess <<
"Expected 1 or " << nsamps <<
" values from CSV file "
75 <<
getcsvFile() <<
" but got " << z.dim() <<
" instead!";
80 for (
int i = 0 ; i <
_data.dim() ; i++ ) {
_data[i] *= _normalizer; }
A DbProfile is a container for access parameters to a database.
Computes a gain correction for each sample GainChannelNormalize.
virtual ~GainChannelNormalize()
Destructor.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Module manages HiRISE calibration vectors from various sources.
HiVector _data
Data vector.
QString getcsvFile() const
Returns expanded name of last CSV file loaded by loadCsv.
HiHistory _history
Hierarchial component history.
HiVector loadCsv(const QString &csvBase, const HiCalConf &conf, const DbProfile &prof, const int &elements=0)
Provide generic loading of CSV file for all modules.
This is free and unencumbered software released into the public domain.
TNT::Array1D< double > HiVector
1-D Buffer
QString ToString(const T &value)
Helper function to convert values to strings.
double ToDouble(const T &value)
Helper function to convert values to doubles.
int ToInteger(const T &value)
Helper function to convert values to Integers.