[Thread Prev][Thread Next][Index]

Re: [ferret_users] Re: [ferret_users] pyferret aliasing in jupyter notebooks



Hi all,

This "thin white line" issue has been around for a long time, unfortunately.
There is a work-around with the PyFerret "SET WINDOW /OUTLINE=..." command (https://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/commands-reference/SET#set_window_outline) in which an outline of the specified width is added to all polygons.  Usually a small value, such a 0.05, is enough to remove all these lines.

We did discover this is a known issue with many graphics products drawing two polygons right next to each other using floating point coordinates.  Their solution was similar to ours - add an outline.  We have not done this by default since the outline does slightly change the dividing line between the two polygons (since the outlines overlap, and one outline is drawn after the other) if one is inspecting closely.

Karl


On Fri, May 29, 2020 at 6:40 AM Pierre Sepulchre <pierre.sepulchre@xxxxxxxxxxxx> wrote:

Hi Paulo,

I think so, for now.

But actually, the problem is not that bad. pyferret+ferretmagic still make very nice figures in jupyter notebooks.

For a taste, you'll find a link to an interactive notebook here :

https://zenodo.org/record/3549652

Pierre


Le 29/05/2020 à 15:12, Paulo B. Oliveira a écrit :

Hi, 

Thank you Pierre and Patrick for sharing your experience with ferret and jupyter, and Patrick for ferretmagic.

I use ferret for a long time, but I'm just starting with jupyter. If I understood correctly, the only way to avoid the horizontal lines is by calling pyferret externally ?

On Fri, 29 May 2020 11:07:39 +0200 (CEST), Patrick Brockmann wrote:

Hi Pierre,
Indeed I can see some horizontal lines in the example you gave.
But by digging a little bit more into the problem, I can reduce it to a
simple call (that is indeed beneath the ferretmagic code).
$ cat simple.jnl
shade i[i=1:100]*j[j=1:100]*0
frame/xpixel=800/file=tyty.png/format=PNG

$ pyferret -script simple.jnl
produces a correct image ok.png

whereas
$ pyferret -unmapped -script simple.jnl
produces a aliased image (horizontal lines are visible) aliased.png
Tested with 7.5 pyferret release.
Regards
Patrick

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

De: "Pierre Sepulchre"
À: "ferret users"
Envoyé: Jeudi 28 Mai 2020 23:10:03
Objet: [ferret_users] pyferret aliasing in jupyter notebooks

Dear all,

I am using pyferret v7.43/python3.6 in jupyter notebooks, within jupyter-lab and with ferretmagic extension, on macOS high sierra.

I realized that sometimes plotting with shade/ led to "aliased" maps, i.e. with unesthetic horizontal lines starting from both sides of the map.

However running the exact same command in a terminal (i.e. not in a notebook) provides a nice plot !

Playing with set window/noantialiasing does not improve much, but I noticed that changing the window aspect in the notebook, either through the use of "%ferret -s X,Y" parameters or with the set window /aspect, would change the location of the horizontal bars.

I would be grateful if someone had an hint to solve this issue.

I provide the examples here :

https://sharebox.lsce.ipsl.fr/index.php/s/QleW9tCk7HSYxhT

All the best,

Pierre

--

CNRS/Laboratoire des Sciences du Climat et de l'Environnement, Gif-sur-Yvette, France
tel : +33 (0) 1 69 08 65 49
What I am working on
twitter: @PierreSepulchre
github: psepulchre

--

CNRS/Laboratoire des Sciences du Climat et de l'Environnement, Gif-sur-Yvette, France
tel : +33 (0) 1 69 08 65 49
What I am working on
twitter: @PierreSepulchre
github: psepulchre



--
Karl M. Smith, Ph.D.
JISAO Univ. Wash. and PMEL NOAA

Note that I am working remotely (from home)

The policy of the DOC and NOAA requires me to inform you that 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