def get_plot(self, var, colorscale="Viridis",datascale="linear", ellipse=False):
        '''
        Return a plotly figure object for the available plot types set in set_plot()..
        colorscale = Viridis [default], Cividis, BlueRed or Rainbow
        '''
        
        self.gridSize=len(self._height)*len(self._lat)*len(self._lon)
        print(f'set_plot::colorscale={colorscale}, datascale={datascale}')
        print(f'Run: {self.runname}')
        #Set some text strings
        txtbot=f"Model: GITM, dt={self.dt:.4f} hrs, "+\
            f"dlat={self.dlat:.1f} deg, dlon={self.dlon:.1f} deg, dz={self.dz:.1f} km."
        #{self.gridSize} volume cells,
            
        #set plot variables
        xint, yint, nx, ny, kamodo_plot, xlabel, ylabel, xformat, yformat, \
            zformat, xunit, yunit, txttop, txtbar, result = RPlot.set_plotvar(self, datascale, var)
        if 'TimeLon' in self.plottype: 
            plot_flip = True
        elif 'TimeLat' in self.plottype and self.nDim==4:
            plot_flip = True
        else:
            plot_flip = False
            
        #get plot with chosen settings
        fig = RPlot.heatplot2D(xint, yint, plot_flip, nx, ny, result, datascale, kamodo_plot, 
               xlabel, ylabel, colorscale, txtbar, xformat, yformat, zformat, 
               xunit, yunit, txttop, txtbot, ellipse=ellipse)

        return fig
Exemple #2
0
    def get_plot(self,
                 var,
                 colorscale="Viridis",
                 datascale="linear",
                 ellipse=False):
        '''
        Return a plotly figure object for the available plot types set in set_plot()..
        colorscale = Viridis [default], Cividis, BlueRed or Rainbow
        '''

        #need to determine elat/elon vs lat/lon dependence here with dependencies
        arg_dict = self.variables[var]['xvec']
        if 'elon' in arg_dict.keys():
            self.dLON, self.nLON = self.delon, len(self._elon)
        else:
            self.dLON, self.nLON = self.dlon, len(self._lon)
        if 'elat' in arg_dict.keys():
            self.dLAT, self.nLAT = self.delat, len(
                self._elat)  #electric field latitude
        else:
            self.dLAT, self.nLAT = self.dlat, len(self._lat)
        self.gridSize = self.nLAT * self.nLON * self.numZ

        print(f'set_plot::colorscale={colorscale}, datascale={datascale}')
        print(f'Runname: {self.runname}')
        #Set some text strings
        txtbot=f"Model=CTIPe, dt={self.dt} hrs, dlat={self.dLAT} deg, "+\
            f"dlon={self.dLON} deg, dz={self.dz} {self.dzunit}" #{self.gridSize} volume cells,

        #set plot variables
        xint, yint, nx, ny, kamodo_plot, xlabel, ylabel, xformat, yformat, \
            zformat, xunit, yunit, txttop, txtbar, result = RPlot.set_plotvar(self, datascale, var)
        if 'TimeLon' in self.plottype:
            plot_flip = True
        elif 'TimeLat' in self.plottype and self.nDim == 4:
            plot_flip = True
        else:
            plot_flip = False

        #get plot with chosen settings
        fig = RPlot.heatplot2D(xint,
                               yint,
                               plot_flip,
                               nx,
                               ny,
                               result,
                               datascale,
                               kamodo_plot,
                               xlabel,
                               ylabel,
                               colorscale,
                               txtbar,
                               xformat,
                               yformat,
                               zformat,
                               xunit,
                               yunit,
                               txttop,
                               txtbot,
                               ellipse=ellipse)

        return fig
Exemple #3
0
    def get_plot(self,
                 var,
                 colorscale="Viridis",
                 datascale="linear",
                 ellipse=False):
        '''
        Return a plotly figure object for the available plot types set in set_plot()..
        colorscale = Viridis [default], Cividis, BlueRed or Rainbow
        '''

        #need to determine mlat/mlon vs lat/lon and ilev/lev/mlev dependence here with dependencies
        arg_dict = self.variables[var]['xvec']
        if 'mlat' in arg_dict.keys():
            self.dLON, self.nLON = self.dmlon, len(self._mlon)
            self.dLAT, self.nLAT = self.dmlat, len(self._mlat)
            self.dH, self.nH = self.dimlev, len(self._milev)
        else:
            self.dLON, self.nLON = self.dlon, len(self._lon)
            self.dLAT, self.nLAT = self.dlat, len(self._lat)
        #will eventually need logic here and elsewhere to deal with multiple ilev types******************
        self.gridSize = self.nLAT * self.nLON * self.numZ

        print(f'set_plot::colorscale={colorscale}, datascale={datascale}')
        print(f'Run: {self.runname}')
        #Set some text strings
        txtbot=f"Model: TIEGCM, dt={self.dt:.4f} hrs, "+\
            f"dlat={self.dlat:.1f} deg, dlon={self.dlon:.1f} deg, dz={self.dz:.1f} {self.dzunit}."
        #{self.gridSize} volume cells,

        #set plot variables
        xint, yint, nx, ny, kamodo_plot, xlabel, ylabel, xformat, yformat, \
            zformat, xunit, yunit, txttop, txtbar, result = RPlot.set_plotvar(self, datascale, var)
        if 'TimeLon' in self.plottype:
            plot_flip = True
        elif 'TimeLat' in self.plottype and self.nDim == 4:
            plot_flip = True
        else:
            plot_flip = False

        #get plot with chosen settings
        fig = RPlot.heatplot2D(xint,
                               yint,
                               plot_flip,
                               nx,
                               ny,
                               result,
                               datascale,
                               kamodo_plot,
                               xlabel,
                               ylabel,
                               colorscale,
                               txtbar,
                               xformat,
                               yformat,
                               zformat,
                               xunit,
                               yunit,
                               txttop,
                               txtbot,
                               ellipse=ellipse)

        return fig