BINLOG_UPD(1)



NAME

     binlog_upd


SYNOPSIS

     binlog_upd [-N]
          [binlog={binlog_name} (NOT SPECIFIED for default)]



DESCRIPTION

     binlog_upd is a module to create and maintain binary  status
     logs.

     The binary status logs will  be  fits  files  and  the  file
     definitions        will        be        configured       in
     ~CM/tables/observables/status_logs/{binlog_name}.rdb   where
     binlog_name is an observable name or a series name.

     The binary status logs will be named qual_{binlog_name}.fits
     and will be stored /soidata/info/mdi_log/{level}

     binlog_upd will be called with a binlog_name as an argument.
     If  the  name is NOT SPECIFIED, binlog_upd will loop through
     and update binlogs for all entries in the definitions direc-
     tory.

     For each binlog_name, check for the existence of the defini-
     tion file.  If there is no definition file, abort.

     If there is no binlog create one, else check  the  exisiting
     one for consistency with the definition.

     If the file  is  inconsistent  with  the  definition,  abort
     unless  the  -N  flag  (force  new)  is  set.   In that case
     recreate the file in accordance with  the  existing  defini-
     tion.

     Get the last update time for the binlog (or 0 if creating  a
     new one)

     The definition  table  will  contain  entries  for  T_EPOCH,
     T_START,  T_STOP,  T_STEP,  and  LEVEL.   There  may also be
     entries for named masks which binlog_upd  will  put  in  the
     fits  header  of the binlog.  The named masks may be used in
     binlog access functions.

     LEVEL is the level of the quality  log(s)  which  binlog_upd
     should  use.   LEVEL  will  be  lev1.5  (or lev1.4) when the
     binlog_name corresponds to a data  series.   LEVEL  will  be
     lev1 when the binlog_name corresponds to an observable name.
     The cases are handled differently.

     In the first (data series) case,  the  quality  logs  to  be
     checked                        are                        in
     /soidata/info/mdi_log/lev1.[4|5]/{binlog_name}*

     In the second (observables) case, the  quality  logs  to  be
     checked   are   in  /soidata/info/mdi_log/lev1/{dpc*}  where
     dpc(s)      are      determined      by      looking      in
     ~CM/tables/observables/{binlog_name}*_dpc.rdb

     For each  quality log (*.record.rdb) file  whose  update  is
     newer  than  the binlog update, extract QUALITY and QUAL_VLD
     and insert them into the binlog in the  correct  time  slot.
     The time for lev1.5 (or 1.4) is T_REC.  The time for lev1 is
     T_OBS.



EXAMPLES

     binlog_upd binlog=fd_V
     creates (or updates) a binary status log file for the observable fd_V.

     binlog_upd -N binlog=fd_M_96m_01d
     creates a new binary status log file for the series fd_M_96m_01d
     in the case where the existing binary status log file is inconsistent
     with the revised definition.



FILES

     /soidata/info/mdi_log/{level}
     /home/soi/CM/tables/observables/*_dpc.rdb
     /home/soi/CM/tables/observables/status_logs/*.rdb


SEE ALSO

     gather_qual(1)


DIAGNOSTICS

     Writes informational messages to the history log.
     Writes warning and error messages to the error log.
     Returns non-zero error code on failure.


AUTHOR

     Kay Leibrand