[Thread Prev][Thread Next][Index]

Re: [ferret_users] pyferret frame images with nodisplay have small white lines



Hi Patrick,

The "outline" setting in pyferret is to address the white lines that can occur when any graphics program draws a plot using filled polygons. Shade and fill plots draw color-filled rectangles or triangles. Here is a post about this, and there are other discussions going back a long time. This occurred with Ferret graphics too.

https://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2019/msg00711.html

Your example used the shade command. If the desired plot uses a contour/fill, then another workaround is to first draw a shade plot and then overlay a fill plot with identical colors. 

Ansley 

On Fri, Jan 22, 2021, 7:46 AM Patrick Brockmann <patrick.brockmann@xxxxxxxxxxxx> wrote:
Hi,

import pyferret
pyferret.start(verify=False, pngonly=True, journal=False, quiet=True)
pyferret.run('set window /xpixel=756.000000 /aspect=0.809524 /outline=0.0 1')
pyferret.run('use levitus_climatology')
pyferret.run('shade/lev=20v temp[k=1]')
pyferret.run('frame/file=tyty.png')

still produces an image with this an annoying thin white horizontal line.
pngonly=True seems a better option that unmapped=True

But I am still confused on the interest to use the outline option.
What for since I am not using any polygon command.
A default value as suggested in documentation /outline=0.5 does not
get rid off this line anyway.
Higher such as 0.5 removes the line but what are the consequences when
I will use other graphic commands.

So my request would be on what are correct options to produce a
choosen sized image without any "scraches" on the image.

pyferret.run('set window /xpixel=756.000000 /aspect=0.809524 /outline=0.05 1')
could be replace by
pyferret.run('set window /xpixel=756.000000 /ypixel=612 /outline=0.05 1')
that is a default setting.
The problem occurs the same way.
 
Thanks for any solution on this relatively small problem but that causes questions from
users of the ferretmagic (pyferret in a jupyter notebook).

Best regards
Patrick

--
Data Analytics and Visualization Engineer / Project Manager
LSCE/IPSL, CEA-CNRS-UVSQ laboratory
LSCE - Climate and Environment Sciences Laboratory
IPSL - Institut Pierre Simon Laplace
--


De: "Patrick Brockmann" <patrick.brockmann@xxxxxxxxxxxx>
À: "ferret users" <ferret_users@xxxxxxxx>
Envoyé: Jeudi 21 Janvier 2021 23:10:06
Objet: Re: [ferret_users] pyferret frame images with nodisplay have small white lines

Re,

In fact there is a pngonlyoption that exists and should be noticed in the documentation.

From pyferret code (pyferret/__init__.py)
pngonly: (boolean)    if True, do not display to the console and only raster (PNG)  
                             images can be saved; plots will be generated faster but  
                             removes support for deletion of parts (segments) of a plot.

Regards
Patrick


De: "Patrick Brockmann" <patrick.brockmann@xxxxxxxxxxxx>
À: "ferret users" <ferret_users@xxxxxxxx>
Envoyé: Jeudi 21 Janvier 2021 21:05:39
Objet: [ferret_users] pyferret frame images with nodisplay have small white lines

Hi all,

With pyferret and the -nodisplay option I get some white horizontal lines 
that makes the image captured by the frame command not very nice (at least strange).

Is there a workaround ? 
Initially (re)discovered from a python notebook (with ferretmagic https://github.com/PBrockmann/ipython_ferretmagic)

$ cat tyty.jnl
use levitus_climatology
shade/lev=20v temp[k=1]
frame/file=tyty.png

$ pyferret -nodisplay -script tyty.jnl

I have tested the pyferret -png option.
It produces an image without lines. That would be perfect but how to retrieve this mode
from a pyferret.start function (the way ferretmagic produces images).

Please test:

$cat tyty.py
import pyferret
pyferret.start(verify=False, journal=False, unmapped=True, quiet=True)
pyferret.run('use levitus_climatology')
pyferret.run('shade/lev=20v temp[k=1]')
pyferret.run('frame/file=tyty.png')

$python tyty.py

Tested with last 7.63 release

Regards
Patrick

--
Data Analytics and Visualization Engineer / Project Manager
LSCE/IPSL, CEA-CNRS-UVSQ laboratory
LSCE - Climate and Environment Sciences Laboratory
IPSL - Institut Pierre Simon Laplace
--


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

Privacy Policy | Disclaimer | Accessibility Statement