[Thread Prev][Thread Next][Index]

Re: [ferret_users] pyferret: FRAME output delay



Hi Ryo,

To answer your question in parentheses - yes, displayed windows are run as separate processes, due to Qt requirements.  All commands to draw, save, etc. are sent as commands to the displayed window process through a "pipe".  So once the command to save the image is put into the "pipe", the main PyFerret process continues on.  I can add code so the main PyFerret process waits for a reply from the displayed window process when saving an image.  (I need to add code to wait for a reply to support the Ferret "where" command.)

Note that plots/windows that are not displayed (using the "-nodisplay" command-line option) are *not* separate processes.  So using the "-nodisplay" option will also solve this problem, and create the images much faster.  Of course, the plots will not be displayed as they are being made, but if you are just running a set of routine scripts to produce image files that you want to look at, this might be all you need.

Best regards,
Karl



On Tue, Nov 26, 2019 at 4:45 AM Ryo Furue <furue@xxxxxxxxxx> wrote:
Dear pyferret users,

I've noticed that before the output image file from a FRAME command is generated, the next command is executed.  As a result, the next command doesn't necessary find the newly created image.

This is a practical problem when you manipulate the newly created image using SPAWN.

A workaround is to "SPAWN sleep 5" before manipulating the image.

(Does FRAME do its work in another thread?)

Regards,
Ryo
----------------
set data etopo5
fill/hlimits=160W:120W/vlimits=30N:50N rose
frame/file=tmp.png
SPAWN ls tmp.png  ! file not found!
SPAWN sleep 5
SPAWN ls tmp.png  ! file found.

I use pyferret on macOS Catalina.

  NOAA/PMEL TMAP
  PyFerret v7.5 (optimized)
  Darwin 17.7.0 - 11/14/19
  26-Nov-19 21:25


--
Karl M. Smith, Ph.D.
JISAO Univ. Wash. and PMEL NOAA
"The contents of this message are mine personally and do
not necessarily reflect any position of the Government
or the National Oceanic and Atmospheric Administration."

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement