Dialogs for manipulating formatoptions.
Classes:
|
A dialog to modify the basemap settings. |
|
A dialog to modify color bounds and colormaps. |
|
A preview widget of a colorbar. |
|
A dummy plotter for the colorbar preview. |
|
A widget to update a formatoption. |
|
A dialog to change labels. |
|
A widget to change a formatoption. |
- class psy_view.dialogs.BasemapDialog(plotter: Plotter, *args, **kwargs)[source]
Bases:
QDialogA dialog to modify the basemap settings.
Attributes:
A box for selecting the background image
Button box to cancel the operator or update the plotter
colors that affect the map background
Get default colors for the color labels in
widgets.group box drawing grid lines and labels
group box for modifying the resolution of the land-sea-mask, see
opt_110m,opt_50m,opt_10mGroup box for options specific to meridionals (see
opt_meri_auto,opt_meri_atandopt_meri_every,opt_meri_num)Radiobutton for 10m resolution of lsm
Radiobutton for 110m resolution of lsm
Radiobutton for 50m resolution of lsm
Radio button for using the
google_map_detailformatoptionRadiobutton for giving the exact position of meridionals (see
txt_meri_at)Radiobutton for automatic drawing of meridionals
Radiobutton for equal-width spaced meridionals (see
txt_meri_every)Radiobutton to draw a specific number of meridionals with equal-distance (see also
txt_meri_num)Radiobutton for giving the exact position of parallels (see
txt_para_at)Radiobutton for automatic drawing of parallels
Radiobutton for equal-width spaced parallels (see
txt_para_every)Radiobutton to draw a specific number of parallels with equal-distance (see also
txt_para_num)Radio button for using the
stock_imageformatoptionGroup box for options specific to parallels (see
opt_para_auto,opt_para_atandopt_para_every,opt_para_num)Test box for specifying the detail
text box for the central latitude (clat formatoption)
text box for the central longitude (clon formatoption)
text box for the fontsize of grid labels
Text field to enter the location of the meridionals on the map (see
opt_meri_at)Text box to specify the distance between two meridionals (see
opt_meri_every)Text box to set the number of meridionals to be shown (see
opt_meri_num)Text field to enter the location of the parallels on the map (see
opt_para_at)Text box to specify the distance between two parallels (see
opt_para_every)Text box to set the number of parallels to be shown (see
opt_para_num)Get the formatoptions of this dialog to update a plotter.
Methods:
fill_from_plotter(plotter)Fill the dialog from a given plotter.
get_colors(plotter)Get the colors for
widgetsfrom the plotter formatoptions.Update text widgets for the options to draw merdionals and parallels.
update_plotter(plotter)Open a
BasemapDialogto update a plotter.- background_img_box
A box for selecting the background image
- button_box
Button box to cancel the operator or update the plotter
- colors
colors that affect the map background
- fill_from_plotter(plotter: Plotter) None[source]
Fill the dialog from a given plotter.
- Parameters:
plotter (psy_maps.plotters.MapPlotter) – The plotter to get the formatoptions from.
- get_colors(plotter: Plotter) Dict[str, Any][source]
Get the colors for
widgetsfrom the plotter formatoptions.- Parameters:
plotter (psy_maps.plotters.MapPlotter) – The plotter with the formatoptions
- Returns:
A mapping from formatoptions in
colorsto the corresponding color in the plotter.- Return type:
- grid_labels_box
group box drawing grid lines and labels
- lsm_box
group box for modifying the resolution of the land-sea-mask, see
opt_110m,opt_50m,opt_10m
- meridionals_box
Group box for options specific to meridionals (see
opt_meri_auto,opt_meri_atandopt_meri_every,opt_meri_num)
- opt_10m
Radiobutton for 10m resolution of lsm
- opt_110m
Radiobutton for 110m resolution of lsm
- opt_50m
Radiobutton for 50m resolution of lsm
- opt_google_image
Radio button for using the
google_map_detailformatoption
- opt_meri_at
Radiobutton for giving the exact position of meridionals (see
txt_meri_at)
- opt_meri_auto
Radiobutton for automatic drawing of meridionals
- opt_meri_every
Radiobutton for equal-width spaced meridionals (see
txt_meri_every)
- opt_meri_num
Radiobutton to draw a specific number of meridionals with equal-distance (see also
txt_meri_num)
- opt_para_at
Radiobutton for giving the exact position of parallels (see
txt_para_at)
- opt_para_auto
Radiobutton for automatic drawing of parallels
- opt_para_every
Radiobutton for equal-width spaced parallels (see
txt_para_every)
- opt_para_num
Radiobutton to draw a specific number of parallels with equal-distance (see also
txt_para_num)
- opt_stock_img
Radio button for using the
stock_imageformatoption
- parallels_box
Group box for options specific to parallels (see
opt_para_auto,opt_para_atandopt_para_every,opt_para_num)
- sb_google_image
Test box for specifying the detail
- txt_clat
text box for the central latitude (clat formatoption)
- txt_clon
text box for the central longitude (clon formatoption)
- txt_grid_fontsize
text box for the fontsize of grid labels
- txt_meri_at
Text field to enter the location of the meridionals on the map (see
opt_meri_at)
- txt_meri_every
Text box to specify the distance between two meridionals (see
opt_meri_every)
- txt_meri_num
Text box to set the number of meridionals to be shown (see
opt_meri_num)
- txt_para_at
Text field to enter the location of the parallels on the map (see
opt_para_at)
- txt_para_every
Text box to specify the distance between two parallels (see
opt_para_every)
- txt_para_num
Text box to set the number of parallels to be shown (see
opt_para_num)
- classmethod update_plotter(plotter: Plotter) None[source]
Open a
BasemapDialogto update a plotter.- Parameters:
plotter (psy_maps.plotters.MapPlotter) – The plotter to update.
- class psy_view.dialogs.CmapDialog(project: Project, *args, **kwargs)[source]
Bases:
QDialogA dialog to modify color bounds and colormaps.
Attributes:
Button box to accept or cancel this dialog
ColorbarPreviewto show a preview of the colorbar with the selected formatoption infmt_widgetsMapping from formatoption key to
LabelWidgetLinewidgets to controlling the formatoptionMap from formatoption in
fmt_widgetsto values.Get the plotter with the formatoptions we use to fill this dialog.
tabs for switching between bounds (
bounds_widget) and colorbar ticks (cticks_widget)Methods:
Update the
cbar_previewfrom the variousfmt_widgets.update_project(project)Create a
CmapDialogto update a project- button_box
Button box to accept or cancel this dialog
- cbar_preview
ColorbarPreviewto show a preview of the colorbar with the selected formatoption infmt_widgets
- fmt_widgets
Mapping from formatoption key to
LabelWidgetLinewidgets to controlling the formatoption
- property fmts: Dict[str, Any]
Map from formatoption in
fmt_widgetsto values.
- tabs
tabs for switching between bounds (
bounds_widget) and colorbar ticks (cticks_widget)
- update_preview() None[source]
Update the
cbar_previewfrom the variousfmt_widgets.
- classmethod update_project(project: Project) None[source]
Create a
CmapDialogto update a projectThis classmethod creates a new
CmapDialoginstance, fills it with the formatoptions of the first plotter in project, enters the main event loop, and updates the project upon acceptance.- Parameters:
project (psyplot.project.Project) – The psyplot project to update
- psy_view.dialogs.Color(*args, **kwds) = typing.Any
Find a more appropriate description here
- Type:
TODO
- class psy_view.dialogs.ColorbarPreview(plotter: Plotter, parent: QWidget | None = None, *args, **kwargs)[source]
Bases:
FigureCanvasQTAggA preview widget of a colorbar.
This matplotlib figure contains one single axes to display the colorbar filled by the formatoptions of a given plotter.
Attributes:
Create a plotter with the formatoptions of the real
plotter.The plotter to use for displaying the colorbar
Methods:
init_colorbar(plotter)Initialize the colorbar.
resizeEvent(event)Reimplemented to make sure we cannot get smaller than 0.
update_colorbar(**kwargs)Update the colorbar with new formatoptions.
- property fake_plotter: FakePlotter
Create a plotter with the formatoptions of the real
plotter.We can update this plotter without impacting the origin
plotter
- init_colorbar(plotter: Plotter) None[source]
Initialize the colorbar.
This method extracts the formatoptions of the given plotter and draws the colorbar.
- plotter
The plotter to use for displaying the colorbar
- update_colorbar(**kwargs) None[source]
Update the colorbar with new formatoptions.
This method takes the
fake_plotter, updates it from the given kwargs, updates the colorbar preview.- Parameters:
**kwargs – bounds, cmap, cticks or cbar formatoption keyword-value pairs
- class psy_view.dialogs.FakePlotter(data=None, ax=None, auto_update=None, project=None, draw=False, make_plot=True, clear=False, enable_post=False, **kwargs)[source]
Bases:
PlotterA dummy plotter for the colorbar preview.
Attributes:
Dummy formatoption for static type checking.
Dummy formatoption for static type checking.
Dummy formatoption for static type checking.
Dummy formatoption for static type checking.
- bounds: Formatoption
Dummy formatoption for static type checking.
This is just a workaround for the static type checker to be able to tell what the
FakePlotterformatoptions are, used inColorbarPreview.fake_plotter
- cbar: Formatoption
Dummy formatoption for static type checking.
This is just a workaround for the static type checker to be able to tell what the
FakePlotterformatoptions are, used inColorbarPreview.fake_plotter
- cmap: Formatoption
Dummy formatoption for static type checking.
This is just a workaround for the static type checker to be able to tell what the
FakePlotterformatoptions are, used inColorbarPreview.fake_plotter
- cticks: Formatoption
Dummy formatoption for static type checking.
This is just a workaround for the static type checker to be able to tell what the
FakePlotterformatoptions are, used inColorbarPreview.fake_plotter
- class psy_view.dialogs.FormatoptionsEditor(fmto: Formatoption, *args, **kwargs)[source]
Bases:
QWidgetA widget to update a formatoption.
This widget is a light-weight version of the
psyplot_gui.fmt_widget.FormatoptionsWidgetclass. It contains a line editor and a text editor to set the value of a specific formatoption.Attributes:
A tool button to switch from the single line editor
line_editto the multi-line editortext_editCheck if the value in this editor differs from the original fmto.
The
Formatoptionthat fills this widgetValue of the
fmtoat the initialization of this widgetA single line editor holding the formatoption value (see also
text_editandbtn_multiline)True if the
text_editshould be visible.A multi-line editor holiding the value of
fmto(see alsoline_editandbtn_multiline)Load the value of
textwith yaml.Methods:
Clear the editor.
get_obj()Alias for
value.insert_obj(obj)Add a string to the formatoption widget.
set_obj(obj)Clear the editor and set another object.
- btn_multiline
A tool button to switch from the single line editor
line_editto the multi-line editortext_edit
- fmto
The
Formatoptionthat fills this widget
- line_edit
A single line editor holding the formatoption value (see also
text_editandbtn_multiline)
- text_edit
A multi-line editor holiding the value of
fmto(see alsoline_editandbtn_multiline)
- psy_view.dialogs.LSM_T(*args, **kwargs)
Find a more appropriate description here
- Type:
TODO
- class psy_view.dialogs.LabelDialog(project: Project, *fmts: str)[source]
Bases:
QDialogA dialog to change labels.
This class contains one
LabelWidgetLineper text formatoption.Attributes:
Mapping from formatoption key to value in this dialog.
Methods:
update_project(project, *fmts)Create a
LabelDialogto update the labels in a project.- classmethod update_project(project: Project, *fmts: str) None[source]
Create a
LabelDialogto update the labels in a project.This classmethod creates a new
LabelDialoginstance, fills it with the formatoptions of the first plotter in project, enters the main event loop, and updates the project upon acceptance.- Parameters:
project (psyplot.project.Project) – The psyplot project to update. Note that we will only use the very first plotter in this project
*fmts – The formatoption keys to display. Each formatoption should be a subclass of
psy_simple.base.TextBase
- class psy_view.dialogs.LabelWidgetLine(fmto: Formatoption, project: Project, fmto_widget: Type[QtWidgets.QWidget], widget_kws: Dict[str, Any] = {}, *args, **kwargs)[source]
Bases:
QGroupBoxA widget to change a formatoption.
This class holds a
FormatoptionsEditorto control the appearance of a specific formatoption. Additionally it displays the formatoption specific line widget (seepsyplot.plotter.Formatoption.get_fmt_widget()) to contol it.