The GLASTOPS_ACQSUMMARY table in the ISOC_FLIGHT database (see this description for details) is a superset of information of interest to MOOT clients. Possibilities are
The only reason to prefer 1. would be if there were danger of the duplicated information getting irremediably out of sync, but that is not a concern in this case, so we (Bryson and Joanne) intend to implement 2. The new Acq_summary table in MOOD will have approximately the following structure:
Field name | Description |
---|---|
acq_summary_key | Auto-incrementing primary key |
started_at | Start of acquisition. |
scid | source id. (started_at, scid) form a unique index. |
config_fk | Key of MOOT config in effect for this acquisition as derived from operator requests |
type | LPA or LCI |
analysis | same as ANALYSIS in Oracle table |
status* | Should convey whether decoding of the acquisition is complete, in progress, aborted, etc. |
evtutc0* | Event timestamp of first decoded event |
evtutc1* | Event timestamp of last decoded event |
nevts* | Count of decoded events |
hw_key | fmx logical key for LATC master |
sw_key | fmx logical key for SBS (LPA) or script (LCI) |
creation_time | Timestamp when db row was created |
update_time* | Timestamp when db row was last updated |
uid* | Log-in id of last user to update the row. |
* may change after initial insert of row
A separate table, Acq_mode, will be needed to log filter configurations for runs of type LPA since these can vary on a per-mode basis (mode in this context is one of normal acquisition, TOO or ARR). Certain additional configuration keys, including at a minimum the one for GRB algorithm configuration, will also be kept here, regardless of whether they ever vary on a per-mode basis.
Field name | Description |
---|---|
acq_mode_key | Auto-incrementing primary key |
acq_summary_fk | Foreign key referring to Acq_summary.acq_summary_key |
mode | Value of mode at time entry is made |
fmx_log_key | fmx logical key of a config file of interest |
FSW_input_fk | Foreign key referring to primary key of FSW_inputs table |
Might also add some of the usual boilerplate columns, such as creation_time and uid. There is no need to include update_time since rows in this table should never be modified after the initial insert.
There will be a uniqueness requirement on the triple (acq_summary_fk, mode, fmx_file_key)
updateAcqSummary
will insert or
update a row in the main table and
optionally add
rows to the Acq_mode table.
Same routine can be used for both insert and update
since startedAt and scid
values will be among the input arguments).
and will cause both tables to be modified as appropriate. Call interface could be something like
unsigned updateAcqSummary(unsigned long startedAt, /* seconds from mission start */ unsigned long scid, /* source id */ unsigned long configKey, /* Refers to presumed MOOT config for this acq */ const std::string& acqType, /* enum */ const std::string& analysis, double evtutc0, /* ts of 1st evt decoded so far; secs since 1/1/1970 */ double evtutc1, /* ts of last evt decoded so far; secs since 1/1/1970 */ unsigned long nEvt, /* #events decoded so far for this acq */ unsigned long hwKey, /* LATC master key */ unsigned long swKey, /* LCI script or SBS key */ const std::string& mode, /* normal acq, TOO or ARR */ const std::vector<unsigned long>& moreKeys) /* other fmx log. keys */
where returned value is a code for status of the update.
bool MootQuery::consistentKeys(unsigned long configKey, const std::vector<unsigned long>& logicalKeys)
Return true if all the logical keys "belong" to the specified config; else false.
unsigned MootQuery::findConfigCandidates(std::vector<unsigned long>& candidates, const std::vector<unsigned long>& logicalKeys, const std::string& activeState="ACTIVE", const std::string& status="CREATED")
Takes as input a set of fmx logical keys and (optionally) cuts on status.
Returns a list of configs in the candidates
argument
which use all files represented by the keys and satisfy the conditions
on status.
For example
The above scheme will not provide a record of exactly which mode was in effect when. This information is already available in the data for those processes reading data event by event. Conceivably it might be of interest for simulation or to generate reports, in which case it should be stored and made accessible by MOOT. It's not easy to keep track of this as the data come in but it is readily available once a run is declared complete.
If it seems advisable to keep track of mode history, a table (call it Acq_mode_history), will be added to MOOT and access routines provided. The table can be written by a job which will be handling other tasks at run-complete time. This work (finalizing design of tables and access routines, implementing) is not especially onerous and can be deferred until needed.
Field name | Description |
---|---|
acq_mode_history_key | Auto-incrementing primary key |
acq_summary_fk | Foreign key referring to Acq_summary.acq_summary_key |
mode | Value of data-taking mode (normal, ARR, TOO) |
interval_begin | beginning of interval over which this mode was in effect |
interval_end | end of interval over which this mode was in effect |
Initial draft: 11 Jan 2008 Last revised: Wednesday, 06-Feb-2008 15:33:55 PST |
J. Bogart |