Skip to content

Impossible to call splot in interactive mode from a Qt5 GUI application #153

@noste99

Description

@noste99

When calling the IRAF command iraf.onedspec.splot(filename) inside a python function (making use of subprocess.run) linked to a Qt5 button on the GUI, a window opens with title graphics1 but it remains black and the following traceback info is printed:

`Traceback (most recent call last):
File "/archive/stefan/ARCHIVE/ePython/EC_PIPELINE/EC_Envelopes.py", line 117, in triggeredImageView
pb.viewImage(self.lbl_val_SCIE.text())
File "/archive/stefan/ARCHIVE/ePython/EC_PIPELINE/pipe_Blocks.py", line 83, in viewImage
cmd = iraf.onedspec.splot(imname)
File "/usr/lib/python3/dist-packages/pyraf/iraftask.py", line 836, in call
return self.run(*args, **kw)
File "/usr/lib/python3/dist-packages/pyraf/iraftask.py", line 375, in run
self._run(redirKW, specialKW)
File "/usr/lib/python3/dist-packages/pyraf/iraftask.py", line 880, in _run
irafexecute.IrafExecute(self, iraf.getVarDict(), **redirKW)
File "/usr/lib/python3/dist-packages/pyraf/irafexecute.py", line 348, in IrafExecute
irafprocess.run(task, pstdin=stdin, pstdout=stdout, pstderr=stderr)
File "/usr/lib/python3/dist-packages/pyraf/irafexecute.py", line 512, in run
self.slave()
File "/usr/lib/python3/dist-packages/pyraf/irafexecute.py", line 644, in slave
xmit()
File "/usr/lib/python3/dist-packages/pyraf/irafexecute.py", line 827, in xmit
gki.kernel.append(numpy.frombuffer(xdata, dtype=numpy.int16))
File "/usr/lib/python3/dist-packages/pyraf/gki.py", line 901, in append
self.stdgraph.append(arg, isUndoable)
File "/usr/lib/python3/dist-packages/pyraf/gki.py", line 901, in append
self.stdgraph.append(arg, isUndoable)
File "/usr/lib/python3/dist-packages/pyraf/gki.py", line 561, in append
self.translate(buffer, 0)
File "/usr/lib/python3/dist-packages/pyraf/gkitkbase.py", line 822, in translate
self.incrPlot() # pure virtual, must be overridden
File "/usr/lib/python3/dist-packages/pyraf/gkitkplot.py", line 125, in incrPlot
function(args)
File "/usr/lib/python3/dist-packages/pyraf/gkitkplot.py", line 302, in tkplot_polyline
gw.create_line(
(tuple(scaled.ravel().astype(numpy.int32))), **options)
File "/usr/lib/python3.10/tkinter/init.py", line 2823, in create_line
return self._create('line', args, kw)
File "/usr/lib/python3.10/tkinter/init.py", line 2805, in _create
return self.tk.getint(self.tk.call(
_tkinter.TclError: bad screen distance "2.0"

`
All other iraf commands work fine in my application. I refer here to splot because it is rather simple to use, but the objective of my application is to pass manually through the different steps of the calibration of an ECHELLE spectrum. What blocks me is apall running in an interactive mode and due to the fact this seems incompatible with Qt5 I am blocked. Thanks in advance for your advice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions