a2p2 0.7.1__tar.gz → 0.7.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {a2p2-0.7.1/a2p2.egg-info → a2p2-0.7.3}/PKG-INFO +4 -1
- {a2p2-0.7.1 → a2p2-0.7.3}/README.rst +3 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/__main__.py +39 -0
- a2p2-0.7.3/a2p2/chara/facility.py +83 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/client.py +16 -3
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/version.py +30 -13
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/gravity.py +3 -7
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/gui.py +2 -2
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/instrument.py +6 -1
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/matisse.py +1 -10
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/pionier.py +2 -9
- {a2p2-0.7.1 → a2p2-0.7.3/a2p2.egg-info}/PKG-INFO +4 -1
- a2p2-0.7.1/a2p2/chara/facility.py +0 -63
- {a2p2-0.7.1 → a2p2-0.7.3}/LICENSE +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/MANIFEST.in +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/__init__.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/chara/__init__.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/chara/gui.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/facility.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/gui.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/instrument.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/jmmc/__init__.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/jmmc/catalogs.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/jmmc/generated_models.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/jmmc/models.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/jmmc/services.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/jmmc/utils.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/jmmc/webservices.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/ob.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/samp.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/utils.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/__init__.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/conf/GRAVITY_ditTable.json +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/conf/GRAVITY_rangeTable.json +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/conf/MATISSE_ditTable.json +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/conf/MATISSE_rangeTable.json +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/conf/PIONIER_ditTable.json +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/conf/PIONIER_rangeTable.json +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2/vlti/facility.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2.egg-info/SOURCES.txt +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2.egg-info/dependency_links.txt +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2.egg-info/entry_points.txt +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2.egg-info/requires.txt +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/a2p2.egg-info/top_level.txt +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/setup.cfg +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/setup.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/test/test_jmmc_catalog.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/test/test_jmmc_models.py +0 -0
- {a2p2-0.7.1 → a2p2-0.7.3}/test/test_test.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: a2p2
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.3
|
4
4
|
Summary: UNKNOWN
|
5
5
|
Home-page: http://www.jmmc.fr/a2p2
|
6
6
|
Author: JMMC Tech Group
|
@@ -80,6 +80,9 @@ Each facilities get it's own code directory to manage specific GUI and specific
|
|
80
80
|
|
81
81
|
Please fill an issue_ for any question, remark or enhancement request.
|
82
82
|
|
83
|
+
Release notes
|
84
|
+
-------------
|
85
|
+
`Check file <release-notes.md>`_
|
83
86
|
|
84
87
|
License
|
85
88
|
-------
|
@@ -2,7 +2,40 @@
|
|
2
2
|
from __future__ import with_statement
|
3
3
|
|
4
4
|
import traceback
|
5
|
+
|
5
6
|
from argparse import ArgumentParser
|
7
|
+
from a2p2 import __release_notes__
|
8
|
+
from distutils.version import LooseVersion
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
def createMdReleaseNotes():
|
13
|
+
"""
|
14
|
+
Present in a reverse ordered way the dictionnary version items.
|
15
|
+
"""
|
16
|
+
txt = "# A2P2 release notes"
|
17
|
+
lvs = [LooseVersion(v) for v in __release_notes__]
|
18
|
+
for lv in sorted(lvs, reverse=True):
|
19
|
+
v=lv.vstring
|
20
|
+
txt += "\n## V " + v + " :"
|
21
|
+
keys = []
|
22
|
+
for k in sorted(__release_notes__[v]):
|
23
|
+
if not ("TODO" in k):
|
24
|
+
keys.append(k)
|
25
|
+
for k in sorted(__release_notes__[v]):
|
26
|
+
if "TODO" in k:
|
27
|
+
keys.append(k)
|
28
|
+
|
29
|
+
for e in keys:
|
30
|
+
infos = __release_notes__[v][e]
|
31
|
+
if infos:
|
32
|
+
txt += "\n### " + e + " : "
|
33
|
+
for i in infos:
|
34
|
+
txt += "\n- " + i
|
35
|
+
txt += "\n\n"
|
36
|
+
f=open("release-notes.md", "w")
|
37
|
+
f.write(txt)
|
38
|
+
print(f"{f.name} generated")
|
6
39
|
|
7
40
|
|
8
41
|
def main():
|
@@ -14,15 +47,21 @@ def main():
|
|
14
47
|
help='fake API to avoid remote connection (dev. only).')
|
15
48
|
parser.add_argument('-v', '--verbose', action='store_true', help='Verbose')
|
16
49
|
parser.add_argument('-c', '--createprefs', action='store_true', help='Create preferences file')
|
50
|
+
parser.add_argument('-r', '--releasenotes', action='store_true', help='Create md release notes file')
|
17
51
|
|
18
52
|
args = parser.parse_args()
|
19
53
|
|
20
54
|
from . import A2p2Client
|
21
55
|
|
56
|
+
if args.releasenotes:
|
57
|
+
createMdReleaseNotes()
|
58
|
+
exit()
|
59
|
+
|
22
60
|
if args.createprefs:
|
23
61
|
A2p2Client.createPreferencesFile()
|
24
62
|
exit()
|
25
63
|
|
64
|
+
|
26
65
|
try:
|
27
66
|
with A2p2Client(args.fakeapi, args.verbose) as a2p2c:
|
28
67
|
# if args.config:
|
@@ -0,0 +1,83 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
|
3
|
+
__all__ = []
|
4
|
+
|
5
|
+
from a2p2.chara.gui import CharaUI
|
6
|
+
from a2p2.facility import Facility
|
7
|
+
import requests
|
8
|
+
import logging
|
9
|
+
import traceback
|
10
|
+
|
11
|
+
HELPTEXT = "TODO update this HELP message in a2p2/chara/facility.py"
|
12
|
+
|
13
|
+
logger = logging.getLogger(__name__)
|
14
|
+
|
15
|
+
class CharaFacility(Facility):
|
16
|
+
|
17
|
+
def __init__(self, a2p2client):
|
18
|
+
Facility.__init__(self, a2p2client, "CHARA", HELPTEXT)
|
19
|
+
self.charaUI = CharaUI(self)
|
20
|
+
self.connected2OB2 = False
|
21
|
+
self.validQueueServer = None
|
22
|
+
|
23
|
+
def processOB(self, ob):
|
24
|
+
if not ob:
|
25
|
+
return
|
26
|
+
|
27
|
+
self.a2p2client.ui.addToLog(
|
28
|
+
"OB received for '" + self.facilityName + "' interferometer")
|
29
|
+
# show ob dict for debug
|
30
|
+
self.a2p2client.ui.addToLog(str(ob), False)
|
31
|
+
|
32
|
+
# performs operation
|
33
|
+
self.consumeOB(ob)
|
34
|
+
|
35
|
+
# give focus on last updated UI
|
36
|
+
self.a2p2client.ui.showFacilityUI(self.charaUI)
|
37
|
+
|
38
|
+
def checkServer(self):
|
39
|
+
if self.validQueueServer:
|
40
|
+
# recheck ?
|
41
|
+
return True
|
42
|
+
else:
|
43
|
+
# search and test servers from preferences
|
44
|
+
queueServers=self.a2p2client.preferences.getCharaQueueServer()
|
45
|
+
msg=""
|
46
|
+
if queueServers :
|
47
|
+
for queueServer in queueServers:
|
48
|
+
logger.debug(f'Trying to send OB on queuserver : {queueServer}')
|
49
|
+
try:
|
50
|
+
c=requests.get(queueServer, timeout=3)
|
51
|
+
msg+=f"Connection succeeded on OB server : {c.json()}\n"
|
52
|
+
self.validQueueServer = queueServer
|
53
|
+
break
|
54
|
+
except:
|
55
|
+
msg+=f"Connection failed on {queueServer}\n"
|
56
|
+
|
57
|
+
self.a2p2client.ui.addToLog(msg)
|
58
|
+
self.charaUI.display(msg)
|
59
|
+
|
60
|
+
return self.validQueueServer
|
61
|
+
|
62
|
+
def consumeOB(self, ob):
|
63
|
+
if self.checkServer():
|
64
|
+
try:
|
65
|
+
r = requests.post(self.validQueueServer, json=ob.as_dict(), timeout=3)
|
66
|
+
msg = ""
|
67
|
+
msg+=f"OB sent to remote server queue : {r}"
|
68
|
+
self.connected2OB2 = True
|
69
|
+
self.a2p2client.ui.addToLog(msg)
|
70
|
+
self.charaUI.display(msg)
|
71
|
+
except:
|
72
|
+
print(traceback.format_exc())
|
73
|
+
msg=f"Can't send OB to the '{self.validQueueServer}' queue server, please relaunch it or try again for a new one."
|
74
|
+
self.validQueueServer = None
|
75
|
+
self.a2p2client.ui.addToLog(msg)
|
76
|
+
self.charaUI.display(msg)
|
77
|
+
else:
|
78
|
+
msg=f"Can't find any queue server, please launch it, edit your preferences or check your ssh port forwarding"
|
79
|
+
|
80
|
+
# display OB
|
81
|
+
self.charaUI.displayOB(ob)
|
82
|
+
|
83
|
+
|
@@ -59,7 +59,9 @@ class A2p2Client():
|
|
59
59
|
self.facilityManager = FacilityManager(self)
|
60
60
|
|
61
61
|
if self.preferences.exists():
|
62
|
-
|
62
|
+
A2P2ClientPreferences.updatePreferencesFile()
|
63
|
+
self.ui.addToLog(
|
64
|
+
f"Using preference from '{A2P2ClientPreferences.getPreferencesFileName()}'.\n")
|
63
65
|
else:
|
64
66
|
self.ui.addToLog(
|
65
67
|
"No preference file found, please create one so your data persists (launch program with -c option).\n")
|
@@ -236,6 +238,15 @@ class A2P2ClientPreferences():
|
|
236
238
|
preferences_file = os.path.join(user_config_dir(
|
237
239
|
A2P2ClientPreferences.appname), "prefs.ini")
|
238
240
|
return preferences_file
|
241
|
+
def updatePreferencesFile():
|
242
|
+
return
|
243
|
+
# TODO
|
244
|
+
# we suppose the file exists
|
245
|
+
filename = A2P2ClientPreferences.getPreferencesFileName()
|
246
|
+
buffer=""
|
247
|
+
for line in open(filename):
|
248
|
+
buffer+=line+"\n"
|
249
|
+
print (buffer)
|
239
250
|
|
240
251
|
def createPreferencesFile():
|
241
252
|
filename = A2P2ClientPreferences.getPreferencesFileName()
|
@@ -270,7 +281,7 @@ class A2P2ClientPreferences():
|
|
270
281
|
s['# CHARA SECTION'] = ""
|
271
282
|
s['# = > please uncomment and update next properties to make it active <'] = ""
|
272
283
|
s['# = > queueserver may be uncommented to forward OB to a remote server instead <'] = ""
|
273
|
-
s['#queueserver'] =
|
284
|
+
s['#queueserver'] = 'http://192.168.3.153:2468/test,http://localhost:2468/test'
|
274
285
|
|
275
286
|
config['p2'] = {}
|
276
287
|
s=config['p2']
|
@@ -329,7 +340,9 @@ class A2P2ClientPreferences():
|
|
329
340
|
|
330
341
|
# Retrieve CHARA prefs
|
331
342
|
def getCharaQueueServer(self):
|
332
|
-
|
343
|
+
s = self.getConfig("chara", "queueserver", None)
|
344
|
+
if s:
|
345
|
+
return s.split(",")
|
333
346
|
|
334
347
|
|
335
348
|
# Retrieve P2 prefs
|
@@ -1,4 +1,4 @@
|
|
1
|
-
__version__ = "0.7.
|
1
|
+
__version__ = "0.7.3"
|
2
2
|
|
3
3
|
__release_notes__ = {
|
4
4
|
# "0.1.6": {
|
@@ -21,19 +21,9 @@ __release_notes__ = {
|
|
21
21
|
#
|
22
22
|
# ],
|
23
23
|
# },
|
24
|
-
"0.7.
|
25
|
-
"STATUS": [
|
26
|
-
],
|
27
|
-
"A2P2": [
|
28
|
-
"Fix ttk import on MacOS",
|
29
|
-
],
|
30
|
-
"VLTI": [
|
31
|
-
"Add first P112 support using radiobutton to select proper onaxis offaxis or wide GRAVITY templates",
|
32
|
-
"Improve coordinate's checks and computations",
|
33
|
-
"Add FT's propermotions and parallax"
|
34
|
-
],
|
24
|
+
"0.7.3": {
|
35
25
|
"CHARA": [
|
36
|
-
"
|
26
|
+
"Better reuse of last working queueserver"
|
37
27
|
],
|
38
28
|
"TODO-SCIENCE": [
|
39
29
|
"Merge AO or GS in a same code section for every instruments",
|
@@ -47,6 +37,33 @@ __release_notes__ = {
|
|
47
37
|
"Complete test suite with more real p2 submissions",
|
48
38
|
"Try to read OB in P2 and send them back to Aspro2 as a new obs",
|
49
39
|
],
|
40
|
+
},"0.7.2": {
|
41
|
+
"STATUS": [
|
42
|
+
],
|
43
|
+
"A2P2": [
|
44
|
+
"Auto update chara queueserver preference",
|
45
|
+
"a2p2 -r generates release-notes.md (rendered on a2p2 repository)"
|
46
|
+
],
|
47
|
+
"VLTI": [
|
48
|
+
"Bugfix to support missin preference file"
|
49
|
+
],
|
50
|
+
"CHARA": [
|
51
|
+
"Support and try every queueserver's Urls comma separated from the queuserver user preference"
|
52
|
+
],
|
53
|
+
},"0.7.1": {
|
54
|
+
"STATUS": [
|
55
|
+
],
|
56
|
+
"A2P2": [
|
57
|
+
"Fix ttk import on MacOS",
|
58
|
+
],
|
59
|
+
"VLTI": [
|
60
|
+
"Add first P112 support using radiobutton to select proper onaxis offaxis or wide GRAVITY templates",
|
61
|
+
"Improve coordinate's checks and computations",
|
62
|
+
"Add FT's propermotions and parallax"
|
63
|
+
],
|
64
|
+
"CHARA": [
|
65
|
+
"Display log of received OB also for calibrators"
|
66
|
+
]
|
50
67
|
},"0.6.9": {
|
51
68
|
"STATUS": [
|
52
69
|
],
|
@@ -73,7 +73,6 @@ class Gravity(VltiInstrument):
|
|
73
73
|
obsTSF = TSF(self, self.getGravityObsTemplateName(
|
74
74
|
ob, OBJTYPE, dualField))
|
75
75
|
|
76
|
-
obTarget = OBTarget()
|
77
76
|
obConstraints = OBConstraints(self)
|
78
77
|
|
79
78
|
# Check SPEC_RES from instrumentMode and set SPEC_POL except for single_offaxis ( missing keyword INS_SPEC_RES)
|
@@ -93,13 +92,10 @@ class Gravity(VltiInstrument):
|
|
93
92
|
|
94
93
|
scienceTarget = observationConfiguration.SCTarget
|
95
94
|
|
95
|
+
obTarget = OBTarget(self, scienceTarget)
|
96
|
+
|
96
97
|
# define target
|
97
|
-
acqTSF.SEQ_INS_SOBJ_NAME =
|
98
|
-
' ', '_') # allowed characters: letters, digits, + - _ . and no spaces
|
99
|
-
obTarget.name = acqTSF.SEQ_INS_SOBJ_NAME
|
100
|
-
obTarget.ra, obTarget.dec = self.getCoords(scienceTarget)
|
101
|
-
obTarget.properMotionRa, obTarget.properMotionDec = self.getPMCoords(
|
102
|
-
scienceTarget)
|
98
|
+
acqTSF.SEQ_INS_SOBJ_NAME = obTarget.name
|
103
99
|
|
104
100
|
# Set baseline interferometric array code (should be a keywordlist)
|
105
101
|
acqTSF.ISS_BASELINE = [self.getBaselineCode(ob)]
|
@@ -229,8 +229,8 @@ class TreeFrame(Frame):
|
|
229
229
|
for isvt in self.vltiUI.facility.getIssVltiTypes():
|
230
230
|
boolv = BooleanVar()
|
231
231
|
self.issVltiTypeCheckboxesVars[isvt]=boolv
|
232
|
-
boolv.set(
|
233
|
-
logger.debug(f"Set
|
232
|
+
boolv.set( not pvltitypes or len(pvltitypes)==0 or isvt in pvltitypes )
|
233
|
+
logger.debug(f"Set preference value for {isvt} : {boolv.get()}")
|
234
234
|
cb = Checkbutton(buttonframe, text=isvt, variable=boolv, onvalue=True, offvalue=False)
|
235
235
|
cb.grid(row=0, column=cindex)
|
236
236
|
cindex += 1
|
@@ -700,9 +700,14 @@ class FixedDict(object):
|
|
700
700
|
|
701
701
|
class OBTarget(FixedDict):
|
702
702
|
|
703
|
-
def __init__(self):
|
703
|
+
def __init__(self, instrument, scienceTarget):
|
704
704
|
FixedDict.__init__(
|
705
705
|
self, ('name', 'ra', 'dec', 'properMotionRa', 'properMotionDec'))
|
706
|
+
# Target name can include any alphanumeric character, and space, dot, plus or minus signs [a-z][A-Z][0-9][.+- ]
|
707
|
+
# ( https://www.eso.org/sci/observing/phase2/p2intro/p2-tutorials/p2-ImportTargetList.html )
|
708
|
+
self.name = re.sub(r'[^a-zA-Z0-9.\+\- ]+','',scienceTarget.name.strip())
|
709
|
+
self.ra, self.dec = instrument.getCoords(scienceTarget)
|
710
|
+
self.properMotionRa, self.properMotionDec = instrument.getPMCoords(scienceTarget)
|
706
711
|
|
707
712
|
|
708
713
|
class OBConstraints(TSF):
|
@@ -48,7 +48,6 @@ class Matisse(VltiInstrument):
|
|
48
48
|
acqTSF = TSF(self, f"MATISSE_img_acq{tsfSuffix}.tsf") # or .tsfx?
|
49
49
|
obsTSF = TSF(self, f"MATISSE_hyb_obs{tsfSuffix}.tsf")
|
50
50
|
|
51
|
-
obTarget = OBTarget()
|
52
51
|
obConstraints = OBConstraints(self)
|
53
52
|
|
54
53
|
if 'SCIENCE' in observationConfiguration.type:
|
@@ -57,15 +56,7 @@ class Matisse(VltiInstrument):
|
|
57
56
|
obsTSF.DPR_CATG = 'CALIB'
|
58
57
|
|
59
58
|
scienceTarget = observationConfiguration.SCTarget
|
60
|
-
|
61
|
-
# define target
|
62
|
-
|
63
|
-
obTarget.name = scienceTarget.name.replace(' ',
|
64
|
-
'_') # allowed characters: letters, digits, + - _ . and no spaces
|
65
|
-
# allowed characters: letters, digits, + - _ . and no spaces
|
66
|
-
obTarget.ra, obTarget.dec = self.getCoords(scienceTarget)
|
67
|
-
obTarget.properMotionRa, obTarget.properMotionDec = self.getPMCoords(
|
68
|
-
scienceTarget)
|
59
|
+
obTarget = OBTarget(self, scienceTarget)
|
69
60
|
|
70
61
|
# Set baseline interferometric array code (should be a keywordlist)
|
71
62
|
acqTSF.ISS_BASELINE = [self.getBaselineCode(ob)]
|
@@ -48,7 +48,7 @@ class Pionier(VltiInstrument):
|
|
48
48
|
kappaTSF = TSF(self, "PIONIER_gen_cal_kappa.tsf")
|
49
49
|
darkTSF = TSF(self, "PIONIER_gen_cal_dark.tsf")
|
50
50
|
|
51
|
-
|
51
|
+
|
52
52
|
obConstraints = OBConstraints(self)
|
53
53
|
|
54
54
|
# set common properties
|
@@ -63,14 +63,7 @@ class Pionier(VltiInstrument):
|
|
63
63
|
|
64
64
|
scienceTarget = observationConfiguration.SCTarget
|
65
65
|
|
66
|
-
|
67
|
-
# acqTSF.SEQ_INS_SOBJ_NAME = scienceTarget.name.strip()
|
68
|
-
|
69
|
-
obTarget.name = scienceTarget.name.strip().replace(
|
70
|
-
' ', '_') # allowed characters: letters, digits, + - _ . and no spaces
|
71
|
-
obTarget.ra, obTarget.dec = self.getCoords(scienceTarget)
|
72
|
-
obTarget.properMotionRa, obTarget.properMotionDec = self.getPMCoords(
|
73
|
-
scienceTarget)
|
66
|
+
obTarget = OBTarget(self, scienceTarget)
|
74
67
|
|
75
68
|
# Set baseline interferometric array code (should be a keywordlist)
|
76
69
|
acqTSF.ISS_BASELINE = [self.getBaselineCode(ob)]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: a2p2
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.3
|
4
4
|
Summary: UNKNOWN
|
5
5
|
Home-page: http://www.jmmc.fr/a2p2
|
6
6
|
Author: JMMC Tech Group
|
@@ -80,6 +80,9 @@ Each facilities get it's own code directory to manage specific GUI and specific
|
|
80
80
|
|
81
81
|
Please fill an issue_ for any question, remark or enhancement request.
|
82
82
|
|
83
|
+
Release notes
|
84
|
+
-------------
|
85
|
+
`Check file <release-notes.md>`_
|
83
86
|
|
84
87
|
License
|
85
88
|
-------
|
@@ -1,63 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
|
3
|
-
__all__ = []
|
4
|
-
|
5
|
-
from a2p2.chara.gui import CharaUI
|
6
|
-
from a2p2.facility import Facility
|
7
|
-
import requests
|
8
|
-
import logging
|
9
|
-
import traceback
|
10
|
-
|
11
|
-
HELPTEXT = "TODO update this HELP message in a2p2/chara/facility.py"
|
12
|
-
|
13
|
-
logger = logging.getLogger(__name__)
|
14
|
-
|
15
|
-
class CharaFacility(Facility):
|
16
|
-
|
17
|
-
def __init__(self, a2p2client):
|
18
|
-
Facility.__init__(self, a2p2client, "CHARA", HELPTEXT)
|
19
|
-
self.charaUI = CharaUI(self)
|
20
|
-
self.connected2OB2 = False
|
21
|
-
|
22
|
-
def processOB(self, ob):
|
23
|
-
if not ob:
|
24
|
-
return
|
25
|
-
|
26
|
-
self.a2p2client.ui.addToLog(
|
27
|
-
"OB received for '" + self.facilityName + "' interferometer")
|
28
|
-
# show ob dict for debug
|
29
|
-
self.a2p2client.ui.addToLog(str(ob), False)
|
30
|
-
|
31
|
-
# performs operation
|
32
|
-
self.consumeOB(ob)
|
33
|
-
|
34
|
-
# give focus on last updated UI
|
35
|
-
self.a2p2client.ui.showFacilityUI(self.charaUI)
|
36
|
-
|
37
|
-
def consumeOB(self, ob):
|
38
|
-
# forward message if a server is present in the preferences
|
39
|
-
charaServer=self.a2p2client.preferences.getCharaQueueServer()
|
40
|
-
if charaServer :
|
41
|
-
try:
|
42
|
-
r = requests.post(charaServer, json=ob.as_dict())
|
43
|
-
msg = ""
|
44
|
-
if not self.connected2OB2:
|
45
|
-
try:
|
46
|
-
c=requests.get(charaServer)
|
47
|
-
msg += f"Connection succeeded on OB2 server : {c.json()}\n"
|
48
|
-
except:
|
49
|
-
msg += f"Connection succeded on a non identified OB2 server\n"
|
50
|
-
msg+=f"OB sent to remote server queue : {r}"
|
51
|
-
self.connected2OB2 = True
|
52
|
-
except:
|
53
|
-
print(traceback.format_exc())
|
54
|
-
msg=f"Can't send OB to the queue server, please launch it or check your ssh port forwarding ( {charaServer} )"
|
55
|
-
self.connected2OB2 = False
|
56
|
-
|
57
|
-
self.a2p2client.ui.addToLog(msg)
|
58
|
-
self.charaUI.display(msg)
|
59
|
-
|
60
|
-
# display OB
|
61
|
-
self.charaUI.displayOB(ob)
|
62
|
-
|
63
|
-
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|