Some useful utilities...
Finds all elements from a list that match a regular expression. The regexp and the different elements of the list must be of the same type:
Returns the angle(s) d in the modulo nearest to ref.
Returns lon shifted in [0;360[ or [0;2pi[ (depending on unit).
Creates a custom Colormap from a set of RGB colors in a file with the following formating:
r1,g1,b1;
r2,g2,b2;
...
rn,gn,bn
each value being comprised between 0 and 255 e.g. coming from http://colormap.org.
Reads and registers the epygram-or-user-colormap called cmap, which must be either in config.epygram_colormaps or config.usercolormaps.
Print percentage of the loop it is in, with ‘step’ being the current loopstep, ‘end’ the final loopstep and ‘refresh_freq’ the frequency in % at which reprinting status.
Reads a .csv file as a list of dict, with the assumption: - on first line is described the delimiter - on second line is described the ‘priority’ of the dict.
Computes air specific gas constant R according to specific humidity, and hydrometeors if present.
A table is meant to be : <str> <str> <str> ... <str> <num> <num> ...
... ... ... ...
Returns string s linearized, i.e. without special characters that may be forbidden in filenames. - quotes: must we also remove quotes?
Returns str(o) linearized (cf. util.linearized).
Creates a datetime.datetime from a string or int YYYYMMDDHHMMSS...
Adds meridians and parallels to a basemap instance bm.
meridians and parallels enable to fine-tune the choice of lines to plot, with either:
- ‘auto’: automatic scaling to the basemap extents
- ‘default’: range(0,360,10) and range(-90,90,10)
- a list of values
- a grid step, e.g. 5 to plot each 5 degree.
- None: no one is plot
- meridian == ‘greenwich’ // ‘datechange’ // ‘greenwich+datechange’ parallel == ‘equator’ // ‘polarcircles’ // ‘tropics’ or any combination (+) will plot only these.
Function to compare floats http://floating-point-gui.de/errors/comparison/ Float.MIN_NORMAL was replaced by sys.float_info.min Float.MAX_VALUE was replaced by sys.float_info.max
Function to compare floats http://floating-point-gui.de/errors/comparison/ Float.MIN_NORMAL was replaced by sys.float_info.min Float.MAX_VALUE was replaced by sys.float_info.max
Parse a string (of syntax ‘key1:value1,key2=value2’) to a dict. If try_convert is not None, try to convert values as type try_convert.
Return array.flatten() or compressed(), whether the array is masked or not.
Bases: object
Generic abstract class implementing useful recursive properties:
Bases: epygram.util.RecursiveObject
This class handles an angle. It enables conversions of units, while saving the original unit and value of the angle at its construction.