def __init__(self, name, configuration='DTO'):
   """
   """
   PyroServer.__init__(self) #  This screws up logging in this class
   self.logger = logging.getLogger(logger.name+".DTO_Manager")
   self.logger.debug("__init__: getting configuration")
   obs, equip = station_configuration('DTO-32K')
   self.switch = equip['IF_switch']['DTO']
   self.spectrometer = equip['Backend']
   self.sample_clk = equip['sampling_clock']
   self.logger.debug("__init__: getting status")
   self.sw_states = self.switch.get_states()
   self.DSPnames = self.spectrometer.roach.keys()
   self.RFchannel = {}
   self.gain = {}
   self.enabled = {}
   self.firmware = {}
   for name in self.DSPnames:
     RFids = self.spectrometer.roach[name].RFchannel.keys()
     self.RFchannel[name] = {} 
     self.gain[name] = {}
     self.enabled[name] = {}
     self.firmware[name] = self.spectrometer.roach[name].firmware()
     for RF in RFids:
       self.RFchannel[name][RF] = self.spectrometer.roach[name].RFchannel[RF]
       self.gain[name][RF] = self.RFchannel[name][RF].RF_gain_get()
       self.enabled[name][RF] = self.RFchannel[name][RF].RF_enabled()
   self.logger.debug("__init__: done")
Example #2
0
 def __init__(self, dss, year, doy, datefiles):
     """
 """
     self.datefiles = datefiles
     # object to get IF routing
     self.da = DistributionAssembly()
     patchdate = self.da.get_sheet_by_date("%4d/%03d" % (year, doy))
     self.IFs = self.da.get_signals('Power Meter')
     # equipment configuration
     obs, equipment = station_configuration('WBDC2_K2')
     tel = equipment['Telescope']
     FITSfile.__init__(self, tel)
     # object for getting NMC log data
     first_file = self.datefiles[0]
     first_time = float(os.path.basename(first_file)[12:-4])
     time = UnixTime_to_datetime(first_time).strftime("%H%M")
     self.NMClogman = NMClogManager(station=dss,
                                    year=year,
                                    DOY=doy,
                                    time=time,
                                    use_portal=False)
     # object for providing specific data from the NMC log extracts
     self.logserver = NMC_log_server(dss, year, doy)
Example #3
0
  equipment['Synthesizer'] 
  BE = ClassInstance(Backend,
                     SAObackend,
                     "32K Spectrometer",
                     inputs = {"Ro1In1": IFswitch.outputs['IF1'],
                               "Ro2In1": IFswitch.outputs['IF3']},
                     output_names = [["IF1pwr"],
                                     ["IF2pwr"]])
  equipment['Backend'] = BE                         
  return obs, equipment

if __name__ == "__main__":
  logging.basicConfig(level=logging.DEBUG)
  mylogger = logging.getLogger()
  mylogger.setLevel(logging.DEBUG)
  
  from MonitorControl.Configurations import station_configuration

  obs, equipment = station_configuration('DTO-32K')
  print "obs =", obs
  tel = equipment['Telescope']
  fe = equipment['FrontEnd']
  rx = equipment['Receiver']
  print "tel =", tel
  print "fe =", fe
  print "rx =", rx
  IFswitch = equipment['IF_switch']
  print "IFswitch =", IFswitch
  BE = equipment['Backend']
  print "BE =", BE
Example #4
0
from support.logs import init_logging, get_loglevel, set_loglevel
from MonitorControl.Configurations import station_configuration
from MonitorControl.config_test import show_signal_path

logging.basicConfig(level=logging.INFO)

logpath = "/tmp/"  # for now

if __name__ == "__main__":

    mylogger = logging.getLogger()
    init_logging(mylogger,
                 loglevel=logging.INFO,
                 consolevel=logging.INFO,
                 logname=logpath + "DSS-13_server.log")
    mylogger.debug(" Handlers: %s", mylogger.handlers)

    observatory, equipment = station_configuration('dss-13')
    telescope = equipment['Telescope']
    frontends = equipment['FrontEnd']
    receivers = equipment['Receiver']

    show_signal_path([frontends['X-X/Ka'], receivers['X-X/Ka']])
    show_signal_path([frontends['Ka-X/Ka'], receivers['Ka-X/Ka']])
    show_signal_path([frontends['S-S/X'], receivers['S-S/X']])
    show_signal_path([frontends['X-S/X'], receivers['X-S/X']])
    show_signal_path([frontends['XXKa'], receivers['XXKa']])
    show_signal_path([frontends['Xwide'], receivers['GSSR']])
    show_signal_path([frontends['K'], receivers['K']])
    show_signal_path([equipment['IF_switch']['pedestal']])
Example #5
0
    Pyro.config.PYRO_TRACELEVEL = 3

    # Is there a Pyro server running?
    # if is_running("pyro-ns") == False:
    locator = Pyro.naming.NameServerLocator()
    mylogger.debug("Using locatorr %s", locator)
    try:
        ns = locator.getNS(host='dto.jpl.nasa.gov')
    except NamingError:
        mylogger.error(
            """Pyro nameserver task notfound. Is the terminal at least 85 chars wide?
      If pyro-ns is not running. Do 'pyro-ns &'""")
        raise RuntimeError("No Pyro nameserver")
    mylogger.info("Starting %s, please wait....", __name__)
    # Here is the hardware configuration
    observatory, equipment = station_configuration('wbdc2')
    telescope = equipment['Telescope']
    receiver = equipment['Receiver']

    m = WBDCserver(observatory, equipment)
    mylogger.info("%s started", __name__)
    launch_server(server_host, __name__, m)
    try:
        ns = locator.getNS(host='dto.jpl.nasa.gov')
    except NamingError:
        mylogger.error(
            """Pyro nameserver task notfound. Is the terminal at least 85 chars wide?
      If pyro-ns is not running. Do 'pyro-ns &'""")
        raise RuntimeError("No Pyro nameserver")
    ns.unregister(__name__)
    mylogger.info("%s finished", __name__)
Example #6
0
    class AnalogMonitor():
        """
    """
        def __init__(self, parent):
            """
      """
            self.parent = parent
            mylogger = logging.getLogger(self.parent.logger.name +
                                         ".AnalogMonitor")
            self.logger = mylogger


if __name__ == "__main__":
    """
  Tests class WBDC2 in configuration
  """
    from MonitorControl.config_test import show_signal_path
    from MonitorControl.Configurations import station_configuration
    from MonitorControl.Configurations.CDSCC.WBDC2_K2 import IFswitch
    from MonitorControl.config_test import show_signal_path

    testlogger = logging.getLogger()
    testlogger.setLevel(logging.DEBUG)

    lab, equipment = station_configuration("WBDC2_K2")
    show_signal_path([
        equipment['FrontEnd'], equipment['Receiver'], equipment['IF_switch'],
        equipment['Backend']
    ])