Calipso

The main class of the application. Calipso manages all Tkinter and widget related entities, and ensures all parts of the GUI are initialized and created before the start of the program.

if __name__ == "__main__":
    rt = Tk()
    program = Calipso(rt)       # Create main GUI window

    program.setupWindow()       # create window in center screen
    program.setupMenu()         # create top menu
    program.setupMainScreen()   # create top buttons, initialize child and display base_plt

    rt.mainloop()               # program main loop
    os._exit(1)

The order of functions calls in the beginning of the program is as follows:

__init__
setupWindow
setupMenu
setupMainScreen
    |-> calls createTopScreenGUI
    |-> calls createChildWindowGUI
    |-> calls selPlot(BASE_PLOT)
Inheritance diagram of Calipso
class Calipso(r)[source]

Main class of the application, handles all GUI related events as well as creating other GUI windows such as the toolbar or import dialog

about()[source]

Simple TopLevel window displaying the authors

attribute_dialog(event)[source]

Open attribute window for specifying attributes on objects

Parameters:event – A Tkinter passed event object
close()[source]

Checks if the all the shapes are saved. If a shape is unsaved, the program will ask the user whether save or not, and then close the program. Also saves the session settings to the config.json file

static create_db()[source]

Opens a file browser to create a database file for polygons :return:

export_db(only_selected=False)[source]

Notify the database that a save is taking place, the db will then save all polygons present on the screen

static export_json_db()[source]

Export the contents of the database to an archive containing JSON, which can then be loaded into other databases and have all shapes imported

extract_dialog(event)[source]

Opens a subwindow that displays the data bounded by the shape

Parameters:event – A Tkinter passed event object
get_fig()[source]

Returns the figure that is plotted to the canvas

Return type:SubplotAxes
get_file()[source]

Return the current HDF file being displayed

Type:str
get_root()[source]

Return the root of the application

Return type:A Tkinter root
get_shapemanager()[source]

Returns the internal polygonList object

Return type:polygon.manager.ShapeManager
get_toolbar()[source]

Returns the internal toolbar object

Return type:tools.navigationtoolbar.NavigationToolbar2CALIPSO
import_dialog()[source]

Open the database import window allowing the user to import and delete entries.

import_file()[source]

Load an HDF file for use with displaying backscatter and depolarized images

static import_json_db()[source]

Import the contents of a JSON file to the database, works hand in hand with the export_json_db class method. This will allows users to share their database without needing to manually move their db file. :return:

load()[source]

load JSON objects from file by calling polygonlist.readPlot(f)()

paint(event)[source]

Opens the paint window for specifying the shape’s color

Parameters:event – A Tkinter passed event object
pan(event)[source]

Saves initial coordinates of mouse press when the user begins to pan

Parameters:event – Tkinter passed event object
render_pan(event)[source]

Saves ending coordinates of mouse press and proceeds to find the distance between the two points, scrolls the map accordingly

Parameters:event – Tkinter passed event object
reset()[source]

Reset all objects on the screen, move pan to original

save_as_json(save_all=False)[source]

Save all selected objects on the plot, asking for a filename first

if save_all is specified and set to True, the function will save all shapes across all plots in the program.

save_json()[source]

DEPRECATED

Save all shapes on the map inside a JSON object given a previously saved file. If no file exists prompt for file

static select_db()[source]

Opens a file browser to select a database if one is not already chosen

Parameters:iscommand – Make True if we are executing from the menu command
Returns:Return 0 if no file was selected
set_plot(plot_type, xrange_=(0, 1000), yrange=(0, 20))[source]

Draws to the canvas according to the plot_type specified in the arguments. Accepts one of the attributes below

BASE_PLOT
BACKSCATTERED
DEPOLARIZED
VFM
IWP
HORIZ_AVG
AEROSOL_SUBTYPE
Parameters:
  • plot_type (int) – accepts ``BASE_PLOT, BACKSCATTERED, DEPOLARIZED, VFM, IWP, HORIZ_AVG
  • xrange_ (list) – accepts a range of time to plot
  • yrange (list) – accepts a range of altitude to plot
settings_dialog()[source]

Opens the settings window allowing the user to manually change the settings in the config file

setup_main_screen()[source]

Setup the top GUI, initialize toolbar window and set the plot to a blank image

setup_menu()[source]

Creates a drop down menu bar at the top of the tool

setup_window()[source]

Sets the title of root and places window on screen

update_shape_optionmenu(event)[source]

Callback function bound to <ButtonPress-1> which displays the current list of shapes on the plot to the option menu. All tags are grabbed which can then be selected by the user to see which object they are looking for.

Parameters:event – Tkinter passed event object, ignored