GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSEC / V7-1-0 > lsec / linux-gcc
#include "compact.h"
#include "compress.ic"
#include "LSEC_p.h"
#include "LSEC/LSEC.h"
#include "LSEC/LSEC_ctx.h"
#include "LSEC/LSEC_msgs.h"
#include "LDT/APE.h"
#include "EDS/EBF_cid.h"
#include "EDS/EBF_cal.h"
#include "EDS/EBF_tem.h"
#include "EDS/EBF_tkr.h"
#include "PBS/MBA.h"
#include "PBS/WCT.h"
#include "MSG/MSG_pubdefs.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
Functions | |
void | LSEC_accumCalMeans (LSEC_compaction *cpc, unsigned int *evt, EBF_dir *dir) |
Accumulate the means of the CAL log end values. | |
unsigned | LSEC_checkCalCompaction (LSEC_compaction *cpc) |
Check the CAL substructure for errors. | |
void | LSEC_clearCalCompaction (LSEC_compaction *cpc) |
Clear away any CAL context from a previous cycle. | |
unsigned int * | LSEC_copyUser (LSEC_compaction *cpc, unsigned int *buf) |
Copy datagram header information into the buffer. | |
void | LSEC_deleteCompaction (LSEC_compaction *cpc) |
Free memory previously allocated with a call to LSEC_newCompaction. | |
unsigned int | LSEC_eventSizeCal (const LSEC_calEvent *event) |
Get the size of a saved CAL event. | |
EBF_ctb * | LSEC_gemContribCal (const LSEC_calEvent *event) |
Get the GEM contribution address from a saved CAL event. | |
void | LSEC_histoCalMeans (LSEC_compaction *cpc) |
Calculate and histogram the mean values for the CAL log ends. | |
void | LSEC_histogramCal (LSEC_compaction *cpc, LSEC_calEvent *event) |
Perform histogramming of the CAL data. | |
LSEC_compaction * | LSEC_newCompaction (unsigned cap, long long *times) |
Allocate memory for an LSEC_compaction structure and all the substructures. | |
unsigned | LSEC_processCal (LSEC_compaction *cpc) |
Process the CAL compression structures. | |
void | LSEC_reportCalCompaction (LSEC_compaction *cpc, FILE *fp) |
Write CAL compression table contents to an ASCII file. | |
void | LSEC_setContext (LSEC_compaction *cpc, const LSEC_ctx *ctx) |
Set the context information pointer. | |
void | LSEC_setMode (LSEC_compaction *cpc, unsigned mode) |
Set the calibration mode. | |
unsigned int | LSEC_sizeofUser (LSEC_compaction *cpc) |
Calculate the number of 32-bit words required to hold the tables against which the contributions will be encoded. |
$Id: compact.c,v 1.19 2010/08/12 21:07:08 saxton Exp $
void LSEC_accumCalMeans | ( | LSEC_compaction * | cpc, | |
unsigned int * | evt, | |||
EBF_dir * | dir | |||
) |
Accumulate the means of the CAL log end values.
This routine accumulates the CAL ADC values, keeping a separate sum for each log end.
cpc | Compaction structure | |
evt | Pointer to the event storage area | |
dir | Pointer to the event to analyse |
unsigned LSEC_checkCalCompaction | ( | LSEC_compaction * | cpc | ) |
Check the CAL substructure for errors.
cpc | Pointer to a compaction object |
void LSEC_clearCalCompaction | ( | LSEC_compaction * | cpc | ) |
Clear away any CAL context from a previous cycle.
cpc | Pointer to a compaction object |
unsigned int* LSEC_copyUser | ( | LSEC_compaction * | cpc, | |
unsigned int * | buf | |||
) |
Copy datagram header information into the buffer.
buf | Pointer to the buffer where the context should be placed | |
cpc | Pointer to the structure containing the tables (a compaction) |
void LSEC_deleteCompaction | ( | LSEC_compaction * | cpc | ) |
Free memory previously allocated with a call to LSEC_newCompaction.
cpc | Pointer to a compaction structure previously created by a call to LSEC_newCompaction |
unsigned int LSEC_eventSizeCal | ( | const LSEC_calEvent * | event | ) |
Get the size of a saved CAL event.
event | Pointer to a CAL event data structure. |
EBF_ctb* LSEC_gemContribCal | ( | const LSEC_calEvent * | event | ) |
Get the GEM contribution address from a saved CAL event.
event | Pointer to a CAL event data structure. |
void LSEC_histoCalMeans | ( | LSEC_compaction * | cpc | ) |
Calculate and histogram the mean values for the CAL log ends.
The mean ADC values for each CAL log end are calculated and histogrammed, one histogram per range, ready for being encoded.
cpc | Pointer to an LSEC_compaction structure |
void LSEC_histogramCal | ( | LSEC_compaction * | cpc, | |
LSEC_calEvent * | event | |||
) |
Perform histogramming of the CAL data.
Several quantities associated with the CAL are histogrammed in preparation for being encoded. These include: the tower map; the mean-subtracted ADC values, offset to be positive, and grouped by range; the diagnostic tower map; and the diagnostic data.
cpc | Compaction structure | |
event | Pointer to the stored event |
LSEC_compaction* LSEC_newCompaction | ( | unsigned | cap, | |
long long * | times | |||
) |
Allocate memory for an LSEC_compaction structure and all the substructures.
cap | Capacity of the calibration task, the maximum number of events that can be collected each cycle | |
times | Pointer to the array of processing times. |
unsigned LSEC_processCal | ( | LSEC_compaction * | cpc | ) |
Process the CAL compression structures.
cpc | Pointer to an LSEC_compaction structure |
void LSEC_reportCalCompaction | ( | LSEC_compaction * | cpc, | |
FILE * | fp | |||
) |
Write CAL compression table contents to an ASCII file.
cpc | Pointer to a compaction object | |
fp | Pointer to the destination file |
void LSEC_setContext | ( | LSEC_compaction * | cpc, | |
const LSEC_ctx * | ctx | |||
) |
Set the context information pointer.
cpc | Pointer to a compaction structure | |
ctx | Pointer to the context block |
void LSEC_setMode | ( | LSEC_compaction * | cpc, | |
unsigned | mode | |||
) |
Set the calibration mode.
cpc | Pointer to a compaction structure | |
mode | The calibration mode |
unsigned int LSEC_sizeofUser | ( | LSEC_compaction * | cpc | ) |
Calculate the number of 32-bit words required to hold the tables against which the contributions will be encoded.
cpc | Pointer to the compaction structure |