ocean_model_skill_assessor.plot.map#
Plot map.
Functions
|
Plot catalog on map with optional model domain polygon. |
|
Plot and save to file map of model domain and data locations. |
|
Basic plot setup for map. |
- ocean_model_skill_assessor.plot.map.plot_cat_on_map(catalog, paths, source_names=None, figname=None, remove_duplicates=None, **kwargs_map)[source]#
Plot catalog on map with optional model domain polygon.
- Parameters:
catalog (Union[Catalog,str]) – Which catalog of datasets to plot on map.
paths (Paths) – Paths object for finding paths to use.
source_names (list) – Use these list names instead of list(cat) if input.
remove_duplicates (function, optional) – If True, take the set of the source in catalog based on the spatial locations so they are not repeated in the map.
remove_duplicates – Input a function that takes in maps and return maps, and in between removes duplicate entries.
Examples
After creating catalog with intake-erddap, look at data locations:
>>> omsa.plot.map.plot_cat_on_map(catalog=catalog_name, project_name=project_name)
- ocean_model_skill_assessor.plot.map.plot_map(maps, figname, extent=None, p=None, label_with_station_name=False, dd=[0.0, 0.0], annotate=True, annotate_fontsize=12, figsize=(8, 7), two_maps=None, map_font_size=12, markersize=5, markeredgewidth=0.5, linewidth_data=3, linewidth_poly=2, alpha_marker=1.0, colors_data='k', legend=False, loc='best', suptitle=None, suptitle_fontsize=16, tight_layout=True)[source]#
Plot and save to file map of model domain and data locations.
- Parameters:
maps (array) – Info about datasets. [min_lon, max_lon, min_lat, max_lat, source_name]. Can have optional 6th element in the list for what type of representation to use in the plot: “point”, “box”, or “line”. If the type isn’t input and maxlons don’t equal minlon, assume box to plot instead of line.
figname (Union[str, PurePath]) – Map will be saved here.
extent (optional) – [min longitude, max longitude, min latitude, max latitude]
p (Shapely polygon) – Polygon representing outer boundary of numerical model.
label_with_station_name (bool) – If True, use station names to label instead of a counter from 0 to number of stations - 1.
dd (list) – Distance [x,y] to push the annotation away from the min lon/lat of a station. To input per station, make list of lists that is the same size as the number of stations.
annotate (bool) – True to annotate.
annotate_fontsize (int) – Fontsize for annotations
figsize (tuple) – Figure size for matplotlib
two_maps (dict) –
Plot two maps side by side: presumably a zoomed-out version on the left (“extent_left”) with a box showing the area enclosed by the magnified map on the right (“extent_right”). The data locations are only plotted in the right-hand map. You can also input “width_ratios” to shift the width between the map and the magnified map.
Example usage:
two_maps = dict(extent_left=[1,4,1,4], extent_right=[2,3,2,3], width_ratios=[0.67, 1.33])
map_font_size (int) – Font size for grid labels.
markersize (int) – Markersize for points. Default is 5.
markeredgewidth (float) – Edge width for markers for points (black line). Default is 0.5.
linewidth_data (int) – Line width for plotting data when it involves lines.
linewidth_poly (int) – Line width for plotting polygon.
alpha_marker (float) – alpha for markers for points
colors_data (str) – One color to use for all or colors in a list matching number of stations.
legend (bool) – True for legend instead of annotations.
loc (str) – legend location for matplotlib. Default “best”.
suptitle (str) – Title for top of the figure, overall.
suptitle_fontsize (int) – Fontsize for suptitle. Default is 16.
tight_layout (bool) – Whether to use tight_layout when have 2 maps.