[pyngl-talk] returnLevels of nice_cntr_levels

Harald Rybka Harald.Rybka at dwd.de
Mon Aug 26 01:11:05 MDT 2019


Hi there,

just a quick question concerning the use of the Ngl.nice_cntr_levels 
function.

I tried to use it to automatically determine a nice level array for my 
data but in my case a (not that nice) two-entry long numpy array has 
been generated.

#### pyngl snippet:

cmin,cmax,cint,levels = 
Ngl.nice_cntr_levels(numpy.min(data),numpy.max(data),max_steps=20,outside=True,returnLevels=True)

# with numpy.min(data) = 10.34 and numpy.max(data) 21.48

print(levels)

 >>[10. 22.]

Is this function intended for this case to give a two-long array only? I 
know I could use the cint option to set the level increment but I had 
hoped that a nice array would result without defining the interval 
length. Is there any way to modify the function to specify a min_steps 
option in order to get a nicer result?

-- Harald

-- 
Dr. Harald Rybka                       harald.rybka at dwd.de
Deutscher Wetterdienst                 Tel.: +49-(0)69-8062-2225
Abt. Klima- und Umweltberatung (KU1)   Fax.: +49 (0)69-8062-2993
Frankfurter Str. 135
63067 Offenbach

http://www.twitter.com/dwd_klima
http://www.dwd.de/klima

Der DWD verarbeitet Ihre personenbezogenen Daten im gesetzlich zulässigen Rahmen.
Nähere Informationen hierzu finden Sie in unserer Datenschutzinformation unter:
https://www.dwd.de/datenschutz



More information about the pyngl-talk mailing list