a2p2 0.2.14__py3-none-any.whl → 0.7.4__py3-none-any.whl

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.
Files changed (47) hide show
  1. a2p2/__main__.py +40 -1
  2. a2p2/chara/facility.py +54 -4
  3. a2p2/chara/gui.py +31 -5
  4. a2p2/client.py +158 -31
  5. a2p2/facility.py +14 -1
  6. a2p2/gui.py +46 -12
  7. a2p2/instrument.py +3 -0
  8. a2p2/jmmc/__init__.py +7 -0
  9. a2p2/jmmc/catalogs.py +129 -0
  10. a2p2/jmmc/generated_models.py +191 -0
  11. a2p2/jmmc/models.py +104 -0
  12. a2p2/jmmc/services.py +16 -0
  13. a2p2/jmmc/utils.py +130 -0
  14. a2p2/jmmc/webservices.py +48 -0
  15. a2p2/ob.py +98 -9
  16. a2p2/samp.py +20 -0
  17. a2p2/version.py +210 -131
  18. a2p2/vlti/conf/GRAVITY_ditTable.json +21 -19
  19. a2p2/vlti/conf/GRAVITY_rangeTable.json +200 -28
  20. a2p2/vlti/conf/MATISSE_rangeTable.json +58 -22
  21. a2p2/vlti/conf/PIONIER_ditTable.json +1 -1
  22. a2p2/vlti/conf/PIONIER_rangeTable.json +16 -18
  23. a2p2/vlti/facility.py +160 -43
  24. a2p2/vlti/gravity.py +243 -311
  25. a2p2/vlti/gui.py +165 -39
  26. a2p2/vlti/instrument.py +266 -49
  27. a2p2/vlti/matisse.py +61 -147
  28. a2p2/vlti/pionier.py +34 -157
  29. {a2p2-0.2.14.dist-info → a2p2-0.7.4.dist-info}/METADATA +34 -20
  30. a2p2-0.7.4.dist-info/RECORD +39 -0
  31. {a2p2-0.2.14.dist-info → a2p2-0.7.4.dist-info}/WHEEL +1 -1
  32. {a2p2-0.2.14.dist-info → a2p2-0.7.4.dist-info}/entry_points.txt +0 -1
  33. a2p2/vlti/confP104/GRAVITY_ditTable.json +0 -122
  34. a2p2/vlti/confP104/GRAVITY_rangeTable.json +0 -202
  35. a2p2/vlti/confP104/MATISSE_ditTable.json +0 -2
  36. a2p2/vlti/confP104/MATISSE_rangeTable.json +0 -202
  37. a2p2/vlti/confP104/PIONIER_ditTable.json +0 -77
  38. a2p2/vlti/confP104/PIONIER_rangeTable.json +0 -118
  39. a2p2/vlti/confP105/GRAVITY_ditTable.json +0 -37
  40. a2p2/vlti/confP105/GRAVITY_rangeTable.json +0 -42
  41. a2p2/vlti/confP105/MATISSE_ditTable.json +0 -2
  42. a2p2/vlti/confP105/MATISSE_rangeTable.json +0 -44
  43. a2p2/vlti/confP105/PIONIER_ditTable.json +0 -25
  44. a2p2/vlti/confP105/PIONIER_rangeTable.json +0 -38
  45. a2p2-0.2.14.dist-info/RECORD +0 -44
  46. {a2p2-0.2.14.dist-info → a2p2-0.7.4.dist-info}/LICENSE +0 -0
  47. {a2p2-0.2.14.dist-info → a2p2-0.7.4.dist-info}/top_level.txt +0 -0
a2p2/vlti/matisse.py CHANGED
@@ -8,6 +8,7 @@ from a2p2.vlti.instrument import OBConstraints
8
8
  from a2p2.vlti.instrument import OBTarget
9
9
  from a2p2.vlti.instrument import TSF
10
10
  from a2p2.vlti.instrument import VltiInstrument
11
+ import logging
11
12
 
12
13
  HELPTEXT = """
13
14
  Please define MATISSE instrument help in a2p2/vlti/matisse.py
@@ -33,68 +34,89 @@ class Matisse(VltiInstrument):
33
34
  tel = "AT"
34
35
 
35
36
  instrumentMode = instrumentConfiguration.instrumentMode
37
+ fringeTrackerMode = "GRA4MAT" in instrumentConfiguration.fringeTrackerMode
38
+ if fringeTrackerMode:
39
+ tsfSuffix = "_ft"
40
+ ui.addToLog("OB requested with GRA4MAT")
41
+ else:
42
+ tsfSuffix = ""
43
+ ui.addToLog("OB requested without GRA4MAT")
36
44
 
37
- for observationConfiguration in ob.observationConfiguration:
45
+ for observationConfiguration in self.getSequence(ob):
38
46
 
39
47
  # create keywords storage objects
40
- acqTSF = TSF(self, "MATISSE_img_acq.tsf") # or .tsfx?
41
- obsTSF = TSF(self, "MATISSE_hyb_obs.tsf")
48
+ acqTSF = TSF(self, f"MATISSE_img_acq{tsfSuffix}.tsf") # or .tsfx?
49
+ obsTSF = TSF(self, f"MATISSE_hyb_obs{tsfSuffix}.tsf")
42
50
 
43
- obTarget = OBTarget()
44
51
  obConstraints = OBConstraints(self)
45
52
 
46
53
  if 'SCIENCE' in observationConfiguration.type:
47
- OBJTYPE = 'SCIENCE'
54
+ obsTSF.DPR_CATG = 'SCIENCE' # Default OB are CALIB
48
55
  else:
49
- OBJTYPE = 'CALIBRATOR'
56
+ obsTSF.DPR_CATG = 'CALIB'
50
57
 
51
58
  scienceTarget = observationConfiguration.SCTarget
52
-
53
- # define target
54
-
55
- obTarget.name = scienceTarget.name.replace(' ',
56
- '_') # allowed characters: letters, digits, + - _ . and no spaces
57
- # allowed characters: letters, digits, + - _ . and no spaces
58
- obTarget.ra, obTarget.dec = self.getCoords(scienceTarget)
59
- obTarget.properMotionRa, obTarget.properMotionDec = self.getPMCoords(
60
- scienceTarget)
59
+ obTarget = OBTarget(self, scienceTarget)
61
60
 
62
61
  # Set baseline interferometric array code (should be a keywordlist)
63
- acqTSF.ISS_BASELINE = [self.getBaselineCode(BASELINE)]
62
+ acqTSF.ISS_BASELINE = [self.getBaselineCode(ob)]
63
+
64
+ self.checkIssVltiType(acqTSF)
64
65
 
65
66
  # define some default values
66
67
  VIS = 1.0 # FIXME
67
68
 
68
69
  # Retrieve Fluxes
69
- COU_GS_MAG = self.getFlux(scienceTarget, "V")
70
-
71
- # setup some default values, to be changed below
72
- COU_AG_GSSOURCE = 'SCIENCE' # by default
73
- GSRA = '00:00:00.000'
74
- GSDEC = '00:00:00.000'
75
- dualField = False
76
-
77
- # initialize FT variables (must exist)
78
- # TODO remove next lines using a dual_acq TSF that would handle
79
- # them
80
-
70
+ acqTSF.SEQ_TARG_FLUX_L = self.getFlux(scienceTarget, "L_JY")
71
+ acqTSF.SEQ_TARG_FLUX_N = self.getFlux(scienceTarget, "N_JY")
72
+ acqTSF.SEQ_TARG_MAG_K = self.getFlux(scienceTarget, "K")
73
+ # H is only present in _ft template
74
+ if fringeTrackerMode:
75
+ try:
76
+ acqTSF.SEQ_TARG_MAG_H = self.getFlux(scienceTarget, "H")
77
+ except:
78
+ ui.addToLog("H mag is missing. default value will be used",
79
+ displayString=True, level=logging.WARNING)
80
+
81
+ # TODO : make AO & GS more consistent ( on Aspro2 side ? )
81
82
  # AO target
82
83
  aoTarget = ob.get(observationConfiguration, "AOTarget")
83
84
  if aoTarget != None:
84
- AONAME = aoTarget.name
85
- COU_AG_GSSOURCE = 'SETUPFILE' # since we have an AO
85
+ acqTSF.COU_AG_GSSOURCE = 'SETUPFILE' # since we have an AO
86
86
  # TODO check if AO coords should be required by template
87
87
  # AORA, AODEC = self.getCoords(aoTarget,
88
88
  # requirePrecision=False)
89
- acqTSF.COU_PMA, acqTSF.COU_PMD = self.getPMCoords(aoTarget)
89
+ acqTSF.COU_AG_PMA, acqTSF.COU_AG_PMD = self.getPMCoords(
90
+ aoTarget)
90
91
 
91
92
  # Guide Star
92
93
  gsTarget = ob.get(observationConfiguration, 'GSTarget')
93
94
  if gsTarget != None:
94
- COU_GS_SOURCE = 'SETUPFILE' # since we have an GS
95
- GSRA, GSDEC = self.getCoords(gsTarget, requirePrecision=False)
96
- # no PMRA, PMDE for GS !!
97
- COU_GS_MAG = float(gsTarget.FLUX_V)
95
+ acqTSF.COU_AG_GSSOURCE = 'SETUPFILE' # since we have a GS
96
+ # special hack waiting for uniform way
97
+ alpha, delta = self.getCoords(gsTarget, requirePrecision=False)
98
+ acqTSF.COU_AG_ALPHA, acqTSF.COU_AG_DELTA = alpha.replace(
99
+ ":", ""), delta.replace(":", "")
100
+ acqTSF.COU_AG_PMA, acqTSF.COU_AG_PMD = self.getPMCoords(
101
+ gsTarget)
102
+
103
+ # no PMRA, PMDE for GS ??
104
+
105
+ acqTSF.COU_GS_MAG = self.getFlux(gsTarget, "V")
106
+ try:
107
+ if "AT" in tel: # try better band observing on UT
108
+ acqTSF.COU_GS_MAG = self.getFlux(gsTarget, "G")
109
+ except:
110
+ ui.addToLog(
111
+ "G mag can't be retreived for AT on the guide star. Use V instead")
112
+ else:
113
+ acqTSF.COU_GS_MAG = self.getFlux(scienceTarget, "V")
114
+ try:
115
+ if "AT" in tel: # try better band observing on UT
116
+ acqTSF.COU_GS_MAG = self.getFlux(scienceTarget, "G")
117
+ except:
118
+ ui.addToLog(
119
+ "G mag can't be retreived for AT on the science star. Use V instead")
98
120
 
99
121
  # LST interval
100
122
  try:
@@ -131,47 +153,13 @@ class Matisse(VltiInstrument):
131
153
  ui.addToLog(acqTSF, False)
132
154
  ui.addToLog(obsTSF, False)
133
155
  else:
134
- self.createMatisseOB(p2container, obTarget, obConstraints, acqTSF, obsTSF, OBJTYPE, instrumentMode,
135
- COU_AG_GSSOURCE, GSRA, GSDEC, COU_GS_MAG, LSTINTERVAL)
136
- ui.addToLog(obTarget.name + " submitted on p2")
137
-
138
- def formatRangeTable(self):
139
- rangeTable = self.getRangeTable()
140
- buffer = ""
141
- for l in rangeTable.keys():
142
- buffer += l + "\n"
143
- for k in rangeTable[l].keys():
144
- constraint = rangeTable[l][k]
145
- keys = constraint.keys()
146
- buffer += ' %30s :' % (k)
147
- if 'min' in keys and 'max' in keys:
148
- buffer += ' %f ... %f ' % (
149
- constraint['min'], constraint['max'])
150
- elif 'list' in keys:
151
- buffer += str(constraint['list'])
152
- elif "spaceseparatedlist" in keys:
153
- buffer += ' ' + " ".join(constraint['spaceseparatedlist'])
154
- if 'default' in keys:
155
- buffer += ' (' + str(constraint['default']) + ')'
156
- else:
157
- buffer += ' -no default-'
158
- buffer += "\n"
159
- return buffer
160
-
161
- def getMatisseTemplateName(self, templateType, OBJTYPE):
162
- objType = "calibrator"
163
- if OBJTYPE and "SCI" in OBJTYPE:
164
- objType = "science"
165
- if OBJTYPE:
166
- return "_".join((self.getShortName(), templateType, objType))
167
- return "_".join((self.getShortName(), templateType))
168
-
169
- def getMatisseObsTemplateName(self, OBJTYPE):
170
- return self.getMatisseTemplateName("obs", OBJTYPE)
156
+ self.createOB(p2container, obTarget, obConstraints, obsTSF.DPR_CATG, instrumentMode,
157
+ LSTINTERVAL, [acqTSF, obsTSF])
171
158
 
172
159
  def formatDitTable(self):
173
160
  # fluxTable = self.getDitTable()
174
- buffer = ' Tel | Spec | spec band | Flux (Jy) | tau(ms)\n'
161
+ buffer = ' No dit table in use \n'
162
+ # buffer = ' Tel | Spec | spec band | Flux (Jy) | tau(ms)\n'
175
163
  # buffer += '--------------------------------------------------------\n'
176
164
  # for tel in ['AT']:
177
165
  # for spec in ['Low','Med']:
@@ -186,77 +174,3 @@ class Matisse(VltiInstrument):
186
174
  # buffer += "\n"
187
175
 
188
176
  return buffer
189
-
190
- def createMatisseOB(
191
- self, p2container, obTarget, obConstraints, acqTSF, obsTSF, OBJTYPE, instrumentMode,
192
- COU_AG_GSSOURCE, GSRA, GSDEC, COU_GS_MAG, LSTINTERVAL):
193
-
194
- api = self.facility.getAPI()
195
- ui = self.ui
196
- ui.setProgress(0.1)
197
-
198
- # TODO compute value
199
- VISIBILITY = 1.0
200
-
201
- # everything seems OK
202
- # create new OB in container:
203
- # TODO use a common function for next lines
204
- goodName = re.sub('[^A-Za-z0-9]+', '_', obTarget.name)
205
- OBS_DESCR = OBJTYPE[0:3] + '_' + goodName + '_MATISSE_' + \
206
- acqTSF.ISS_BASELINE[0] + '_' + instrumentMode
207
-
208
- ob, obVersion = api.createOB(p2container.containerId, OBS_DESCR)
209
- obId = ob['obId']
210
-
211
- # we use obId to populate OB
212
- ob['obsDescription']['name'] = OBS_DESCR[0:min(len(OBS_DESCR), 31)]
213
- ob['obsDescription']['userComments'] = self.getA2p2Comments()
214
- # ob['obsDescription']['InstrumentComments'] = 'AO-B1-C2-E3' #should be
215
- # a list of alternative quadruplets!
216
-
217
- # copy target info
218
- targetInfo = obTarget.getDict()
219
- for key in targetInfo:
220
- ob['target'][key] = targetInfo[key]
221
-
222
- # copy constraints info
223
- constraints = obConstraints.getDict()
224
- for k in constraints:
225
- ob['constraints'][k] = constraints[k]
226
-
227
- ui.addToLog("Save ob to p2:\n%s" % ob, False)
228
- ob, obVersion = api.saveOB(ob, obVersion)
229
-
230
- # time constraints if present
231
- self.saveSiderealTimeConstraints(api, obId, LSTINTERVAL)
232
- ui.setProgress(0.2)
233
-
234
- # then, attach acquisition template(s)
235
- tpl, tplVersion = api.createTemplate(obId, 'MATISSE_img_acq')
236
- # and put values
237
- # start with acqTSF ones and complete manually missing ones
238
- values = acqTSF.getDict()
239
- values.update({'COU.AG.GSSOURCE': COU_AG_GSSOURCE,
240
- 'COU.AG.ALPHA': GSRA,
241
- 'COU.AG.DELTA': GSDEC,
242
- 'COU.GS.MAG': round(COU_GS_MAG, 3),
243
- 'TEL.TARG.PARALLAX': 0.0
244
- })
245
-
246
- tpl, tplVersion = api.setTemplateParams(obId, tpl, values, tplVersion)
247
- ui.setProgress(0.3)
248
-
249
- # was :
250
- # tpl, tplVersion = api.createTemplate(obId, self.getMatisseObsTemplateName(OBJTYPE))
251
- tpl, tplVersion = api.createTemplate(obId, obsTSF.getP2Name())
252
- ui.setProgress(0.4)
253
-
254
- # put values. they are the same except for dual obs science (?)
255
- values = obsTSF.getDict()
256
- tpl, tplVersion = api.setTemplateParams(obId, tpl, values, tplVersion)
257
- ui.setProgress(0.5)
258
-
259
- # verify OB online
260
- response, _ = api.verifyOB(obId, True)
261
- ui.setProgress(1.0)
262
- self.showP2Response(response, ob, obId)
a2p2/vlti/pionier.py CHANGED
@@ -33,22 +33,22 @@ class Pionier(VltiInstrument):
33
33
 
34
34
  instrumentMode = instrumentConfiguration.instrumentMode
35
35
 
36
- # Retrieve SPEC and POL info from instrumentMode
36
+ # Retrieve GRISM or FREE info from instrumentMode
37
37
  for disp in self.getRange("PIONIER_acq.tsf", "INS.DISP.NAME"):
38
38
  if disp in instrumentMode[0:len(disp)]:
39
39
  ins_disp = disp
40
40
 
41
- for observationConfiguration in ob.observationConfiguration:
41
+ for observationConfiguration in self.getSequence(ob):
42
42
 
43
43
  # create keywords storage objects
44
44
  acqTSF = TSF(self, "PIONIER_acq.tsf")
45
- obsTSF = TSF(self, "PIONIER_obs_calibrator.tsf")
45
+
46
46
  # alias for PIONIER_obs_calibrator.tsf and
47
47
  # PIONIER_obs_science.tsf")
48
48
  kappaTSF = TSF(self, "PIONIER_gen_cal_kappa.tsf")
49
49
  darkTSF = TSF(self, "PIONIER_gen_cal_dark.tsf")
50
50
 
51
- obTarget = OBTarget()
51
+
52
52
  obConstraints = OBConstraints(self)
53
53
 
54
54
  # set common properties
@@ -56,23 +56,19 @@ class Pionier(VltiInstrument):
56
56
 
57
57
  if 'SCIENCE' in observationConfiguration.type:
58
58
  OBJTYPE = 'SCIENCE'
59
+ obsTSF = TSF(self, "PIONIER_obs_science.tsf")
59
60
  else:
60
61
  OBJTYPE = 'CALIBRATOR'
62
+ obsTSF = TSF(self, "PIONIER_obs_calibrator.tsf")
61
63
 
62
64
  scienceTarget = observationConfiguration.SCTarget
63
65
 
64
- # define target
65
- # acqTSF.SEQ_INS_SOBJ_NAME = scienceTarget.name.strip()
66
-
67
- acqTSF.TARGET_NAME = scienceTarget.name.strip()
68
- obTarget.name = acqTSF.TARGET_NAME.replace(
69
- ' ', '_') # allowed characters: letters, digits, + - _ . and no spaces
70
- obTarget.ra, obTarget.dec = self.getCoords(scienceTarget)
71
- obTarget.properMotionRa, obTarget.properMotionDec = self.getPMCoords(
72
- scienceTarget)
66
+ obTarget = OBTarget(self, scienceTarget)
73
67
 
74
68
  # Set baseline interferometric array code (should be a keywordlist)
75
- acqTSF.ISS_BASELINE = [self.getBaselineCode(BASELINE)]
69
+ acqTSF.ISS_BASELINE = [self.getBaselineCode(ob)]
70
+
71
+ self.checkIssVltiType(acqTSF)
76
72
 
77
73
  # define some default values
78
74
  DIAMETER = float(self.get(scienceTarget, "DIAMETER", 0.0))
@@ -108,6 +104,11 @@ class Pionier(VltiInstrument):
108
104
  # no PMRA, PMDE for GS !!
109
105
  TEL_COU_MAG = float(gsTarget.FLUX_V)
110
106
 
107
+ acqTSF.TEL_COU_GSSOURCE = TEL_COU_GSSOURCE
108
+ acqTSF.TEL_COU_ALPHA = GSRA
109
+ acqTSF.TEL_COU_DELTA = GSDEC
110
+ acqTSF.TEL_COU_MAG = round(TEL_COU_MAG, 3)
111
+
111
112
  # LST interval
112
113
  try:
113
114
  obsConstraint = observationConfiguration.observationConstraints
@@ -123,9 +124,6 @@ class Pionier(VltiInstrument):
123
124
  else:
124
125
  obConstraints.skyTransparency = 'Clear'
125
126
 
126
- if acqTSF.ISS_IAS_HMAG > 7.5:
127
- acqTSF.INS_DISP_NAME = "FREE"
128
-
129
127
  # FIXME: error (OB): "Phase 2 constraints must closely follow what was requested in the Phase 1 proposal.
130
128
  # The seeing value allowed for this OB is >= java0x0 arcsec."
131
129
  # FIXME REPLACE SEEING THAT IS NO MORE SUPPORTED
@@ -153,146 +151,25 @@ class Pionier(VltiInstrument):
153
151
  ui.addToLog(kappaTSF, False)
154
152
  ui.addToLog(darkTSF, False)
155
153
  else:
156
- self.createPionierOB(p2container, obTarget, obConstraints, acqTSF,
157
- obsTSF, kappaTSF, darkTSF, OBJTYPE, instrumentMode, TEL_COU_GSSOURCE, GSRA, GSDEC,
158
- TEL_COU_MAG, LSTINTERVAL)
159
- ui.addToLog(obTarget.name + " submitted on p2")
160
-
161
- def formatRangeTable(self):
162
- rangeTable = self.getRangeTable()
163
- buffer = ""
164
- for l in rangeTable.keys():
165
- buffer += l + "\n"
166
- for k in rangeTable[l].keys():
167
- constraint = rangeTable[l][k]
168
- keys = constraint.keys()
169
- buffer += ' %30s :' % (k)
170
- if 'min' in keys and 'max' in keys:
171
- buffer += ' %f ... %f ' % (
172
- constraint['min'], constraint['max'])
173
- elif 'list' in keys:
174
- buffer += str(constraint['list'])
175
- elif "spaceseparatedlist" in keys:
176
- buffer += ' ' + " ".join(constraint['spaceseparatedlist'])
177
- if 'default' in keys:
178
- buffer += ' (' + str(constraint['default']) + ')'
179
- else:
180
- buffer += ' -no default-'
181
- buffer += "\n"
182
- return buffer
154
+ self.createOB(p2container, obTarget, obConstraints, OBJTYPE, instrumentMode,
155
+ LSTINTERVAL, [acqTSF, obsTSF, kappaTSF, darkTSF])
183
156
 
184
157
  def formatDitTable(self):
185
- ditTable = self.getDitTable()
186
- buffer = ' Tel | Spec | Pol | H | DIT(s)\n'
187
- buffer += '--------------------------------------------------------\n'
188
- for tel in ['AT']:
189
- for spec in ['GRISM', 'FREE']:
190
- for pol in ['IN', 'OUT']:
191
- for i in range(len(ditTable[tel][spec][pol]['DIT'])):
192
- buffer += ' %3s | %4s | %3s | %2s |' % (tel,
193
- spec, pol, tel)
194
- buffer += ' %4.1f <K<= %3.1f | %4.1f' % (ditTable[tel][spec][pol]['MAG'][i],
195
- ditTable[tel][spec][
196
- pol]['MAG'][i + 1],
197
- ditTable[tel][spec][pol]['DIT'][i])
198
- buffer += "\n"
199
- Hut = ditTable[tel]['Hut']
158
+ buffer = ' No dit table in use \n'
159
+
160
+ # ditTable = self.getDitTable()
161
+ # buffer = ' Tel | Spec | Pol | H | DIT(s)\n'
162
+ # buffer += '--------------------------------------------------------\n'
163
+ # for tel in ['AT']:
164
+ # for spec in ['GRISM', 'FREE']:
165
+ # for pol in ['IN', 'OUT']:
166
+ # for i in range(len(ditTable[tel][spec][pol]['DIT'])):
167
+ # buffer += ' %3s | %4s | %3s | %2s |' % (tel,
168
+ # spec, pol, tel)
169
+ # buffer += ' %4.1f <K<= %3.1f | %4.1f' % (ditTable[tel][spec][pol]['MAG'][i],
170
+ # ditTable[tel][spec][
171
+ # pol]['MAG'][i + 1],
172
+ # ditTable[tel][spec][pol]['DIT'][i])
173
+ # buffer += "\n"
174
+ # Hut = ditTable[tel]['Hut']
200
175
  return buffer
201
-
202
- def getPionierTemplateName(self, templateType, OBJTYPE):
203
- objType = "calibrator"
204
- if OBJTYPE and "SCI" in OBJTYPE:
205
- objType = "science"
206
- if OBJTYPE:
207
- return "_".join((self.getName(), templateType, objType))
208
- return "_".join((self.getName(), templateType))
209
-
210
- def getPionierObsTemplateName(self, OBJTYPE):
211
- return self.getPionierTemplateName("obs", OBJTYPE)
212
-
213
- def createPionierOB(
214
- self, p2container, obTarget, obConstraints, acqTSF, obsTSF, kappaTSF, darkTSF, OBJTYPE, instrumentMode,
215
- TEL_COU_GSSOURCE, GSRA, GSDEC, TEL_COU_MAG, LSTINTERVAL):
216
-
217
- api = self.facility.getAPI()
218
- ui = self.ui
219
- ui.setProgress(0.1)
220
-
221
- # TODO compute value
222
- VISIBILITY = 1.0
223
-
224
- # everything seems OK
225
- # create new OB in container:
226
- # TODO use a common function for next lines
227
- goodName = re.sub('[^A-Za-z0-9]+', '_', acqTSF.TARGET_NAME)
228
- OBS_DESCR = OBJTYPE[0:3] + '_' + goodName + '_PIONIER_' + \
229
- acqTSF.ISS_BASELINE[0] + '_' + instrumentMode
230
-
231
- ob, obVersion = api.createOB(p2container.containerId, OBS_DESCR)
232
- ui.addToLog("Getting new ob from p2: ")
233
- obId = ob['obId']
234
-
235
- # we use obId to populate OB
236
- ob['obsDescription']['name'] = OBS_DESCR[0:min(len(OBS_DESCR), 31)]
237
- ob['obsDescription']['userComments'] = self.getA2p2Comments()
238
- # ob['obsDescription']['InstrumentComments'] = 'AO-B1-C2-E3' #should be
239
- # a list of alternative quadruplets!
240
-
241
- # copy target info
242
- targetInfo = obTarget.getDict()
243
- for key in targetInfo:
244
- ob['target'][key] = targetInfo[key]
245
-
246
- # copy constraints info
247
- constraints = obConstraints.getDict()
248
- for k in constraints:
249
- ob['constraints'][k] = constraints[k]
250
-
251
- ui.addToLog("Save ob to p2:\n%s" % ob, False)
252
- ob, obVersion = api.saveOB(ob, obVersion)
253
-
254
- # time constraints if present
255
- self.saveSiderealTimeConstraints(api, obId, LSTINTERVAL)
256
-
257
- ui.setProgress(0.2)
258
-
259
- # then, attach acquisition template(s)
260
- tpl, tplVersion = api.createTemplate(obId, 'PIONIER_acq')
261
- # and put values
262
- # start with acqTSF ones and complete manually missing ones
263
- values = acqTSF.getDict()
264
- values.update({'TEL.COU.GSSOURCE': TEL_COU_GSSOURCE,
265
- 'TEL.COU.ALPHA': GSRA,
266
- 'TEL.COU.DELTA': GSDEC,
267
- 'TEL.COU.MAG': round(TEL_COU_MAG, 3)
268
- })
269
-
270
- tpl, tplVersion = api.setTemplateParams(obId, tpl, values, tplVersion)
271
- ui.setProgress(0.3)
272
-
273
- # Put Obs template
274
- tpl, tplVersion = api.createTemplate(
275
- obId, self.getPionierObsTemplateName(OBJTYPE))
276
- ui.setProgress(0.4)
277
- values = obsTSF.getDict()
278
- tpl, tplVersion = api.setTemplateParams(obId, tpl, values, tplVersion)
279
- ui.setProgress(0.5)
280
-
281
- # put Kappa Matrix Template
282
- tpl, tplVersion = api.createTemplate(obId, 'PIONIER_gen_cal_kappa')
283
- ui.setProgress(0.6)
284
- values = kappaTSF.getDict()
285
- tpl, tplVersion = api.setTemplateParams(obId, tpl, values, tplVersion)
286
- ui.setProgress(0.7)
287
-
288
- # put Dark Template
289
- tpl, tplVersion = api.createTemplate(obId, 'PIONIER_gen_cal_dark')
290
- ui.setProgress(0.8)
291
- values = darkTSF.getDict()
292
- tpl, tplVersion = api.setTemplateParams(obId, tpl, values, tplVersion)
293
- ui.setProgress(0.9)
294
-
295
- # verify OB online
296
- response, _ = api.verifyOB(obId, True)
297
- ui.setProgress(1.0)
298
- self.showP2Response(response, ob, obId)
@@ -1,27 +1,34 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: a2p2
3
- Version: 0.2.14
4
- Summary: UNKNOWN
5
- Home-page: http://www.jmmc.fr/a2p2
6
- Author: JMMC Tech Group
7
- Author-email: jmmc-tech-group@jmmc.fr
3
+ Version: 0.7.4
4
+ Author-email: JMMC Tech Group <jmmc-tech-group@jmmc.fr>
8
5
  License: OSI Approved :: GNU General Public License v3 (GPLv3)
9
- Keywords: observation preparation tool optical-interferometry p2 samp
10
- Platform: UNKNOWN
6
+ Project-URL: Homepage, https://www.jmmc.fr/a2p2
7
+ Project-URL: Bug Reports, https://github.com/JMMC-OpenDev/a2p2/issues
8
+ Project-URL: Source, https://github.com/JMMC-OpenDev/a2p2
9
+ Keywords: observation,optical-interferometry,p2,preparation,samp,tool
11
10
  Classifier: Development Status :: 4 - Beta
12
11
  Classifier: Intended Audience :: Developers
13
12
  Classifier: Programming Language :: Python :: 3
14
13
  Classifier: Programming Language :: Python :: 3.6
15
- Requires-Dist: astropy (>=2)
16
- Requires-Dist: p2api
14
+ Requires-Python: >=3
15
+ Description-Content-Type: text/x-rst
16
+ License-File: LICENSE
17
17
  Requires-Dist: appdirs
18
+ Requires-Dist: astropy >=5.2.2
19
+ Requires-Dist: p2api
20
+
21
+ a2p2 |A2P2Badge|
22
+ ================
23
+
24
+ **Move your Aspro2 observation details to an observatory proposal database.**
18
25
 
19
26
  Description
20
27
  -----------
21
28
 
22
29
  Prepare your observations within Aspro2_ ( V0.9.9.3+ ) and run a2p2_ to submit your OB.
23
30
 
24
- Once setup ready, select your target and use Interop Menu
31
+ Once setup ready, select your target and use Interop Menu
25
32
 
26
33
  CHARA OB are only displayed in the GUI for the first implementations.
27
34
 
@@ -37,18 +44,24 @@ The package is uploaded to `PyPI`_, so you can install the package (and/or upgra
37
44
 
38
45
  ``pip install --upgrade [--user] a2p2``
39
46
 
47
+ We advice to use python environment. Prefer to use the ``--user`` option over running sudo that can break you system modules.
40
48
 
41
49
  You can also build and install from sources using git:
42
50
 
43
- ``git clone https://github.com/JMMC-OpenDev/a2p2.git``
51
+ ``git clone https://github.com/JMMC-OpenDev/a2p2.git``
52
+
53
+ ``pip install [--user] ./a2p2``
44
54
 
45
- ``pip install [--user] ./a2p2``
55
+ or pip :
56
+
57
+ ``pip install git+https://github.com/JMMC-OpenDev/a2p2``
46
58
 
47
59
  Prerequisites
48
60
  -------------
49
- Some basic tests have been operated on windows, Linux and Mac OS.
61
+ Some basic tests have been operated on windows, Linux and Mac OS. pytest-datafiles must be installed previously.
62
+
50
63
 
51
- a2p2 should launch the program.
64
+ a2p2 should launch the program.
52
65
 
53
66
  You may have to install some package to run tk GUI (``python-tk`` on linux).
54
67
 
@@ -63,18 +76,21 @@ optional arguments:
63
76
  -c, --createprefs Create preferences file
64
77
  -v, --verbose Verbose
65
78
 
66
- A GUI is provided using tkinter.
79
+ A GUI is provided using tkinter.
67
80
 
68
81
  Once Aspro2_ is running and a2p2_ is connected to an OB submission service (using P2API_) :
69
- * select your target
70
- * enter the Aspro2's menu ``Interop/Send Obs. block(s) to A2p2``
82
+ * select your target
83
+ * enter the Aspro2's menu ``Interop/Send Obs. block(s) to A2p2``
71
84
 
72
85
  After few seconds, you shoud get a report of your new submission.
73
86
 
74
- Each facilities get it's own code directory to manage specific GUI and specific OB processing. You can get associated inline help in the **HELP** tab.
87
+ Each facilities get it's own code directory to manage specific GUI and specific OB processing. You can get associated inline help in the **HELP** tab.
75
88
 
76
89
  Please fill an issue_ for any question, remark or enhancement request.
77
90
 
91
+ Release notes
92
+ -------------
93
+ `Check file <release-notes.md>`_
78
94
 
79
95
  License
80
96
  -------
@@ -105,5 +121,3 @@ Interaction diagram
105
121
  .. _a2p2: http://www.jmmc.fr/a2p2
106
122
  .. _tutorial: https://github.com/JMMC-OpenDev/a2p2/wiki/ASPRO2-A2P2-Tutorial
107
123
  .. _issue: https://github.com/JMMC-OpenDev/a2p2/issues
108
-
109
-
@@ -0,0 +1,39 @@
1
+ a2p2/__init__.py,sha256=054S6DE3EmhAkfH5JzyiOfMJFMrIYRWt4stsfYjjGHI,297
2
+ a2p2/__main__.py,sha256=Wu418ibC6_eM5WuvbJIi7vPALV86wAJ_iP4_zBBhTFw,2397
3
+ a2p2/client.py,sha256=YAB4ec3OJoTob1VNGKotTdVBTMTYlW1_LdzL9CzeWyA,12413
4
+ a2p2/facility.py,sha256=6k7RRcIL9Qr5NpCeVU3LxXNJflW8UZX6Fl3q8-V72Ik,3868
5
+ a2p2/gui.py,sha256=gzZ31CtxsOPAA58MSL-j23dKPmTRJI16DG1Im1xMZqs,10143
6
+ a2p2/instrument.py,sha256=JI1i8vsGu1ku_3i7my278b8y8vL5Z-SF3V8XkHPSs48,732
7
+ a2p2/ob.py,sha256=lcSm5eXv79K6cjp0VxvxD4sSlsBTKHGbmT85XEx74lY,6268
8
+ a2p2/samp.py,sha256=DN20lWszkuuneR1BV1MBLEyoGyN8tZWvOeC5rEVLICo,3438
9
+ a2p2/utils.py,sha256=QEA9cpc2TaqXDa4yqrFiGkCl__1wV8--rVw_A-p_HM0,23833
10
+ a2p2/version.py,sha256=_N6fsRiq6jonys8LHzHhDDHK23gABI2vSSLu4quaQDM,12353
11
+ a2p2/chara/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ a2p2/chara/facility.py,sha256=otv0UVQVYD7dE_ENojjatjld5owgM9qRm7vsAc0jyqQ,2754
13
+ a2p2/chara/gui.py,sha256=4O8u-g-UJSeqEV9CUPNflVNWIsmH0b_xf8c9huxAivs,5119
14
+ a2p2/jmmc/__init__.py,sha256=Yx8Ae77UQA_aLMzhKgWym4m2fbMR_4m77TGfaXy6I4A,187
15
+ a2p2/jmmc/catalogs.py,sha256=8hf8nUVfAdgROpPGzP-aD4Haulp7lWGCSHod5ZhmJNM,4801
16
+ a2p2/jmmc/generated_models.py,sha256=69fmPfkCMBc0GyDeHp1rs0vkoPqOE4j0egMBWX5mB1U,11823
17
+ a2p2/jmmc/models.py,sha256=ikI8Dk-9ThkG1uHtoPJwB43tPF_YZj8M5tftIcJio7s,3776
18
+ a2p2/jmmc/services.py,sha256=kcRaRnR4COKijF5izDqqNHjKyU1j2H8PEPvbDsBUFcw,312
19
+ a2p2/jmmc/utils.py,sha256=-LJj58klrAWTGfKt5c4o1ovX2_EntvD7HqvM-LitRbo,4585
20
+ a2p2/jmmc/webservices.py,sha256=3jrZ8Rj542bNOvfihvGAA_8RvQgA5QQebefPJc05MRs,1568
21
+ a2p2/vlti/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
+ a2p2/vlti/facility.py,sha256=kakQZg79SmSLtWNSNg3eNgdAN15NF1nTDQCLzUVzHo8,13539
23
+ a2p2/vlti/gravity.py,sha256=yMpuDY-fV9FYmINE83Yw0Rr2VeUkCOseN8FyaTvgPvE,14408
24
+ a2p2/vlti/gui.py,sha256=py2wlQvEIHc2--US5PogRoN-zCsgLRP71aG9_1-Vx9c,12290
25
+ a2p2/vlti/instrument.py,sha256=g8EEVwGrihEtXcL3KaiC6nXFMH52C6wjCUb_tabTgQ8,27092
26
+ a2p2/vlti/matisse.py,sha256=fbv1GwiEUFVeH9qe5DU2zZcVZuPc-X0Nyffwok5HaV8,7468
27
+ a2p2/vlti/pionier.py,sha256=k_a_1bz_skzGTuQWapBqdNMFbfOIeHKI1IcKWQgVHK8,6780
28
+ a2p2/vlti/conf/GRAVITY_ditTable.json,sha256=iBkRFp8wB91-U56wzq0v8kslVpVuQ1vYNziOo-IHayE,1602
29
+ a2p2/vlti/conf/GRAVITY_rangeTable.json,sha256=aNB87uxxiiu0TBoXTf7OrqRiMJRnb-CFCyjSXFKvEbE,15155
30
+ a2p2/vlti/conf/MATISSE_ditTable.json,sha256=2RQXb9UL1_VlcAAGoxqpe3nTrRfO4gyOX_IGHVy3SBc,4
31
+ a2p2/vlti/conf/MATISSE_rangeTable.json,sha256=_j5m-EOh4bbfwdaANdh23yjgNef95AUku_uNujr9BDc,5770
32
+ a2p2/vlti/conf/PIONIER_ditTable.json,sha256=BKK7nF0nE_LOP44l_fAvAnpG8oOq5p9srcdTNQ2udKo,857
33
+ a2p2/vlti/conf/PIONIER_rangeTable.json,sha256=71Ycm2h-uBUVSAWy6lTpaBDOYwKKL5MuZH6F5ESHOI0,2113
34
+ a2p2-0.7.4.dist-info/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
35
+ a2p2-0.7.4.dist-info/METADATA,sha256=igT2BELh2nCRDMYuJO5C_tgKxWS9LJWz1eBgKyHHUDA,4140
36
+ a2p2-0.7.4.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
37
+ a2p2-0.7.4.dist-info/entry_points.txt,sha256=5Pq7faxs04hSEtjpqtBAlHw3cGUpvTmBugnS5PzgJMY,44
38
+ a2p2-0.7.4.dist-info/top_level.txt,sha256=lLDb6xGRyHYSbrO0EUx8vNEzTiCDtPe2z7PSbqGY4kE,5
39
+ a2p2-0.7.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.34.1)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,3 +1,2 @@
1
1
  [console_scripts]
2
2
  a2p2 = a2p2.__main__:main
3
-