GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSEP / V2-0-0

Constituent: qsep_extract     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

qsep_extract.c File Reference

Program to extract the event data from LSD to EBF format. More...

#include "QSEP/QSEP.h"
#include "QSEP/QSEP_ctx.h"
#include "QSE/QSE_update.h"
#include "QSE/QSE_ctx.h"
#include "QSE/QSE_ebf.h"
#include "QSE/QSE_aem.h"
#include "QSE/QSE_aemUnpack.h"
#include "QSE/QSE_tkr.h"
#include "QSE/QSE_tkrUnpack.h"
#include "QSE/QSE_cal.h"
#include "QSE/QSE_calUnpack.h"
#include "QSD/CCSDS_istream.h"
#include "QSD/CCSDS_telemetry.h"
#include "QSD/CCSDS_apidDsc.h"
#include "LSEP/LSEP_ids.h"
#include "LSE/LSE_ids.h"
#include "LSF/LSF_scan.h"
#include "LSF/LSF.h"
#include "EDS/ESS.h"
#include "EDS/EBF_dir.h"
#include "EDS/EBF_cid.h"
#include "EDS/EBF_edw.h"
#include "EDS/EBF_ebw.h"
#include "EDS/EBF_pkt.h"
#include "EDS/EBF_match.h"
#include "EDS/FFS.h"
#include "EDS/io/EBF_stream.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Include dependency graph for qsep_extract.c:


Data Structures

struct  _Ctl
 Run time print options/parameters. More...
struct  _ApidStream
 The print context for one APID. More...

Defines

#define RND_TO(_x, _r)   (((_x) + (_r) - 1) / (_r)) * (_r)
 Round _x up to the nearest boundary of _r.

Typedefs

typedef _Ctl Ctl
 Typedef for struct _Ctl.
typedef _ApidStream ApidStream
 Typedef for struct _ApidStream.

Functions

static void report_usage (void)
 Brief explanation on qsep_extract usage.
static int get_ctl (Ctl *ctl, int argc, char *const argv[])
 Examines the command line parameters and fills the print run time options control structure.
static void construct_astreams (ApidStream *astreams, int astream_cnt, unsigned int which, Ctl *ctl)
 Constructs the individual APID streams.
static __inline ApidStreamresolve (ApidStream *astreams, int astream_cnt, const CCSDS_telemetry *pkt)
 Given a CCSDS header containing the APID, the function resolves the Apid stream.
static LSF_scanContributionHandler screen_dgm (ApidStream *stream, const LSF_datagram *dgm)
 Screens out any datagrams that are not LSEP event datagrams.
static LSF_scanContributionHandler handle_dgm (ApidStream *astream, const LSF_datagram *dgm)
 handle the datatgram
static LSF_scanRecordHandler handle_ctb (ApidStream *astream, const LSF_contribution *ctb)
 Handles the event context information at contribution time.
static unsigned int handle_rec (ApidStream *astream, const LSF_record *rec)
 Extracts and writes the contents of the event.
static LSF_scanContributionHandler dgm_count (int *count, const LSF_datagram *dgm)
 Counts the number of events in this contribution.
static LSF_scanRecordHandler ctb_count (int *count, const LSF_contribution *ctb)
 Counts the number of events in this contribution.
static void rsd_add (QSE_ebfEvt *evt, const QSEP *qsep, unsigned int rsdmsk)
 Adds as much result summary information as can fit into the 8-word event header.
static __inline int not_dismissable (const EBF_dir *dir, unsigned int status)
 For EBF_dirCompose failures, checks to see if for the purposes of qsep_print, whether the error is dismissaable.
int qsep_extract (int argc, char *const argv[])
 Process a file of calibration events datagrams.
int main (int argc, char *const argv[])
 Process a file of calibration events datagrams.

Detailed Description

Program to extract the event data from LSD to EBF format.

Author:
russellslac.stanford.edu
Usage
   > qsep_extract -n:<# of events> -s<# to skip> -o<file_name> <file_name>
  

For a complete explanation type qsep_extract with no arguments

Define Documentation

#define RND_TO _x,
_r   )     (((_x) + (_r) - 1) / (_r)) * (_r)
 

Round _x up to the nearest boundary of _r.

Returns:
The rounded of value
Parameters:
_x The value to round
_r The rounding


Function Documentation

static void construct_astreams ApidStream astreams,
int  astream_cnt,
unsigned int  which,
Ctl ctl
[static]
 

Constructs the individual APID streams.

Parameters:
astreams The array of APID streams to construct
astream_cnt The count of APID streams to construct
which Bit mask of which CPUs to process
ctl The control structure

static LSF_scanRecordHandler ctb_count int *  count,
const LSF_contribution *  ctb
[static]
 

Counts the number of events in this contribution.

Parameters:
count Returned with the number of events in this datagram
ctb The contribution

static LSF_scanContributionHandler dgm_count int *  count,
const LSF_datagram *  dgm
[static]
 

Counts the number of events in this contribution.

Parameters:
count Returned with the number of events in this datagram
dgm The datagram

static int get_ctl Ctl ctl,
int  argc,
char *const   argv[]
[static]
 

Examines the command line parameters and fills the print run time options control structure.

Parameters:
ctl The parameter run time options block.
argc The number of command line parameters.
argv The array of pointers to the command line parameters.
Return values:
0,Everything is okay.
-1,Incorrect command usage. Usually this means that the input file name was absent.

static LSF_scanRecordHandler handle_ctb ApidStream astream,
const LSF_contribution *  ctb
[static]
 

Handles the event context information at contribution time.

Parameters:
astream The apid stream
ctb The datagram contribution

static LSF_scanContributionHandler handle_dgm ApidStream astream,
const LSF_datagram *  dgm
[static]
 

handle the datatgram

Parameters:
astream The apid stream
dgm The datagram

static unsigned int handle_rec ApidStream astream,
const LSF_record *  rec
[static]
 

Extracts and writes the contents of the event.

Parameters:
astream The apid stream
rec The LSF record containing the event

int main int  argc,
char *const   argv[]
 

Process a file of calibration events datagrams.

Returns:
Overall status
Parameters:
argc The argument count
argv The vector of command line strings

static __inline int not_dismissable const EBF_dir *  dir,
unsigned int  status
[static]
 

For EBF_dirCompose failures, checks to see if for the purposes of qsep_print, whether the error is dismissaable.

Return values:
==0 The error is dismissable
!=0 The error is not dismissable
Parameters:
dir The event directory
status The return status from EBF_dirCompose

int qsep_extract int  argc,
char *const   argv[]
 

Process a file of calibration events datagrams.

Returns:
Overall status
Parameters:
argc The argument count
argv The vector of command line strings

static __inline ApidStream * resolve ApidStream astreams,
int  astream_cnt,
const CCSDS_telemetry *  pkt
[static]
 

Given a CCSDS header containing the APID, the function resolves the Apid stream.

Returns:
IF the APID is one of the known streams, then resolves returns a pointer to the associated stream. If not, then NULL
Parameters:
astreams The array of APID streams
astream_cnt The number of APID streams
pkt The CCSDS packet header

static void rsd_add QSE_ebfEvt *  evt,
const QSEP *  qsep,
unsigned int  rsdmsk
[static]
 

Adds as much result summary information as can fit into the 8-word event header.

Parameters:
evt The decoded event
qsep The context block
rsdmsk A big-endian style bit-mask giving the target list of handlers
Due to the finite size of the header block, only a total of 6 words will be copied from up to 4 event handlers. The first 32-bit word contains 4 bytes, with the low 3 bits giving the length (in 32-bit words and the upper 5 bits giving the ID.

LSF_scanContributionHandler screen_dgm ApidStream astream,
const LSF_datagram *  dgm
[static]
 

Screens out any datagrams that are not LSEP event datagrams.

Returns:
Either a stop scan signal or the contribution handler
Parameters:
astream The APID stream
dgm The datagram


Generated on Tue Apr 15 01:25:23 2008 by  doxygen 1.4.4