Exemple #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]
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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()
Exemple #6
0
                    "  background-color: rgb(0, 0, 0);"
                    "  text-align: right;"
                    "  font-size: 11px;"
                    "  color: #FFFFFF;}")
grid2 = QtGui.QGridLayout()
grid2.setHorizontalSpacing(0)
grid2.setVerticalSpacing(0)
grid2.setContentsMargins(0, 0, 0, 0)
ur.setLayout(grid2)

speed_vs_height = plotSpeed(prof)
speed_vs_height.setObjectName("svh")
inferred_temp_advection = plotAdvection(prof)
hodo = plotHodo(prof.hght,
                prof.u,
                prof.v,
                prof=prof,
                centered=prof.mean_lcl_el)
storm_slinky = plotSlinky(prof)
#thetae_vs_pressure = plotThetae(prof)
thetae_vs_pressure = plotGeneric(prof.thetae[prof.pres > 500.],
                                 prof.pres[prof.pres > 500.],
                                 xticks=np.arange(320, 360, 10),
                                 yticks=np.arange(500, 1000, 100))
srwinds_vs_height = plotWinds(prof)
#srwinds_vs_height = plotGeneric(prof.srwind, prof.hght)
watch_type = plotWatch(prof)

grid2.addWidget(speed_vs_height, 0, 0, 11, 3)
grid2.addWidget(inferred_temp_advection, 0, 3, 11, 2)
grid2.addWidget(hodo, 0, 5, 8, 24)
Exemple #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]
Exemple #8
0
brand.setAlignment(QtCore.Qt.AlignRight)
brand.setStyleSheet("QFrame {"
                    "  background-color: rgb(0, 0, 0);"
                    "  text-align: right;"
                    "  font-size: 11px;"
                    "  color: #FFFFFF;}")
grid2 = QtGui.QGridLayout()
grid2.setHorizontalSpacing(0)
grid2.setVerticalSpacing(0)
grid2.setContentsMargins(0, 0, 0, 0)
ur.setLayout(grid2)

speed_vs_height = plotSpeed( prof )
speed_vs_height.setObjectName("svh")
inferred_temp_advection = plotAdvection(prof)
hodo = plotHodo(prof.hght, prof.u, prof.v, prof=prof, centered=prof.mean_lcl_el)
storm_slinky = plotSlinky(prof)
#thetae_vs_pressure = plotThetae(prof)
thetae_vs_pressure = plotGeneric(prof.thetae[prof.pres > 500.], prof.pres[prof.pres > 500.],
                                 xticks=np.arange(320,360,10), yticks=np.arange(500, 1000, 100) )
srwinds_vs_height = plotWinds(prof)
#srwinds_vs_height = plotGeneric(prof.srwind, prof.hght)
watch_type = plotWatch(prof)

grid2.addWidget(speed_vs_height, 0, 0, 11, 3)
grid2.addWidget(inferred_temp_advection, 0, 3, 11, 2)
grid2.addWidget(hodo, 0, 5, 8, 24)
grid2.addWidget(storm_slinky, 8, 5, 3, 6)
grid2.addWidget(thetae_vs_pressure, 8, 11, 3, 6)
grid2.addWidget(srwinds_vs_height, 8, 17, 3, 6)
grid2.addWidget(watch_type, 8, 23, 3, 6)