Example #1
0
    def configure(self, become_daemon, dl, source, dest):

        Daemon.configure(self, become_daemon, dl, source, dest)

        self.processing_dir = self.cfg["SERVER_FOLD_DIR"] + "/processing"
        self.finished_dir = self.cfg["SERVER_FOLD_DIR"] + "/finished"
        self.archived_dir = self.cfg["SERVER_FOLD_DIR"] + "/archived"
        self.failed_dir = self.cfg["SERVER_FOLD_DIR"] + "/failed"

        for i in range(int(self.cfg["NUM_BEAM"])):
            bid = self.cfg["BEAM_" + str(i)]
            self.beams.append(bid)
            self.results[bid] = {}
            self.results[bid]["valid"] = False
            self.results[bid]["lock"] = threading.Lock()
            self.results[bid]["cond"] = threading.Condition(
                self.results[bid]["lock"])

            keys = ["source", "utc_start", "timestamp", "snr", "length"]
            for key in keys:
                self.results[bid][key] = ""

            self.snr_history[bid] = {}
            self.snr_history[bid]["times"] = []
            self.snr_history[bid]["snrs"] = []

        return 0
Example #2
0
    def configure(self, become_daemon, dl, source, dest):

        self.log(1, "RepackBeamDaemon::configure()")
        Daemon.configure(self, become_daemon, dl, source, dest)

        self.processing_dir = self.cfg["CLIENT_FOLD_DIR"] + "/processing"
        self.finished_dir = self.cfg["CLIENT_FOLD_DIR"] + "/finished"

        self.archived_dir = self.cfg["CLIENT_FOLD_DIR"] + "/archived"
        self.failed_dir = self.cfg["CLIENT_FOLD_DIR"] + "/failed"

        bid = self.cfg["BEAM_" + str(self.beam_id)]

        self.beams.append(bid)
        self.results[bid] = {}
        self.results[bid]["valid"] = False
        self.results[bid]["lock"] = threading.Lock()
        self.results[bid]["cond"] = threading.Condition(
            self.results[bid]["lock"])
        keys = ["source", "utc_start", "timestamp", "snr", "length"]
        for key in keys:
            self.results[bid][key] = ""

        self.snr_history[bid] = {}
        self.snr_history[bid]["times"] = []
        self.snr_history[bid]["snrs"] = []

        self.log(1, "RepackBeamDaemon::configure done")

        return 0
Example #3
0
  def configure (self, become_daemon, dl, source, dest):
 
    self.log(1, "RepackBeamDaemon::configure()")
    Daemon.configure(self, become_daemon, dl, source, dest)
 
    self.processing_dir = self.cfg["CLIENT_FOLD_DIR"] + "/processing"
    self.finished_dir   = self.cfg["CLIENT_FOLD_DIR"] + "/finished"

    self.archived_dir   = self.cfg["CLIENT_FOLD_DIR"] + "/archived"
    self.failed_dir     = self.cfg["CLIENT_FOLD_DIR"] + "/failed"

    bid = self.cfg["BEAM_" + str(self.beam_id)]

    self.beams.append(bid)
    self.results[bid] = {}
    self.results[bid]["valid"] = False
    self.results[bid]["lock"] = threading.Lock()
    self.results[bid]["cond"] = threading.Condition(self.results[bid]["lock"])

    self.snr_history[bid] = {}
    self.snr_history[bid]["times"] = []
    self.snr_history[bid]["snrs"] = []

    # find the subbands for the specified beam that are processed by this script
    self.total_channels = 0
    for isubband in range(int(self.cfg["NUM_SUBBAND"])):
      (cfreq , bw, nchan) = self.cfg["SUBBAND_CONFIG_" + str(isubband)].split(":")
      self.subbands.append({ "cfreq": cfreq, "bw": bw, "nchan": nchan })
      self.total_channels += int(nchan)

    self.out_cfreq = cfreq
    self.log(1, "RepackBeamDaemon::configure done")

    return 0
Example #4
0
  def configure (self, become_daemon, dl, source, dest):
 
    self.log(1, "RepackBeamDaemon::configure()")
    Daemon.configure(self, become_daemon, dl, source, dest)
 
    self.processing_dir = self.cfg["CLIENT_FOLD_DIR"] + "/processing"
    self.finished_dir   = self.cfg["CLIENT_FOLD_DIR"] + "/finished"

    self.archived_dir   = self.cfg["CLIENT_FOLD_DIR"] + "/archived"
    self.failed_dir     = self.cfg["CLIENT_FOLD_DIR"] + "/failed"

    bid = self.cfg["BEAM_" + str(self.beam_id)]

    self.beams.append(bid)
    self.results[bid] = {}
    self.results[bid]["valid"] = False
    self.results[bid]["lock"] = threading.Lock()
    self.results[bid]["cond"] = threading.Condition(self.results[bid]["lock"])
    keys = ["source", "utc_start", "timestamp", "snr", "length"]
    for key in keys:
      self.results[bid][key] = ""

    self.snr_history[bid] = {}
    self.snr_history[bid]["times"] = []
    self.snr_history[bid]["snrs"] = []

    self.log(1, "RepackBeamDaemon::configure done")

    return 0
Example #5
0
  def configure (self,become_daemon, dl, source, dest):

    Daemon.configure (self, become_daemon, dl, source, dest)

    self.processing_dir = self.cfg["SERVER_FOLD_DIR"] + "/processing"
    self.finished_dir   = self.cfg["SERVER_FOLD_DIR"] + "/finished"
    self.archived_dir   = self.cfg["SERVER_FOLD_DIR"] + "/archived"
    self.failed_dir     = self.cfg["SERVER_FOLD_DIR"] + "/failed"

    for i in range(int(self.cfg["NUM_BEAM"])):
      bid = self.cfg["BEAM_" + str(i)]
      self.beams.append(bid)
      self.results[bid] = {}
      self.results[bid]["valid"] = False
      self.results[bid]["lock"] = threading.Lock()
      self.results[bid]["cond"] = threading.Condition(self.results[bid]["lock"])

      self.snr_history[bid] = {}
      self.snr_history[bid]["times"] = []
      self.snr_history[bid]["snrs"] = []

    self.total_channels = 0
    for i in range(int(self.cfg["NUM_SUBBAND"])):
      (cfreq , bw, nchan) = self.cfg["SUBBAND_CONFIG_" + str(i)].split(":")
      self.subbands.append({ "cfreq": cfreq, "bw": bw, "nchan": nchan })
      self.total_channels += int(nchan)

    freq_low  = float(self.subbands[0]["cfreq"])  - (float(self.subbands[0]["bw"]) / 2.0)
    freq_high = float(self.subbands[-1]["cfreq"]) + (float(self.subbands[-1]["bw"]) / 2.0)
    self.out_freq = freq_low + ((freq_high - freq_low) / 2.0)

    return 0
Example #6
0
  def configure (self,become_daemon, dl, source, dest):

    Daemon.configure (self, become_daemon, dl, source, dest)

    self.processing_dir = self.cfg["SERVER_FOLD_DIR"] + "/processing"
    self.finished_dir   = self.cfg["SERVER_FOLD_DIR"] + "/finished"
    self.archived_dir   = self.cfg["SERVER_FOLD_DIR"] + "/archived"
    self.failed_dir     = self.cfg["SERVER_FOLD_DIR"] + "/failed"

    for i in range(int(self.cfg["NUM_BEAM"])):
      bid = self.cfg["BEAM_" + str(i)]
      self.beams.append(bid)
      self.results[bid] = {}
      self.results[bid]["valid"] = False
      self.results[bid]["lock"] = threading.Lock()
      self.results[bid]["cond"] = threading.Condition(self.results[bid]["lock"])

      keys = ["source", "utc_start", "timestamp", "snr", "length"]
      for key in keys:
        self.results[bid][key] = ""

      self.snr_history[bid] = {}
      self.snr_history[bid]["times"] = []
      self.snr_history[bid]["snrs"] = []

    return 0
Example #7
0
  def configure (self, become_daemon, dl, source, dest):
 
    self.log(2, "RepackFoldStreamDaemon::configure()")
    Daemon.configure(self, become_daemon, dl, source, dest)

    self.log(3, "RepackFoldStreamDaemon::configure stream_id=" + self.id)
    self.log(3, "RepackFoldStreamDaemon::configure beam_id=" + self.beam_id)
    self.log(3, "RepackFoldStreamDaemon::configure subband_id=" + self.subband_id)
  
    # beam_name
    self.beam = self.cfg["BEAM_" + str(self.beam_id)]

    # base directories for fold data products
    self.processing_dir = self.cfg["CLIENT_FOLD_DIR"] + "/processing"
    self.finished_dir   = self.cfg["CLIENT_FOLD_DIR"] + "/finished"
    self.send_dir       = self.cfg["CLIENT_FOLD_DIR"] + "/send"
    self.failed_dir     = self.cfg["CLIENT_FOLD_DIR"] + "/failed"

    # get the properties for this subband
    (cfreq , bw, nchan) = self.cfg["SUBBAND_CONFIG_" + str(self.subband_id)].split(":")
    self.cfreq = cfreq
    self.bw = bw
    self.nchan = nchan

    # not sure is this is needed
    self.out_cfreq = cfreq

    # Rsync parameters
    self.rsync_user = "******"
    self.rsync_server = "medusa-srv0.atnf.csiro.au"
    self.rsync_module = "TBD"

    self.log(3, "RepackFoldStreamDaemon::configure done")

    return 0
Example #8
0
  def configure (self,become_daemon, dl, source, dest):

    Daemon.configure (self, become_daemon, dl, source, dest)

    self.finished_dir   = self.cfg["SERVER_FOLD_DIR"] + "/finished"

    for i in range(int(self.cfg["NUM_BEAM"])):
      bid = self.cfg["BEAM_" + str(i)]
      self.beams.append(bid)
      self.results_lock = threading.Lock()
      self.results_cond = threading.Condition(self.results_lock)

    return 0
Example #9
0
    def configure(self, become_daemon, dl, source, dest):

        Daemon.configure(self, become_daemon, dl, source, dest)

        self.finished_dir = self.cfg["SERVER_FOLD_DIR"] + "/finished"

        for i in range(int(self.cfg["NUM_BEAM"])):
            bid = self.cfg["BEAM_" + str(i)]
            self.beams.append(bid)
            self.results_lock = threading.Lock()
            self.results_cond = threading.Condition(self.results_lock)

        return 0
Example #10
0
  def configure (self, become_daemon, dl, source, dest):
 
    self.log(1, "ResultsBeamDaemon::configure()")
    Daemon.configure(self, become_daemon, dl, source, dest)
 
    self.finished_dir = self.cfg["CLIENT_FOLD_DIR"] + "/finished"

    bid = self.cfg["BEAM_" + str(self.beam_id)]

    self.beams.append(bid)
    self.results_lock = threading.Lock()
    self.results_cond = threading.Condition(self.results_lock)

    self.log(1, "ResultsBeamDaemon::configure done")

    return 0
Example #11
0
    def configure(self, become_daemon, dl, source, dest):

        self.log(1, "ResultsBeamDaemon::configure()")
        Daemon.configure(self, become_daemon, dl, source, dest)

        self.finished_dir = self.cfg["CLIENT_FOLD_DIR"] + "/finished"

        bid = self.cfg["BEAM_" + str(self.beam_id)]

        self.beams.append(bid)
        self.results_lock = threading.Lock()
        self.results_cond = threading.Condition(self.results_lock)

        self.log(1, "ResultsBeamDaemon::configure done")

        return 0
Example #12
0
    def configure(self, become_daemon, dl, source, dest):

        self.debug("")
        Daemon.configure(self, become_daemon, dl, source, dest)

        self.trace("stream_id=" + self.id)
        self.trace("beam_id=" + self.beam_id)
        self.trace("subband_id=" + self.subband_id)

        # beam_name
        self.beam = self.cfg["BEAM_" + str(self.beam_id)]

        # base directories for search data products
        self.processing_dir = self.cfg["CLIENT_SEARCH_DIR"] + "/processing"
        self.finished_dir = self.cfg["CLIENT_SEARCH_DIR"] + "/finished"
        self.send_dir = self.cfg["CLIENT_SEARCH_DIR"] + "/send"
        self.failed_dir = self.cfg["CLIENT_SEARCH_DIR"] + "/failed"

        # get the properties for this subband
        (cfreq, bw, nchan) = self.cfg["SUBBAND_CONFIG_" +
                                      str(self.subband_id)].split(":")
        self.cfreq = cfreq
        self.bw = bw
        self.nchan = nchan

        # not sure is this is needed
        self.out_cfreq = cfreq

        # Rsync parameters
        self.rsync_user = "******"
        self.rsync_server = "medusa-srv0.atnf.csiro.au"
        self.rsync_module = "TBD"

        # Beam Name
        (host, beam_id, subband_id) = self.cfg["STREAM_" + self.id].split(":")
        self.beam_name = self.cfg["BEAM_" + beam_id]


        return 0
Example #13
0
 def configure(self, become_daemon, dl, source, dest):
     Daemon.configure(self, become_daemon, dl, source, dest)
     return 0
Example #14
0
 def configure (self, become_daemon, dl, source, dest):
   Daemon.configure (self, become_daemon, dl, source, dest)
   return 0