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
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) self.beams = [] self.ftp_server = "sun-store.kat.ac.za" self.ftp_username = "******" self.ftp_password = "******"
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) StreamBased.__init__(self, id, self.cfg) self.processing_dir = self.cfg["CLIENT_STATS_DIR"] self.valid_plots = [] self.results = {} self.results["lock"] = threading.Lock() self.results["valid"] = False self.results["hg_npol"] = self.cfg["NPOL"] self.results["hg_ndim"] = self.cfg["NDIM"] (host, beam_id, subband_id) = self.cfg["STREAM_" + id].split(":") self.beam_name = self.cfg["BEAM_" + beam_id] (cfreq, bw, nchan) = self.cfg["SUBBAND_CONFIG_" + subband_id].split(":") self.cfreq = cfreq self.gen_timeseries = True self.gen_freqtime = True self.gen_bandpass = True self.gen_histogram = True self.hg_valid = False self.ft_valid = False self.bp_valid = False self.ms_valid = False self.ts_valid = False self.pref_freq = 0 self.histogram_abs_xmax = 128
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) self.plot_types = ["freq_vs_phase", "flux_vs_phase", "time_vs_phase", "bandpass", "snr_vs_time"] self.plot_resses = ["lo", "hi"] self.valid_plots = [] for plot_type in self.plot_types: for plot_res in self.plot_resses: self.valid_plots.append(plot_type + "_" + plot_res) self.zap_psh_script = "zap.psh" self.convert_psrfits = True self.psrfits_rf_filename = False self.nchan_plot = 1024 self.beams = [] self.subbands = [] self.results = {} self.snr_history = {} self.snr_plot = SNRPlot() self.suffixes = { "flux_vs_phase_lo": "flux.lo.png", "flux_vs_phase_hi": "flux.hi.png", "freq_vs_phase_lo": "freq.lo.png", "freq_vs_phase_hi": "freq.hi.png", "time_vs_phase_lo": "time.lo.png", "time_vs_phase_hi": "time.hi.png", "snr_vs_time_lo": "snrt.lo.png", "snr_vs_time_hi": "snrt.hi.png", "bandpass_lo": "band.lo.png", "bandpass_hi": "band.hi.png" }
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
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) StreamBased.__init__(self, id, self.cfg) self.processing_dir = self.cfg["CLIENT_STATS_DIR"] self.valid_plots = [] self.results = {} self.results["lock"] = threading.Lock() self.results["valid"] = False self.results["hg_npol"] = self.cfg["NPOL"] self.results["hg_ndim"] = self.cfg["NDIM"] (host, beam_id, subband_id) = self.cfg["STREAM_" + id].split(":") self.beam_name = self.cfg["BEAM_" + beam_id] (cfreq, bw, nchan) = self.cfg["SUBBAND_CONFIG_" + subband_id].split(":") self.cfreq = cfreq self.gen_timeseries = True self.gen_freqtime = True self.gen_bandpass = True self.gen_histogram = True self.hg_valid = False self.ft_valid = False self.bp_valid = False self.ms_valid = False self.ts_valid = False self.pref_freq = 0 self.histogram_abs_xmax = 128
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
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
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
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) self.beams = [] self.ftp_server = "sun-store.kat.ac.za" self.ftp_username = "******" self.ftp_password = "******"
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) StreamBased.__init__(self, id, self.cfg) self.valid_plots = [] self.results = {} self.results["lock"] = threading.Lock() self.results["valid"] = False (host, beam_id, sub_id) = self.cfg["STREAM_" + id].split(":") self.beam = self.cfg["BEAM_" + beam_id] (cfreq, bw, nchan) = self.cfg["SUBBAND_CONFIG_" + sub_id].split(":") self.cfreq = cfreq self.proc_dir = self.cfg["CLIENT_PREPROC_DIR"] + "/processing/" + \ self.beam self.fin_dir = self.cfg["CLIENT_PREPROC_DIR"] + "/finished/" + \ self.beam self.send_dir = self.cfg["CLIENT_PREPROC_DIR"] + "/send/" + \ self.beam self.fail_dir = self.cfg["CLIENT_PREPROC_DIR"] + "/failed/" + \ self.beam self.dirty_valid = False self.cleaned_valid = False self.gains_valid = False
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
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) StreamBased.__init__(self, id, self.cfg) self.configured = False self.running = False self.local_config = []
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
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) StreamBased.__init__(self, id, self.cfg) self.configured = False self.running = False self.local_config = []
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) self.valid_plots = ["freq_vs_phase", "flux_vs_phase", "time_vs_phase", "bandpass", "snr_vs_time"] self.beams = [] self.subbands = [] self.results = {} self.source_number = 0
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) self.beam_state = {} self.cam_config = {} self.beam_config = {} self.tcs_host = "None" self.tcs_port = -1 self.beam_name = "None" self.lmc = "None" self.repack = "None" self.beam = str(id) self.host = [] self.katcp = [] self.pubsub = [] self.snr = 0 self.stddev = 0 if not (self.cfg["INDEPENDENT_BEAMS"] == "true"): raise Exception( "KATCPDaemon incompatible with INDEPENDENT_BEAMS != true") self.reset_cam_config() # get a list of all LMCs for i in range(int(self.cfg["NUM_STREAM"])): (host, beam, subband) = self.cfg["STREAM_" + str(i)].split(":") if (beam == self.beam): if not self.lmc == "None": raise Exception("KATCPDaemon more than 1 matching lmc") self.lmc = host + ":" + self.cfg["LMC_PORT"] self.host = host self.lmc_cmd = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + \ "<lmc_cmd>" + \ "<requestor>katcp daemon</requestor>" + \ "<command>host_status</command>" + \ "</lmc_cmd>" self.cpu_temp_pattern = re.compile("cpu[0-9]+_temp") self.fan_speed_pattern = re.compile("fan[0-9,a-z]+") self.power_supply_pattern = re.compile("ps[0-9]+_status") # get a list of all the repacking scripts for i in range(int(self.cfg["NUM_STREAM"])): (host, beam, subband) = self.cfg["STREAM_" + str(i)].split(":") if beam == self.beam: if not self.repack == "None": raise Exception("KATCPDaemon more than 1 matching repack") self.repack = host + ":" + str( int(self.cfg["STREAM_REPACK_PORT"]) + i) self.repack_cmd = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + \ "<repack_request>" + \ "<requestor>katcp daemon</requestor>" + \ "<type>state</type>" + \ "</repack_request>"
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) self.valid_plots = ["freq_vs_phase", "flux_vs_phase", "time_vs_phase", "bandpass", "snr_vs_time"] self.beam = "" self.subbands = [] self.results = {} self.snr_history = {} self.snr_plot = SNRPlot()
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) self.valid_plots = ["freq_vs_phase", "flux_vs_phase", "time_vs_phase", "bandpass", "snr_vs_time"] self.beams = [] self.subbands = [] self.results = {} self.snr_history = {} self.snr_plot = SNRPlot()
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) self.beam = "" self.subbands = [] self.results = {} self.results["lock"] = threading.Lock() self.results["valid"] = False self.beam_name = "" self.valid_plots = ["timeseries", "histogram", "freqtime"]
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) self.valid_plots = [ "freq_vs_phase", "flux_vs_phase", "time_vs_phase", "bandpass", "snr_vs_time" ] self.beams = [] self.subbands = [] self.results = {} self.source_number = 0
def conclude(self): self.quit_event.set() for stream in self.client_streams: self.client_threads[stream].join() if self.server_thread: self.server_thread.join() script.log(1, "STOPPING SCRIPT") Daemon.conclude(self)
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
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) self.beams = [] self.rsync_username = "******" self.rsync_server = "herschel.atnf.csiro.au" self.rsync_module = "uwl_incoming" self.rsync_options = "-ah --relative --stats --no-g --no-l --omit-dir-times " + \ "--password-file=/home/uwb/.ssh/herschel_pw --bwlimit=122070" self.num_rsync = 4 self.rsync_servers = ["10.17.10.1", "10.17.10.1", "10.17.10.2", "10.17.10.2"] self.rsync_modules = ["uwl_incoming_0", "uwl_incoming_1", "uwl_incoming_2", "uwl_incoming_3"]
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
def __init__ (self, name, hostname): Daemon.__init__(self, name, hostname) HostBased.__init__(self, hostname, self.cfg) self.resource_lock = threading.Lock() self.resource_lock.acquire() self.disks = {} self.loads = { 'ncore': '0', '1min': '0', '5min': '0', '15min': '0' } self.ntp_sync = True self.smrbs = {} self.sensors = {} self.disks_to_monitor = []
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
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
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) self.beams = [] self.rsync_username = "******" self.rsync_server = "herschel.atnf.csiro.au" self.rsync_module = "uwl_incoming" self.rsync_options = "-ah --relative --stats --no-g --no-l --omit-dir-times " + \ "--password-file=/home/uwb/.ssh/herschel_pw --bwlimit=122070" self.num_rsync = 4 self.rsync_servers = [ "10.17.10.1", "10.17.10.1", "10.17.10.2", "10.17.10.2" ] self.rsync_modules = [ "uwl_incoming_0", "uwl_incoming_1", "uwl_incoming_2", "uwl_incoming_3" ]
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
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) self.plot_types = [ "freq_vs_phase", "flux_vs_phase", "time_vs_phase", "bandpass", "snr_vs_time" ] self.plot_resses = ["lo", "hi"] self.valid_plots = [] for plot_type in self.plot_types: for plot_res in self.plot_resses: self.valid_plots.append(plot_type + "_" + plot_res) self.zap_psh_script = "zap.psh" self.convert_psrfits = True self.psrfits_rf_filename = False self.nchan_plot = 1024 self.beams = [] self.subbands = [] self.results = {} self.snr_history = {} self.snr_plot = SNRPlot() self.suffixes = { "flux_vs_phase_lo": "flux.lo.png", "flux_vs_phase_hi": "flux.hi.png", "freq_vs_phase_lo": "freq.lo.png", "freq_vs_phase_hi": "freq.hi.png", "time_vs_phase_lo": "time.lo.png", "time_vs_phase_hi": "time.hi.png", "snr_vs_time_lo": "snrt.lo.png", "snr_vs_time_hi": "snrt.hi.png", "bandpass_lo": "band.lo.png", "bandpass_hi": "band.hi.png" }
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) self.timestamp_re = re.compile( "^\[\d\d\d\d-\d\d-\d\d-\d\d:\d\d:\d\d\.\d\d\d\d\d\d\]")
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) self.beam_states = {} self.host = sockets.getHostNameShort() self.start_offset_seconds = 20
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) self.beam_cfg = {} self.host = sockets.getHostNameShort()
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) self.beam_states = {} self.host = sockets.getHostNameShort() self.start_offset_seconds = 5
def conclude (self): for i in range(int(self.cfg["NUM_BEAM"])): bid = self.cfg["BEAM_" + str(i)] self.results[bid]["lock"].acquire() self.results[bid]["lock"].release() Daemon.conclude(self)
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) self.beam_state = {} self.cam_config = {} self.beam_config = {} self.tcs_host = "None" self.tcs_port = -1 self.beam_name = "None" self.lmc = "None" self.repack = "None" self.beam = str(id) self.host = [] self.katcp = [] self.pubsub = [] self.snr = 0 self.stddev = 0 if not (self.cfg["INDEPENDENT_BEAMS"] == "true"): raise Exception( "KATCPDaemon incompatible with INDEPENDENT_BEAMS != true") self.input_nchan = 0 for i in range(int(self.cfg["NUM_STREAM"])): (cfreq, bw, nchan) = self.cfg["SUBBAND_CONFIG_" + str(i)].split(":") self.input_nchan = self.input_nchan + int(nchan) self.reset_cam_config() # get a list of all LMCs for i in range(int(self.cfg["NUM_STREAM"])): (host, beam, subband) = self.cfg["STREAM_" + str(i)].split(":") if (beam == self.beam): # if not self.lmc == "None": # raise Exception ("KATCPDaemon more than 1 matching lmc") self.lmc = host + ":" + self.cfg["LMC_PORT"] self.host = host self.lmc_cmd = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + \ "<lmc_cmd>" + \ "<requestor>katcp daemon</requestor>" + \ "<command>host_status</command>" + \ "</lmc_cmd>" self.cpu_temp_pattern = re.compile("cpu[0-9]+_temp") self.fan_speed_pattern = re.compile("fan[0-9,a-z]+") self.power_supply_pattern = re.compile("ps[0-9]+_status") # get the repacking host:port for this beam for i in range(int(self.cfg["NUM_STREAM"])): (host, beam_id, subband_id) = self.cfg["STREAM_" + str(i)].split(":") # if the beam resides on this host if beam == self.beam: # if the current beam is not configured if self.repack == "None": self.repack = host + ":" + str( int(self.cfg["BEAM_REPACK_FOLD_PORT"]) + int(beam)) if self.repack == "None": raise Exception("KATCPDaemon could not find beam repack daemon") self.repack_cmd = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + \ "<repack_request>" + \ "<requestor>katcp daemon</requestor>" + \ "<type>state</type>" + \ "</repack_request>"
def configure(self, become_daemon, dl, source, dest): Daemon.configure(self, become_daemon, dl, source, dest) return 0
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) self.beams = []
def conclude(self): for i in range(int(self.cfg["NUM_BEAM"])): bid = self.cfg["BEAM_" + str(i)] self.results[bid]["lock"].acquire() self.results[bid]["lock"].release() Daemon.conclude(self)
def configure (self, become_daemon, dl, source, dest): Daemon.configure (self, become_daemon, dl, source, dest) return 0
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) self.beam_state = {} self.cam_config = {} self.beam_config = {} self.tcs_host = "None" self.tcs_port = -1 self.beam_name = "None" self.lmc = "None" self.repack = "None" self.beam = str(id) self.host = [] self.katcp = [] self.pubsub = [] self.snr = 0 self.stddev = 0 if not (self.cfg["INDEPENDENT_BEAMS"] == "true"): raise Exception ("KATCPDaemon incompatible with INDEPENDENT_BEAMS != true") self.input_nchan = 0 for i in range(int(self.cfg["NUM_STREAM"])): (cfreq, bw, nchan) = self.cfg["SUBBAND_CONFIG_" + str(i)].split(":") self.input_nchan = self.input_nchan + int(nchan) self.reset_cam_config() # get a list of all LMCs for i in range(int(self.cfg["NUM_STREAM"])): (host, beam, subband) = self.cfg["STREAM_" + str(i)].split(":") if (beam == self.beam): # if not self.lmc == "None": # raise Exception ("KATCPDaemon more than 1 matching lmc") self.lmc = host + ":" + self.cfg["LMC_PORT"] self.host = host self.lmc_cmd = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + \ "<lmc_cmd>" + \ "<requestor>katcp daemon</requestor>" + \ "<command>host_status</command>" + \ "</lmc_cmd>" self.cpu_temp_pattern = re.compile("cpu[0-9]+_temp") self.fan_speed_pattern = re.compile("fan[0-9,a-z]+") self.power_supply_pattern = re.compile("ps[0-9]+_status") # get the repacking host:port for this beam for i in range(int(self.cfg["NUM_STREAM"])): (host, beam_id, subband_id) = self.cfg["STREAM_" + str(i)].split(":") # if the beam resides on this host if beam == self.beam: # if the current beam is not configured if self.repack == "None": self.repack = host + ":" + str(int(self.cfg["BEAM_REPACK_FOLD_PORT"]) + int(beam)) if self.repack == "None": raise Exception ("KATCPDaemon could not find beam repack daemon") self.repack_cmd = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + \ "<repack_request>" + \ "<requestor>katcp daemon</requestor>" + \ "<type>state</type>" + \ "</repack_request>"
def __init__(self, name, hostname): Daemon.__init__(self, name, hostname) HostBased.__init__(self, hostname, self.cfg)
def __init__(self, name, id): Daemon.__init__(self, name, str(id)) StreamBased.__init__(self, id, self.cfg)
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) self.beams = []
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) StreamBased.__init__(self, id, self.cfg)
def __init__ (self, name, id): Daemon.__init__(self, name, str(id)) self.timestamp_re = re.compile ("^\[\d\d\d\d-\d\d-\d\d-\d\d:\d\d:\d\d\.\d\d\d\]")