Esempio n. 1
0
	def __init__(self,controlValues=None,*args,**kwargs):
		DataSetShowGroupBox.__init__(self,_("Housekeeping"),self.HKset)

		self.controlValues=controlValues
		self.measurements=None

		self.dbr=dbr()
		self.sensors=sensors()
		self.chopper=chopper()
		self.dbr.init()
		self.sensors.init()
		self.chopper.init()
Esempio n. 2
0
    def __init__(self):
        QMainWindow.__init__(self)

        icons = myIcons()
        self.getIcon = icons.getIcon

        self.setWindowTitle('IRAM GUI')
        self.resize(QSize(1200, 800))
        self.setWindowIcon(self.getIcon('Jupiter'))

        self.measurements = None

        self.centralwidget = CentralWidget(self)
        self.setCentralWidget(self.centralwidget)

        self.HKvalues = self.centralwidget.HKvalues
        self.Controlvalues = self.centralwidget.Controlvalues
        self.sBar = self.centralwidget.sBar

        self.init = False
        self.running = False

        try:
            self.dbr = dbr()
            self.dbr.init()
        except:
            self.dum_dbr = dummy_hardware('DBR')
            self.dum_dbr.init()

        try:
            self.sensors = sensors()
            self.sensors.init()
        except:
            self.dum_HK = dummy_hardware('HOUSEKEEPING')
            self.dum_HK.init()

        try:
            self.chopper = chopper()
            self.chopper.init()
        except:
            self.dum_chop = dummy_hardware('CHOPPER')
            self.dum_chop.init()

        self.measureThread = measure(self)

        self.timer = QTimer()
        self.timer.timeout.connect(self.updateTimer)
        self.timer.start(200)

        self.time = localtime()

        self.closeEvent = self.closeApp
Esempio n. 3
0
    def __init__(self,
                 sweep=False,
                 freq=214,
                 freq_step=0.2,
                 if_offset=6,
                 sweep_step=10,
                 full_file=10 * 56 * 5 * 4,
                 repeat=True,
                 wait=1,
                 freq_range=(214, 270),
                 wobbler_device="/dev/ttyS0",
                 wobbler_address=b'0',
                 wiltron68169B_address=5,
                 chopper_device="/dev/chopper",
                 antenna_offset=1000,
                 dbr_port=1080,
                 dbr_server="dbr",
                 integration_time=5000,
                 blank_time=5,
                 measurement_type="IRAM",
                 mode="antenna",
                 basename='../data/',
                 raw_formats=[
                     files.aform, files.eform, files.dform, files.dform,
                     files.xtest2form
                 ],
                 formatnames=['a', 'e', 'd', 'd', 'xtest2'],
                 spectrometer_channels=[[8192, 8192], [7504], [4096], [4096],
                                        [1023]],
                 spectrometers=[FW, rcts104, rcts104, pc104, acs],
                 spectrometer_freqs=[[[0, 1500], [0, 1500]],
                                     [[2100 - 105, 2100 + 105]], [[1330,
                                                                   1370]],
                                     [[1330, 1370]], [[4400, 8800]]],
                 spectrometer_hosts=[
                     'localhost', 'sofia4', "waspam3", "pc104", None
                 ],
                 spectrometer_names=[
                     'AFFTS', '210 MHz CTS', "40 MHz CTS RCTS",
                     "40 MHz CTS PC104", 'ACS'
                 ],
                 spectrometer_tcp_ports=[25144, 1788, 1788, 1725, None],
                 spectrometer_udp_ports=[16210, None, None, None, None]):
        """ Initialize the machine

		Parameters:
			sweep (boolean):
				**INFO**
			freq (int):
				Set the frequency of the device
			freq_step (float):
				Set the frequency step 
			if_offset (int):
				**INFO**
			full_file (int):
				Must be a multiple of 4
			repeat (boolean):
				**INFO**
			wait (int):
				**INFO**
			freq_range (tuple):
				Range of frequencies available
			wobbler_device (str):
				wobbler device's path
			wobbler_address (str):
				wobbler's address
			wiltron68169B_address (int):
				wiltron68169B's address
			chopper_device (str):
				chopper device's path
			antenna_offset (int):
				**INFO**
			dbr_port (int):
				Port to connect with the dbr
			dbr_server (str):
				Name of the dbr's server
			integration_time (int):
				**INFO**
			blank_time (int):
				**INFO**
			mode (str):
				**INFO**
			basename (str):
				**INFO**
			raw_formats (list):
				list of format for the files
			formatnames (list):
				list of format name for files
			spectrometer_channels (list):
				list of channels for the spectrometer
			spectrometers (list):
				list of spectrometer
			spectrometer_hosts (list):
				list of host names
			spectrometer_tcp_ports (list):
				list of tcp port
			spectrometer_udp_ports (list):
				list of udp ports
		"""
        assert not (full_file % 4), "Must have full series in file"
        assert wait >= 0.0, "Cannot have negative waiting time"

        self.measurement_type = measurement_type

        # Sets the wobbler interactions
        if self.measurement_type == 'WVR':
            self.wob = WVR.wobbler(device=wobbler_device,
                                   address=wobbler_address)
        else:
            self.wob = IRAM.wobbler(device=wobbler_device,
                                    address=wobbler_address)
        # Sets the chopper interactions
        self.chop = chopper.chopper(device=chopper_device,
                                    offset=antenna_offset)
        if mode == 'antenna':
            self.order = [
                self.chop.set_cold, self.chop.set_ant, self.chop.set_hot,
                self.chop.set_ant
            ]
        elif mode == 'reference':
            self.order = [
                self.chop.set_cold, self.chop.set_ref, self.chop.set_hot,
                self.chop.set_ref
            ]
        elif mode == 'mixed':
            self.order = [
                self.chop.set_cold, self.chop.set_ant, self.chop.set_ref,
                self.chop.set_hot
            ]
        else:
            raise RuntimeError(("'antenna', 'reference', and 'mixed' are the "
                                "optional modes.  Not " + str(mode) + ", "
                                "which is what you choose"))

        # Sets the spectrometer interactions
        self.spec = []
        for i in range(len(spectrometer_channels)):
            self.spec.append(spectrometers[i](
                integration_time=integration_time,
                data_storage_containers=4,
                channels=spectrometer_channels[i],
                host=spectrometer_hosts[i],
                tcp_port=spectrometer_tcp_ports[i],
                udp_port=spectrometer_udp_ports[i],
                blank_time=blank_time,
                frequency=spectrometer_freqs[i],
                name=spectrometer_names[i]))
        self._spectrometers_count = len(self.spec)
        assert self._spectrometers_count, "Must have at least one spectrometer"

        if self.measurement_type == 'IRAM':
            # Sets the LO interactions
            self.lo = wiltron68169B(address=wiltron68169B_address)
            self.dbr = dbr(port=dbr_port, server=dbr_server)
        else:
            self.multimeter = Agilent34970A()

        # Sets the file interactions
        self.raw = []
        for i in range(self._spectrometers_count):
            self.raw.append(files.raw(format=raw_formats[i]))

#		self.temperature=pt100()
        if self.measurement_type == 'IRAM':
            self.temperature = sensors()

        # Constants
        self._sweep = sweep
        self._freq = freq
        self._freq_step = freq_step
        self._full_file = full_file
        self._sweep_step = sweep_step
        self._repeat = repeat
        self._wait = wait
        self._freq_range = freq_range
        self._basename = basename
        self._formatnames = formatnames
        self._if = float(if_offset)
        self._integration_time = float(integration_time)

        # Counter
        self._i = 0

        #		self._ups = APCUPS()

        self._initialized = False

        self.housekeeping = {
            "Instrument": {},
            "Environment": {
                "Room [K]": 300.,
                "Cold Load [K]": 0.12,
                "Hot Load [K]": 500.,
                "Outdoors [K]": 2345.,
                "Humidity [%]": 1234.0
            }
        }
Esempio n. 4
0
    def __init__(self,
                 sweep=False,
                 freq=214,
                 freq_step=0.2,
                 if_offset=6,
                 sweep_step=10,
                 full_file=10 * 56 * 5 * 4,
                 repeat=True,
                 wait=1,
                 freq_range=(214, 270),
                 wobbler_device="/dev/ttyS0",
                 wobbler_address=b'0',
                 wiltron68169B_address=5,
                 chopper_device="/dev/chopper",
                 antenna_offset=1000,
                 dbr_port=1080,
                 dbr_server="dbr",
                 integration_time=5000,
                 blank_time=5,
                 mode="antenna",
                 basename='../data/',
                 raw_formats=[files.eform],
                 formatnames=['e'],
                 spectrometer_channels=[7504],
                 spectrometers=[rcts104],
                 spectrometer_hosts=['sofia4'],
                 spectrometer_tcp_ports=[1788],
                 spectrometer_udp_ports=[None]):
        """ Initialize the machine

		Parameters:
			sweep (boolean):
				**INFO**
			freq (int):
				Set the frequency of the device
			freq_step (float):
				Set the frequency step 
			if_offset (int):
				**INFO**
			full_file (int):
				Must be a multiple of 4
			repeat (boolean):
				**INFO**
			wait (int):
				**INFO**
			freq_range (tuple):
				Range of frequencies available
			wobbler_device (str):
				wobbler device's path
			wobbler_address (str):
				wobbler's address
			wiltron68169B_address (int):
				wiltron68169B's address
			chopper_device (str):
				chopper device's path
			antenna_offset (int):
				**INFO**
			dbr_port (int):
				Port to connect with the dbr
			dbr_server (str):
				Name of the dbr's server
			integration_time (int):
				**INFO**
			blank_time (int):
				**INFO**
			mode (str):
				**INFO**
			basename (str):
				**INFO**
			raw_formats (list):
				list of format for the files
			formatnames (list):
				list of format name for files
			spectrometer_channels (list):
				list of channels for the spectrometer
			spectrometers (list):
				list of spectrometer
			spectrometer_hosts (list):
				list of host names
			spectrometer_tcp_ports (list):
				list of tcp port
			spectrometer_udp_ports (list):
				list of udp ports
		"""
        assert not (full_file % 4), "Must have full series in file"
        assert wait >= 0.0, "Cannot have negative waiting time"

        # Sets the wobbler interactions
        self.wob = wobbler.wobbler(device=wobbler_device,
                                   address=wobbler_address)

        # Sets the chopper interactions
        self.chop = chopper.chopper(device=chopper_device,
                                    offset=antenna_offset)
        if mode == 'antenna':
            self.order = [
                self.chop.set_cold, self.chop.set_ant, self.chop.set_hot,
                self.chop.set_ant
            ]
        elif mode == 'reference':
            self.order = [
                self.chop.set_cold, self.chop.set_ref, self.chop.set_hot,
                self.chop.set_ref
            ]
        elif mode == 'mixed':
            self.order = [
                self.chop.set_cold, self.chop.set_ant, self.chop.set_ref,
                self.chop.set_hot
            ]
        else:
            raise RuntimeError(("'antenna', 'reference', and 'mixed' are the "
                                "optional modes.  Not " + str(mode) + ", "
                                "which is what you choose"))

        # Sets the spectrometer interactions
        self.spec = []
        for i in range(len(spectrometer_channels)):
            self.spec.append(spectrometers[i](
                integration_time=integration_time,
                data_storage_containers=4,
                channels=spectrometer_channels[i],
                host=spectrometer_hosts[i],
                tcp_port=spectrometer_tcp_ports[i],
                udp_port=spectrometer_udp_ports[i],
                blank_time=blank_time))
        self._spectrometers_count = len(self.spec)
        assert self._spectrometers_count, "Must have at least one spectrometer"

        # Sets the LO interactions
        self.lo = wiltron68169B(address=wiltron68169B_address)

        # Sets the DBR interactions
        self.dbr = dbr(port=dbr_port, server=dbr_server)

        # Sets the file interactions
        self.raw = []
        for i in range(self._spectrometers_count):
            self.raw.append(files.raw(format=raw_formats[i]))

#		self.temperature=pt100()
        self.temperature = sensors()

        # Constants
        self._sweep = sweep
        self._freq = freq
        self._freq_step = freq_step
        self._full_file = full_file
        self._sweep_step = sweep_step
        self._repeat = repeat
        self._wait = wait
        self._freq_range = freq_range
        self._basename = basename
        self._formatnames = formatnames
        self._if = float(if_offset)
        self._integration_time = float(integration_time)

        # Counter
        self._i = 0

        self._initialized = False