ecmwf / magics

Plotting package to visualise meteorological data in GRIB, NetCDF, BUFR and ODB format.
Apache License 2.0
56 stars 15 forks source link

Contouring leaves blank some parts of a shade #103

Open sylvielamythepaut opened 8 months ago

sylvielamythepaut commented 8 months ago

What happened?

I have two data sets, whose names begin with "SS" and "DU", respectively. Metview leaves blank some parts of the shade. When it leaves some blank for one of the data sets, the shade for the other data set is fine, and vice-versa.

I have played with the contour_internal_reduction_factor option of the contouring object. When I set it to 4, the graphic for SS is fine, but the one for DU has some blank areas. When I set it to 1, the graphic for SS presents one blank area, and the one for DU is fine.

I have read in the documentation that the contouring parameter "contour_internal_reduction_factor" produces a more accurate result when set to one, and a less accurate one when set to four. So I think that it should not produce blank areas when set to one, but it does.

I attach 7 files:

The two data sets:: DU_ug_m-3.grb SS_ug_m-3.grb The python script that procudes the graphics: vert_hov_blank.py The four output graphics: For the DU_ug_m-3.grb dataset: DU_ug_m-3.factor1.png made with contour_internal_reduction_factor = 1 DU_ug_m-3.factor4.png made with contour_internal_reduction_factor = 4 For the SS_ug_m-3.grb data set: SS_ug_m-3.factor1.png made with contour_internal_reduction_factor = 1 SS_ug_m-3.factor4.png made with contour_internal_reduction_factor = 4 You can place all of them in the same directory and run the script.

In lines 7 and 8, the input file name is established. You can comment one of them in order to load the dataset stated in the other one.

In line 63, you can modify the contour_internal_reduction_factor.

I have to produce graphics for both types of data sets (and some others) in an automatic way. So, I need an automatic way to determine what contour_internal_reduction_factor is best for the data being used at any moment. Does that way exist or is there another solution for my problem? SUP-3633.zip

What are the steps to reproduce the bug?

I've condensed it down into a smaller script that might make it easier to diagnose. I couldn't get the exact same plot without using a Hovmoeller View, but what I've attached produces something quite similar.

test.pyhov.nc

Version

4.15.0

Platform (OS and architecture)

Darwin

Relevant log output

No response

Accompanying data

No response

Organisation

No response