|
From: Ken S. <k.w...@qu...> - 2011-08-18 15:31:15
|
Folks
Apologies in advance if there's an FAQ, but I can't find it... (Feel
free to point it out to me...) There also doesn't seem to be a simple
way to search the Sourceforge archives for this group...
I've been using Gnuplot.py for a while now, and I keep running into
the same problem. I'm creating postscript plots, but at the end of my
script I'd like to convert them into JPEGs using ImageMagick (convert).
The problem is that (presumably because of threading) Gnuplot.py is
sometimes not completing its work before I attempt to convert the
plot. Hence ImageMagic complains about missing postscript files - or
the postscript files are incomplete when conversion starts.
Is there a way to turn threading/FIFOs OFF? Or is there a way I can
use "join" to force my python program to WAIT for the plot to be
completed before attempting to convert it?
I've tried setting the following after my Gnuplot import:
Gnuplot.GnuplotOpts.prefer_fifo_data = 0
Gnuplot.GnuplotOpts.support_fifo = 0
Gnuplot.GnuplotOpts.prefer_inline_data = 1
but to no avail. The only thing I'm doing at the moment is checking
that the postscript file exists - but this is just a fudge and doesn't
prevent other issues if the file is incomplete. Below are example
errors...
Ken
Example errors:
MISSING ps file
convert: unable to open image `/tmp/tempPSPlots/
1095652401023547700_lc.ps': @
error/blob.c/OpenBlob/2584.
convert: missing an image filename
`/psdb/images/ps1ss/lightcurves/1095652401023547700_lc.jpeg' @
error/convert.c/ConvertImageCommand/2949.
INCOMPLETE ps file (presumably that's what causes ghostscript to barf)
Error: /syntaxerror in -file-
Operand stack:
MLshow
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval--
%--nostringval-- 2 %stopped_push --nostringval-- --
nostringval--
%--nostringval-- false 1 %stopped_push 1894 1 3
%oparray_pop
%1893 1 3 %oparray_pop 1877 1 3 %oparray_pop
1771 1 3
%%oparray_pop --nostringval-- %errorexec_pop .runexec2
%--nostringval-- --nostringval-- --nostringval-- 2
%stopped_push
Dictionary stack:
--dict:1158/1684(ro)(G)-- --dict:0/20(G)-- --dict:80/200(L)--
--dict:176/256(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 9.00: Unrecoverable error, exit code 1
|