GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GRBP / V1-0-4 > grbpsiu / rhel6-32
#include <GRBP_message.h>
#include <GRBP_window.h>
#include <GRBP_grb.h>
#include <GRBP_gammaList.h>
#include <GRBP_math.h>
#include <wrap.h>
#include <PBI/Endianness.h>
#include <PBI/Check.h>
Defines | |
#define | LOG_PROBABILITY_K_SCALE_FACTOR 4 |
Sets the scaling factor used to convert the floating point log of the spatial and temporal probabilities to a 16-bit unsigned integer. | |
#define | round(_x) ceil(_x) |
#define | MAX_PROB ((1<<16) - 1) |
#define | QSCALE (1<<14) |
Functions | |
CHECK (CheckWindowType, GRBP_WINDOW_TYPE_K_LAT==GRB_LATALERTMSG_TRIGGERTYPE_LAT &&GRBP_WINDOW_TYPE_K_GBM==GRB_LATALERTMSG_TRIGGERTYPE_GBM) | |
static __inline void | gam_cnts_clear (unsigned short int cnts[4]) |
Clears the little 4 word 16-bit histogram. | |
static __inline void | gam_cnts_update (unsigned short int cnts[4], const GRBP_gammaAux *gammas, int beg, int end, int max) |
Updates the little 4 bin histogram with energy of the gammas from index beg to end. | |
static __inline GRB_latAlertMsgTime | to_time (double time) |
Converts time to seconds and microsecnds, i.e. a GRB_latAlerMsgTime. | |
static __inline unsigned int | to_usecs (double fraction_of_seconds) |
Converts fractions of a second to micro seconds. | |
static __inline unsigned short | to_arcmins (double radians) |
Converts radians to a arcmins, unsigned. | |
static __inline unsigned short | to_probability (double log_probability) |
Converts the log of the spatial or temporal probability into format used in the alert message. | |
static __inline unsigned int | format_class (GRB_latAlertMsgTriggerType type, GRB_latAlertMsgLocMethod method, unsigned short int window_size) |
Formats the burst classification word. | |
static __inline void | format_quaternion (unsigned short int dst[4], const double src[4]) |
Formats the quaternion for the alert message. | |
void | GRBP_messageCapture (GRBP_message *msg, const GRBP_grb *grb, double current_time) |
Captures the set of parameters that are defined when the GRB suspect message is issued. | |
void | GRBP_messageFormat (GRBP_message *msg, const GRBP_grb *grb) |
Formats the part of the alert message that gets continually updated. | |
void | GRBP_messagePlogsFormat (GRBP_message *msg, const GRBP_probabilityLogs *plogs) |
Formats the specified logs of the spatial and temporal probabilities into the working copy of the message. | |
void | GRBP_messageEarliestTimeFormat (GRBP_message *msg, double earliest_time) |
Sets the time of the earliest photon. |
CVS $Id: GRBP_message.c,v 1.7 2011/03/30 22:11:51 russell Exp $
#define LOG_PROBABILITY_K_SCALE_FACTOR 4 |
Sets the scaling factor used to convert the floating point log of the spatial and temporal probabilities to a 16-bit unsigned integer.
The original choice of 256 was not a good one. It had too much precision and not enough range. This may be too far into the range category (16K), but do not see a lot of reason for any more the 1/4 unit of precision. All threshold values so far have been specified as whole numbers.
Referenced by to_probability().
static __inline unsigned int format_class | ( | GRB_latAlertMsgTriggerType | type, | |
GRB_latAlertMsgLocMethod | method, | |||
unsigned short int | window_size | |||
) | [static] |
Formats the burst classification word.
type | The GRB trigger type (LAT or GBM) | |
method | The location method | |
window_size | The size of the triggering window |
Referenced by GRBP_messageCapture().
static __inline void format_quaternion | ( | unsigned short int | dst[4], | |
const double | src[4] | |||
) | [static] |
Formats the quaternion for the alert message.
dst | The destination quaternion | |
src | The source quaternion |
Referenced by GRBP_messageFormat().
static __inline void gam_cnts_clear | ( | unsigned short int | gam_cnts[4] | ) | [static] |
Clears the little 4 word 16-bit histogram.
gam_cnts | The storage to clear |
Referenced by GRBP_messageCapture().
static __inline void gam_cnts_update | ( | unsigned short int | cnts[4], | |
const GRBP_gammaAux * | gammas, | |||
int | beg, | |||
int | end, | |||
int | max | |||
) | [static] |
Updates the little 4 bin histogram with energy of the gammas from index beg to end.
cnts | The counts of the histogram to update | |
gammas | The array of gammas to histogram | |
beg | The index of the first gamma to use in the update | |
end | The index of the last gamma to use in the update | |
max | The maximum gamma index (the gammas are stored in wrap-around fashion in a circular list |
References _GRBP_gammaAux::energy.
Referenced by GRBP_messageFormat().
void GRBP_messageCapture | ( | GRBP_message * | msg, | |
const GRBP_grb * | grb, | |||
double | current_time | |||
) |
Captures the set of parameters that are defined when the GRB suspect message is issued.
msg | The message context | |
grb | The GRB context | |
current_time | The time of the gamma entered which caused the the suspect message to be issued |
References _GRBP_message::alert, _GRBP_gammaList::beg, _GRBP_message::beg, _GRBP_windowTier2::earliest_time, format_class(), gam_cnts_clear(), _GRBP_grb::list, _GRBP_grb::location, _GRBP_grbLocations::method, _GRBP_windowTier1Prms::nrange, _GRBP_windowTier2::plog, _GRBP_windowTier1::prms, _GRBP_probabilityLogs::spatial, _GRBP_probabilityLogs::temporal, _GRBP_window::tier1, _GRBP_window::tier2, to_probability(), to_time(), _GRBP_window::type, and _GRBP_grb::window.
Referenced by grbDeclare().
void GRBP_messageEarliestTimeFormat | ( | GRBP_message * | msg, | |
double | earliest_time | |||
) |
Sets the time of the earliest photon.
msg | The message context | |
earliest_time | The earliest time |
References _GRBP_message::alert, and to_time().
Referenced by grbDeclare().
void GRBP_messageFormat | ( | GRBP_message * | msg, | |
const GRBP_grb * | grb | |||
) |
Formats the part of the alert message that gets continually updated.
msg | The message context | |
grb | The GRB context |
References _GRBP_message::alert, _GRBP_message::beg, _GRBP_location::dx0, _GRBP_location::dy0, _GRBP_location::dz0, _GRBP_gammaList::end, format_quaternion(), gam_cnts_update(), _GRBP_gammaList::gammas_aux, GRBP__dcosToDecArcmins(), _GRBP_grb::list, _GRBP_grb::loc_cnt, _GRBP_grb::location, _GRBP_gammaList::max, _GRBP_grbLocations::message, _GRBP_grb::quaternion, _GRBP_gammaAux::time, to_arcmins(), to_time(), _GRBP_location::w2_sum, and wrap_lo().
Referenced by confirmCheck(), grbDeclare(), stop(), and updateCheck().
void GRBP_messagePlogsFormat | ( | GRBP_message * | msg, | |
const GRBP_probabilityLogs * | plogs | |||
) |
Formats the specified logs of the spatial and temporal probabilities into the working copy of the message.
msg | The message context | |
plogs | The logs of the spatial and temporal probabilities |
References _GRBP_message::alert, _GRBP_probabilityLogs::spatial, _GRBP_probabilityLogs::temporal, and to_probability().
Referenced by stop(), and updateCheck().
static __inline unsigned short int to_arcmins | ( | double | radians | ) | [static] |
Converts radians to a arcmins, unsigned.
radians | The value to convert |
Referenced by GRBP_messageFormat().
static __inline unsigned short to_probability | ( | double | log_probability | ) | [static] |
Converts the log of the spatial or temporal probability into format used in the alert message.
log_probability | The value to convert. |
References LOG_PROBABILITY_K_SCALE_FACTOR.
Referenced by GRBP_messageCapture(), and GRBP_messagePlogsFormat().
static __inline GRB_latAlertMsgTime to_time | ( | double | time | ) | [static] |
Converts time to seconds and microsecnds, i.e. a GRB_latAlerMsgTime.
time | The time to convert |
References to_usecs().
Referenced by GRBP_messageCapture(), GRBP_messageEarliestTimeFormat(), and GRBP_messageFormat().
static __inline unsigned int to_usecs | ( | double | fraction_of_sec | ) | [static] |
Converts fractions of a second to micro seconds.
fraction_of_sec | The fraction of a second to convert. This value should be less than 1 second |
Referenced by to_time().