Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
marc
dtObsGUI
Commits
7b8aad54
Commit
7b8aad54
authored
Nov 04, 2017
by
marc
Browse files
added createPointings Class to dtObs
parent
4d20f3b9
Changes
4
Hide whitespace changes
Inline
Side-by-side
.pydevproject
View file @
7b8aad54
...
...
@@ -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>
DTObs.py
View file @
7b8aad54
...
...
@@ -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'
)
logg
ing
.
debug
(
'Demo status is: {}'
.
format
(
self
.
demo
))
logg
er
.
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
)
logg
ing
.
info
(
'Selected data file is: {}'
.
format
(
self
.
inputFile
))
logg
er
.
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
):
logg
ing
.
shutdown
()
logg
er
.
shutdown
()
sys
.
exit
(
app
.
exec_
())
def
allCompleted
(
self
):
""" Callback function when all pointings completed """
logg
ing
.
info
(
"All pointings completed"
)
logg
er
.
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
()
logg
ing
.
debug
(
'checkBoxRefraction Setting is {}:'
.
format
(
self
.
checkBoxRefraction
.
isChecked
()))
logg
er
.
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
:
logg
ing
.
info
(
'#{:20}: {:40}'
.
format
(
data
[
0
],
str
(
data
[
1
])))
logg
er
.
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
)
logg
ing
.
info
(
"Output to file: {}"
.
format
(
measFile
))
logg
er
.
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
'''
logg
ing
.
info
(
'Start Measurement'
)
logg
er
.
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
)
logg
ing
.
info
(
"Measurement stopped"
)
logg
er
.
info
(
"Measurement stopped"
)
def
viewResultMeasurement
(
self
):
currentRow
=
self
.
tableWidgetPointings
.
currentRow
()
resultFile
=
self
.
tableWidgetPointings
.
item
(
currentRow
,
3
).
text
()
logg
ing
.
debug
(
'Selected row is: {}'
.
format
(
currentRow
))
logg
ing
.
info
(
'Show result in gnuplot for file: {}'
.
format
(
resultFile
))
logg
er
.
debug
(
'Selected row is: {}'
.
format
(
currentRow
))
logg
er
.
info
(
'Show result in gnuplot for file: {}'
.
format
(
resultFile
))
'''
TODO:
Create a plot file:
...
...
pointings.dat
0 → 100644
View file @
7b8aad54
0 83.09576543345065 21.51446
1 83.633212 21.51446
2 83.633212 22.01446
3 83.09388961896134 22.01446
update.bash
0 → 100755
View file @
7b8aad54
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment