|
ocssw
V2022
|
Functions | |
| def | get_palette (palfile) |
| def | get_crs_from_proj (projStr) |
| def | normalize_lon (lons) |
| def | calculate_gridline_increments (minval, maxval) |
Variables | |
| parser = argparse.ArgumentParser(description="add overlays to mapped PNG images output from mapgen (or l3mapgen)") | |
| type | |
| str | |
| help | |
| default | |
| None | |
| action | |
| float | |
| choices | |
| args = parser.parse_args() | |
| ofile = args.ofile | |
| ofilePath = Path(args.ifile) | |
| pinfofile = args.projinfo | |
| dictionary | pinfo = {} |
| list | asString = ['proj','scale_type'] |
| key | |
| value | |
| list | pinfokeys = ['minX','maxX','minY','maxY','north','south','east','west','datamin','datamax','scale_type','proj'] |
| tuple | img_extent_meters = (pinfo['minX'],pinfo['maxX'],pinfo['minY'],pinfo['maxY']) |
| tuple | img_extent = (pinfo['west'],pinfo['east'],pinfo['south'],pinfo['north']) |
| img = plt.imread(args.ifile) | |
| int | dpi = 72 |
| imgwidth = img.shape[1]/float(dpi) | |
| imgheight = img.shape[0]/float(dpi) | |
| padheight = np.ceil(imgwidth*0.3) | |
| padwidth = np.ceil(imgheight*0.3) | |
| figwidth = np.round(imgwidth + padwidth, decimals=2) | |
| figheight = np.round(imgheight + padheight, decimals=2) | |
| figrows = int(np.ceil(4*figheight)) | |
| fig = plt.figure(figsize=(figwidth, figheight), dpi=dpi) | |
| def | crs = get_crs_from_proj(pinfo['proj']) |
| bottom = int(np.floor(0.025*figrows)) | |
| ax = plt.subplot2grid((figrows,7),(0,0),rowspan=figrows-bottom, colspan=7, fig=fig,projection=crs) | |
| extent | |
| origin | |
| transform | |
| label | |
| fontsize | |
| resolution | |
| color | |
| linewidth | |
| int | labelsize = 14 * (figheight / 14.0) |
| bool | labelgrid = True |
| gl | |
| bottom_labels | |
| xlines | |
| ylines | |
| xlabel_style | |
| ylabel_style | |
| def | lons = calculate_gridline_increments(pinfo['west'],pinfo['east']) |
| def | lats = calculate_gridline_increments(pinfo['south'],pinfo['north']) |
| xlocator | |
| ylocator | |
| cbax = plt.subplot2grid((figrows,7),(figrows-bottom,2),fig=fig,rowspan=bottom,colspan=3) | |
| def | cmap = get_palette(args.palfile) |
| norm = mpl.colors.Normalize(vmin=pinfo['datamin'], vmax=pinfo['datamax']) | |
| formatter = None | |
| cb | |
| cbartitle | |
| size | |
| left | |
| right | |
| top | |
| bbox_inches | |
| pad_inches | |
| transparent | |
Function Documentation
◆ calculate_gridline_increments()
| def mapgen_overlay.calculate_gridline_increments | ( | minval, | |
| maxval | |||
| ) |
Definition at line 87 of file mapgen_overlay.py.
◆ get_crs_from_proj()
| def mapgen_overlay.get_crs_from_proj | ( | projStr | ) |
Definition at line 38 of file mapgen_overlay.py.
◆ get_palette()
| def mapgen_overlay.get_palette | ( | palfile | ) |
Definition at line 13 of file mapgen_overlay.py.
◆ normalize_lon()
| def mapgen_overlay.normalize_lon | ( | lons | ) |
Definition at line 78 of file mapgen_overlay.py.
Variable Documentation
◆ action
| action |
Definition at line 105 of file mapgen_overlay.py.
◆ args
| args = parser.parse_args() |
Definition at line 126 of file mapgen_overlay.py.
◆ asString
| list asString = ['proj','scale_type'] |
Definition at line 138 of file mapgen_overlay.py.
◆ ax
Definition at line 180 of file mapgen_overlay.py.
◆ bbox_inches
| bbox_inches |
Definition at line 248 of file mapgen_overlay.py.
◆ bottom
| bottom = int(np.floor(0.025*figrows)) |
Definition at line 179 of file mapgen_overlay.py.
◆ bottom_labels
| bottom_labels |
Definition at line 208 of file mapgen_overlay.py.
◆ cb
| cb |
Definition at line 236 of file mapgen_overlay.py.
◆ cbartitle
| cbartitle |
Definition at line 242 of file mapgen_overlay.py.
◆ cbax
Definition at line 223 of file mapgen_overlay.py.
◆ choices
| choices |
Definition at line 112 of file mapgen_overlay.py.
◆ cmap
| def cmap = get_palette(args.palfile) |
Definition at line 225 of file mapgen_overlay.py.
◆ color
| color |
Definition at line 194 of file mapgen_overlay.py.
◆ crs
| crs = get_crs_from_proj(pinfo['proj']) |
Definition at line 176 of file mapgen_overlay.py.
◆ default
| default |
Definition at line 103 of file mapgen_overlay.py.
◆ dpi
| dpi = 72 |
Definition at line 160 of file mapgen_overlay.py.
◆ extent
| extent |
Definition at line 186 of file mapgen_overlay.py.
◆ fig
Definition at line 173 of file mapgen_overlay.py.
◆ figheight
Definition at line 170 of file mapgen_overlay.py.
◆ figrows
| figrows = int(np.ceil(4*figheight)) |
Definition at line 171 of file mapgen_overlay.py.
◆ figwidth
Definition at line 169 of file mapgen_overlay.py.
◆ float
| float |
Definition at line 110 of file mapgen_overlay.py.
◆ fontsize
| fontsize |
Definition at line 190 of file mapgen_overlay.py.
◆ formatter
| formatter = None |
Definition at line 228 of file mapgen_overlay.py.
◆ gl
| gl |
Definition at line 205 of file mapgen_overlay.py.
◆ help
| help |
Definition at line 102 of file mapgen_overlay.py.
◆ img
| img = plt.imread(args.ifile) |
Definition at line 157 of file mapgen_overlay.py.
◆ img_extent
Definition at line 155 of file mapgen_overlay.py.
◆ img_extent_meters
Definition at line 154 of file mapgen_overlay.py.
◆ imgheight
Definition at line 164 of file mapgen_overlay.py.
◆ imgwidth
Definition at line 163 of file mapgen_overlay.py.
◆ key
| key |
Definition at line 143 of file mapgen_overlay.py.
◆ label
| label |
Definition at line 190 of file mapgen_overlay.py.
◆ labelgrid
Definition at line 201 of file mapgen_overlay.py.
◆ labelsize
| int labelsize = 14 * (figheight / 14.0) |
Definition at line 197 of file mapgen_overlay.py.
◆ lats
| def lats = calculate_gridline_increments(pinfo['south'],pinfo['north']) |
Definition at line 216 of file mapgen_overlay.py.
◆ left
| left |
Definition at line 246 of file mapgen_overlay.py.
◆ linewidth
| linewidth |
Definition at line 194 of file mapgen_overlay.py.
◆ lons
| def lons = calculate_gridline_increments(pinfo['west'],pinfo['east']) |
Definition at line 215 of file mapgen_overlay.py.
◆ None
| None |
Definition at line 103 of file mapgen_overlay.py.
◆ norm
Definition at line 227 of file mapgen_overlay.py.
◆ ofile
| string ofile = args.ofile |
Definition at line 128 of file mapgen_overlay.py.
◆ ofilePath
| ofilePath = Path(args.ifile) |
Definition at line 130 of file mapgen_overlay.py.
◆ origin
| origin |
Definition at line 186 of file mapgen_overlay.py.
◆ pad_inches
| pad_inches |
Definition at line 248 of file mapgen_overlay.py.
◆ padheight
| padheight = np.ceil(imgwidth*0.3) |
Definition at line 166 of file mapgen_overlay.py.
◆ padwidth
| padwidth = np.ceil(imgheight*0.3) |
Definition at line 167 of file mapgen_overlay.py.
◆ parser
| parser = argparse.ArgumentParser(description="add overlays to mapped PNG images output from mapgen (or l3mapgen)") |
Definition at line 101 of file mapgen_overlay.py.
◆ pinfo
| dictionary pinfo = {} |
Definition at line 137 of file mapgen_overlay.py.
◆ pinfofile
| string pinfofile = args.projinfo |
Definition at line 133 of file mapgen_overlay.py.
◆ pinfokeys
| list pinfokeys = ['minX','maxX','minY','maxY','north','south','east','west','datamin','datamax','scale_type','proj'] |
Definition at line 149 of file mapgen_overlay.py.
◆ resolution
| resolution |
Definition at line 194 of file mapgen_overlay.py.
◆ right
| right |
Definition at line 246 of file mapgen_overlay.py.
◆ size
| size |
Definition at line 242 of file mapgen_overlay.py.
◆ str
Definition at line 102 of file mapgen_overlay.py.
◆ top
| top |
Definition at line 246 of file mapgen_overlay.py.
◆ transform
| transform |
Definition at line 186 of file mapgen_overlay.py.
◆ transparent
| transparent |
Definition at line 248 of file mapgen_overlay.py.
◆ type
| type |
Definition at line 102 of file mapgen_overlay.py.
◆ value
| value |
Definition at line 143 of file mapgen_overlay.py.
◆ xlabel_style
| xlabel_style |
Definition at line 212 of file mapgen_overlay.py.
◆ xlines
| xlines |
Definition at line 210 of file mapgen_overlay.py.
◆ xlocator
| xlocator |
Definition at line 218 of file mapgen_overlay.py.
◆ ylabel_style
| ylabel_style |
Definition at line 213 of file mapgen_overlay.py.
◆ ylines
| ylines |
Definition at line 211 of file mapgen_overlay.py.
◆ ylocator
| ylocator |
Definition at line 219 of file mapgen_overlay.py.


