示例#1
0
    def initData(self):
        """
        Initializes all the widgets for the window.
        This gets initially called by __init__
        :return:
        """

        ## set the plot title that will be displayed in the Skew frame.
        self.plot_title = self.getPlotTitle()

        if self.isensemble:
            self.prof = self.profs[self.current_idx][0]
            default_pcl = self.prof.mupcl
            self.sound = plotSkewT(self.prof, pcl=self.prof.mupcl, title=self.plot_title, brand=self.brand,
                               proflist=self.profs[self.current_idx][:], dgz=self.dgz)
            self.hodo = plotHodo(self.prof.hght, self.prof.u, self.prof.v, prof=self.prof,
                                 proflist=self.profs[self.current_idx][:], parent=self)
        else:
            self.prof = self.profs[self.current_idx]
            default_pcl = self.prof.mupcl
            self.sound = plotSkewT(self.prof, pcl=default_pcl, title=self.plot_title, brand=self.brand,
                                   dgz=self.dgz, proflist=self.proflist)
            self.sound.updated.connect(self.updateProfs)
            self.sound.reset.connect(self.resetProf)
            self.hodo = plotHodo(self.prof.hght, self.prof.u, self.prof.v, prof=self.prof, parent=self,
                                 proflist=self.proflist)

        ## initialize the non-swappable insets
        self.speed_vs_height = plotSpeed( self.prof )

        self.inferred_temp_advection = plotAdvection(self.prof)



        self.hodo.updated.connect(self.updateProfs)
        self.hodo.reset.connect(self.resetProf)

        self.storm_slinky = plotSlinky(self.prof, pcl=default_pcl)
        self.thetae_vs_pressure = plotGeneric(self.prof.thetae[self.prof.pres > 500.],
                                self.prof.pres[self.prof.pres > 500.], xticks=np.arange(220,360,10),
                                 yticks=np.arange(500, 1000, 100), title="ThetaE v.\nPres" )

        self.srwinds_vs_height = plotWinds(self.prof)
        self.watch_type = plotWatch(self.prof)
        self.convective = plotText(self.prof, self.parcel_types)
        self.kinematic = plotKinematics(self.prof)

        self.convective.updatepcl.connect(self.updateParcel)

        self.makeInsets()
        self.insets["SARS"].updatematch.connect(self.updateSARS)
        self.right_inset_ob = self.insets[self.right_inset]
        self.left_inset_ob = self.insets[self.left_inset]
示例#2
0
    def initData(self):
        """
        Initializes all the widgets for the window.
        This gets initially called by __init__
        :return:
        """
        logging.debug("Initializing all widgets in the SPCWindow.")

        self.sound = plotSkewT(dgz=self.dgz, pbl=self.pbl)
        #       self.sound.setPreferences(temp_color=temp_color, dewp_color=dewp_color, update_gui=False)
        self.hodo = plotHodo()

        ## initialize the non-swappable insets
        self.speed_vs_height = plotSpeed()
        self.inferred_temp_advection = plotAdvection()
        self.storm_slinky = plotSlinky()
        self.thetae_vs_pressure = plotThetae()
        self.srwinds_vs_height = plotWinds()
        self.watch_type = plotWatch()
        self.convective = plotText(self.parcel_types)
        self.kinematic = plotKinematics()

        # initialize swappable insets
        for inset, inset_gen in SPCWidget.inset_generators.items():
            self.insets[inset] = inset_gen()


#            self.insets[inset].setParent(self.text)

        self.updateConfig(self.config, update_gui=False)

        self.right_inset_ob = self.insets[self.right_inset]
        self.left_inset_ob = self.insets[self.left_inset]

        # Connect signals to slots
        self.convective.updatepcl.connect(self.updateParcel)

        self.sound.parcel.connect(self.defineUserParcel)
        self.sound.modified.connect(self.modifyProf)
        self.sound.reset.connect(self.resetProfModifications)
        self.sound.cursor_toggle.connect(self.hodo.cursorToggle)
        self.sound.cursor_move.connect(self.hodo.cursorMove)

        self.hodo.modified.connect(self.modifyProf)
        self.hodo.modified_vector.connect(self.modifyVector)
        self.hodo.reset.connect(self.resetProfModifications)
        self.hodo.reset_vector.connect(self.resetVector)
        self.hodo.toggle_vector.connect(self.toggleVector)

        self.insets["SARS"].updatematch.connect(self.updateSARS)
示例#3
0
    def initData(self):
        """
        Initializes all the widgets for the window.
        This gets initially called by __init__
        :return:
        """

        self.sound = plotSkewT(dgz=self.dgz)
        self.hodo = plotHodo()

        ## initialize the non-swappable insets
        self.speed_vs_height = plotSpeed()
        self.inferred_temp_advection = plotAdvection()
        self.storm_slinky = plotSlinky()
        self.thetae_vs_pressure = plotThetae()
        self.srwinds_vs_height = plotWinds()
        self.watch_type = plotWatch()
        self.convective = plotText(self.parcel_types)
        self.kinematic = plotKinematics()

        # intialize swappable insets
        for inset, inset_gen in SPCWidget.inset_generators.iteritems():
            self.insets[inset] = inset_gen()

        self.right_inset_ob = self.insets[self.right_inset]
        self.left_inset_ob = self.insets[self.left_inset]

        # Connect signals to slots
        self.convective.updatepcl.connect(self.updateParcel)

        self.sound.parcel.connect(self.defineUserParcel)
        self.sound.modified.connect(self.modifyProf)
        self.sound.reset.connect(self.resetProfModifications)

        self.hodo.modified.connect(self.modifyProf)
        self.hodo.reset.connect(self.resetProfModifications)

        self.insets["SARS"].updatematch.connect(self.updateSARS)
示例#4
0
    def initData(self):
        """
        Initializes all the widgets for the window.
        This gets initially called by __init__
        :return:
        """

        self.sound = plotSkewT(dgz=self.dgz)
        self.hodo = plotHodo()

        ## initialize the non-swappable insets
        self.speed_vs_height = plotSpeed()
        self.inferred_temp_advection = plotAdvection()
        self.storm_slinky = plotSlinky()
        self.thetae_vs_pressure = plotThetae()
        self.srwinds_vs_height = plotWinds()
        self.watch_type = plotWatch()
        self.convective = plotText(self.parcel_types)
        self.kinematic = plotKinematics()

        # intialize swappable insets
        for inset, inset_gen in SPCWidget.inset_generators.iteritems():
            self.insets[inset] = inset_gen()

        self.right_inset_ob = self.insets[self.right_inset]
        self.left_inset_ob = self.insets[self.left_inset]

        # Connect signals to slots
        self.convective.updatepcl.connect(self.updateParcel)

        self.sound.parcel.connect(self.defineUserParcel)
        self.sound.modified.connect(self.modifyProf)
        self.sound.reset.connect(self.resetProfModifications)

        self.hodo.modified.connect(self.modifyProf)
        self.hodo.reset.connect(self.resetProfModifications)

        self.insets["SARS"].updatematch.connect(self.updateSARS)
示例#5
0
    def initData(self):
        """
        Initializes all the widgets for the window.
        This gets initially called by __init__
        :return:
        """

        ## set the plot title that will be displayed in the Skew frame.
        if self.model != "Observed" and self.model != "Archive":
            self.plot_title = self.loc + ' ' + datetime.strftime(self.d.dates[self.prof_idx[self.current_idx]], "%Y%m%d/%H%M") \
                + "  (" + self.run + "  " + self.model + ")"

        if self.model == "SREF":
            self.prof = self.profs[self.current_idx][0]
            self.sound = plotSkewT(self.prof, pcl=self.prof.mupcl, title=self.plot_title, brand=self.brand,
                               proflist=self.profs[self.current_idx][:])
        else:
            self.prof = self.profs[self.current_idx]
            self.sound = plotSkewT(self.prof, pcl=self.prof.mupcl, title=self.plot_title, brand=self.brand)

        ## initialize the non-swappable insets
        self.speed_vs_height = plotSpeed( self.prof )
        self.inferred_temp_advection = plotAdvection(self.prof)
        self.hodo = plotHodo(self.prof.hght, self.prof.u, self.prof.v, prof=self.prof, parent=self)

        self.storm_slinky = plotSlinky(self.prof)
        self.thetae_vs_pressure = plotGeneric(self.prof.thetae[self.prof.pres > 500.],
                                self.prof.pres[self.prof.pres > 500.], xticks=np.arange(220,360,10),
                                 yticks=np.arange(500, 1000, 100), title="ThetaE v.\nPres" )

        self.srwinds_vs_height = plotWinds(self.prof)
        self.watch_type = plotWatch(self.prof)

        self.convective = plotText(self.prof)
        self.kinematic = plotKinematics(self.prof)

        self.makeInsets()
示例#6
0
urparent_grid.addWidget(ur, 1, 0, 50, 0)
grid.addWidget(urparent, 0, 1, 3, 1)

# Handle the Text Areas
text = QtWidgets.QFrame()
text.setStyleSheet("QWidget {"
                   "  background-color: rgb(0, 0, 0);"
                   "  border-width: 2px;"
                   "  border-style: solid;"
                   "  border-color: #3399CC;}")
grid3 = QtGui.QGridLayout()
grid3.setHorizontalSpacing(0)
grid3.setContentsMargins(0, 0, 0, 0)
text.setLayout(grid3)
convective = plotText(prof)
#convective = QtWidgets.QFrame()
#kinematic = QtWidgets.QFrame()
kinematic = plotKinematics(prof)
SARS = plotAnalogues(prof)
stp = plotSTP(prof)
grid3.addWidget(convective, 0, 0)
grid3.addWidget(kinematic, 0, 1)
grid3.addWidget(SARS, 0, 2)
grid3.addWidget(stp, 0, 3)
grid.addWidget(text, 3, 0, 1, 2)
pixmap = QtGui.QPixmap.grabWidget(mainWindow)
pixmap.save('skewt.png', 'PNG', 100)
mainWindow.show()

app.exec_()
示例#7
0
    def initData(self):
        """
        Initializes all the widgets for the window.
        This gets initially called by __init__
        :return:
        """

        ## set the plot title that will be displayed in the Skew frame.
        self.plot_title = self.getPlotTitle()

        if self.model == "SREF":
            self.prof = self.profs[self.current_idx][0]
            self.sound = plotSkewT(self.prof,
                                   pcl=self.prof.mupcl,
                                   title=self.plot_title,
                                   brand=self.brand,
                                   proflist=self.profs[self.current_idx][:],
                                   dgz=self.dgz)
            self.hodo = plotHodo(self.prof.hght,
                                 self.prof.u,
                                 self.prof.v,
                                 prof=self.prof,
                                 proflist=self.profs[self.current_idx][:],
                                 parent=self)
        else:
            self.prof = self.profs[self.current_idx]
            self.sound = plotSkewT(self.prof,
                                   pcl=self.prof.mupcl,
                                   title=self.plot_title,
                                   brand=self.brand,
                                   dgz=self.dgz,
                                   proflist=self.proflist)
            self.sound.updated.connect(self.updateProfs)
            self.sound.reset.connect(self.resetProf)
            self.hodo = plotHodo(self.prof.hght,
                                 self.prof.u,
                                 self.prof.v,
                                 prof=self.prof,
                                 parent=self,
                                 proflist=self.proflist)

        ## initialize the non-swappable insets
        self.speed_vs_height = plotSpeed(self.prof)

        self.inferred_temp_advection = plotAdvection(self.prof)

        self.hodo.updated.connect(self.updateProfs)
        self.hodo.reset.connect(self.resetProf)

        self.storm_slinky = plotSlinky(self.prof)
        self.thetae_vs_pressure = plotGeneric(
            self.prof.thetae[self.prof.pres > 500.],
            self.prof.pres[self.prof.pres > 500.],
            xticks=np.arange(220, 360, 10),
            yticks=np.arange(500, 1000, 100),
            title="ThetaE v.\nPres")

        self.srwinds_vs_height = plotWinds(self.prof)
        self.watch_type = plotWatch(self.prof)
        self.convective = plotText(self.prof, self.parcel_types)
        self.kinematic = plotKinematics(self.prof)

        self.convective.updatepcl.connect(self.updateParcel)

        self.makeInsets()
        self.insets["SARS"].updatematch.connect(self.updateSARS)
        self.right_inset_ob = self.insets[self.right_inset]
        self.left_inset_ob = self.insets[self.left_inset]
示例#8
0
urparent_grid.addWidget(ur, 1, 0, 50, 0)
grid.addWidget(urparent, 0, 1, 3, 1)

# Handle the Text Areas
text = QtGui.QFrame()
text.setStyleSheet("QWidget {"
                   "  background-color: rgb(0, 0, 0);"
                   "  border-width: 2px;"
                   "  border-style: solid;"
                   "  border-color: #3399CC;}")
grid3 = QtGui.QGridLayout()
grid3.setHorizontalSpacing(0)
grid3.setContentsMargins(0, 0, 0, 0)
text.setLayout(grid3)
convective = plotText(prof)
#convective = QtGui.QFrame()
#kinematic = QtGui.QFrame()
kinematic = plotKinematics(prof)
SARS = plotAnalogues(prof)
stp = plotSTP(prof)
grid3.addWidget(convective, 0, 0)
grid3.addWidget(kinematic, 0, 1)
grid3.addWidget(SARS, 0, 2)
grid3.addWidget(stp, 0, 3)
grid.addWidget(text, 3, 0, 1, 2)
pixmap = QtGui.QPixmap.grabWidget(mainWindow)
pixmap.save('skewt.png', 'PNG', 100)
mainWindow.show()

app.exec_()