Commit 7b8aad54 authored by marc's avatar marc

added createPointings Class to dtObs

parent 4d20f3b9
......@@ -2,4 +2,7 @@
<?eclipse-pydev version="1.0"?><pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/${PROJECT_DIR_NAME}/createpointings</path>
</pydev_pathproperty>
</pydev_project>
......@@ -12,7 +12,7 @@ import numpy as np
from PyQt5 import QtGui
from PyQt5.QtCore import QRunnable, QObject, pyqtSignal, pyqtSlot, QThreadPool
from PyQt5.QtWidgets import (QFileDialog, QApplication, QMainWindow, QTableWidgetItem)
from PyQt5.QtWidgets import (QFileDialog, QApplication, QMainWindow, QTableWidgetItem, QWidget)
from ui.dtobswindow import Ui_mainWindow
from astropy import units as u
......@@ -22,7 +22,7 @@ from telescope import telescope
from measurements import Measurements
from metadata import MetaData
from backend import Backend
from createpointings import CreatePointings
'''
Setup config ini
'''
......@@ -89,7 +89,7 @@ class DTObservationProgram(Ui_mainWindow):
def __init__(self, mainWindow):
logger.info('Initialization of DTObsGUI')
self.demo = config.getboolean('TestConfig','demo')
logging.debug('Demo status is: {}'.format(self.demo))
logger.debug('Demo status is: {}'.format(self.demo))
if self.demo == False:
self.myDT = telescope(setmode='J2000', consoleHost='consoledemo.dmz.camras.nl')
self.telescopeMode = 'J2000'
......@@ -139,8 +139,10 @@ class DTObservationProgram(Ui_mainWindow):
self.threadpool = QThreadPool()
def newPointingsDialog(self):
pass
self.formCreatePointings = QWidget()
self.myForm = CreatePointings(self.formCreatePointings)
self.formCreatePointings.show()
def openFileNameDialog(self):
'''
Clear tableWidget and read pointings from file
......@@ -148,7 +150,7 @@ class DTObservationProgram(Ui_mainWindow):
self.inputFile,_ = QFileDialog.getOpenFileName(None, 'Open File', "templates","Pointing Files (*.pnt);;All Files (*)")
if self.inputFile:
self.loadPointingsInTable(self.inputFile)
logging.info('Selected data file is: {}'.format(self.inputFile))
logger.info('Selected data file is: {}'.format(self.inputFile))
def loadPointingsInTable(self,fileName):
reader = csv.reader(open(self.inputFile),delimiter='\t')
......@@ -181,12 +183,12 @@ class DTObservationProgram(Ui_mainWindow):
self.tableWidgetPointings.removeRow(rowPosition)
def quitDTObs(self):
logging.shutdown()
logger.shutdown()
sys.exit(app.exec_())
def allCompleted(self):
""" Callback function when all pointings completed """
logging.info("All pointings completed")
logger.info("All pointings completed")
def measCompleted(self, meas_num, status):
""" Make the meas_num-th row of the table green """
......@@ -259,7 +261,7 @@ class DTObservationProgram(Ui_mainWindow):
TODO: read radec Actual from telescope class
'''
self.myMetaData.refractionEnabled = self.checkBoxRefraction.isChecked()
logging.debug('checkBoxRefraction Setting is {}:'.format(self.checkBoxRefraction.isChecked()))
logger.debug('checkBoxRefraction Setting is {}:'.format(self.checkBoxRefraction.isChecked()))
self.myMetaData.DTModelEnabled = self.checkBoxDTModel.isChecked()
self.myMetaData.mode = self.GUIbackendMode
self.myMetaData.LSREnabled = self.radioButtonLSR.isChecked()
......@@ -267,7 +269,7 @@ class DTObservationProgram(Ui_mainWindow):
def writeMetaData(self,file):
myMetaData = self.myMetaData.getMetaData()
for data in myMetaData:
logging.info('#{:20}: {:40}'.format(data[0],str(data[1])))
logger.info('#{:20}: {:40}'.format(data[0],str(data[1])))
file.write('#{:20}: {:40}\n'.format(data[0],str(data[1])))
def doMeasurement(self, measnum, progressSignal=None):
......@@ -289,7 +291,7 @@ class DTObservationProgram(Ui_mainWindow):
self.setMetaData()
self.writeMetaData(measFile)
logging.info("Output to file: {}".format(measFile))
logger.info("Output to file: {}".format(measFile))
self.myMeas.startMeasurement(self.measProgramme, self.centralFrequency, self.integrationTime, measFile)
......@@ -317,7 +319,7 @@ class DTObservationProgram(Ui_mainWindow):
'''
Put backend in proper mode
'''
logging.info('Start Measurement')
logger.info('Start Measurement')
self.readGUIBackendMode()
self.myBackend.setMode(self.GUIbackendMode)
......@@ -339,13 +341,13 @@ class DTObservationProgram(Ui_mainWindow):
def stopMeasurement(self):
worker.signals.allfinished.connect(self.allCompleted)
logging.info("Measurement stopped")
logger.info("Measurement stopped")
def viewResultMeasurement(self):
currentRow = self.tableWidgetPointings.currentRow()
resultFile = self.tableWidgetPointings.item(currentRow,3).text()
logging.debug('Selected row is: {}'.format(currentRow))
logging.info('Show result in gnuplot for file: {}'.format(resultFile))
logger.debug('Selected row is: {}'.format(currentRow))
logger.info('Show result in gnuplot for file: {}'.format(resultFile))
'''
TODO:
Create a plot file:
......
0 83.09576543345065 21.51446
1 83.633212 21.51446
2 83.633212 22.01446
3 83.09388961896134 22.01446
cd ~/git/backend
git pull
cd ~/git/createpointings
git pull
cd ~/git/dtObsGUI
git pull
cd ~/git/metadata
git pull
cd ~/git/telescope
git pull
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment