Example #1
0
    def fg2html(self, framenos='all'):
        if self.plotdir is None:
            self.plotdir = '_fgplots_fg%s' % str(self.fgno).zfill(2)
        startdir = os.getcwd()
        self.outdir = os.path.abspath(self.outdir)
        plotpages.cd_with_mkdir(self.plotdir, overwrite=True)
        self.save_png = True

        ppd = plotpages.PlotPagesData()
        ppd.timeframes_frametimes = {}

        if framenos == 'all':
            framenos = range(1, 200)

        for frameno in framenos:
            try:
                grid, solution = self.get_frame(frameno)
                t = solution.t
                ppd.timeframes_frametimes[frameno] = t
                self.plotfg(frameno)
            except IOError:
                break
            draw()

        os.chdir(startdir)
        ppd.plotdir = self.plotdir
        ppd.html_index_fname = "_PlotIndex_FixedGrid%s.html" \
            % str(self.fgno).zfill(2)
        ppd.html_index_title = "Fixed Grids Plot Index"
        ppd.timeframes_prefix = 'FixedGrid%sFrame' % str(self.fgno).zfill(2)
        ppd.html_homelink = "_PlotIndex.html"
        ppd.timeframes_fignames[150] = 'Surface'
        ppd.timeframes_fignames[151] = 'Inundation'
        ppd.timeframes_fignames[152] = 'Exposed seafloor'
        plotpages.timeframes2html(ppd)
Example #2
0
    def fg2html(self,framenos='all'):
        if self.plotdir is None:
            self.plotdir='_fgplots_fg%s' % str(self.fgno).zfill(2)
        startdir = os.getcwd()
        self.outdir = os.path.abspath(self.outdir)
        plotpages.cd_with_mkdir(self.plotdir, overwrite=True)
        self.save_png = True

        ppd = plotpages.PlotPagesData()
        ppd.timeframes_frametimes = {}

        if framenos=='all':
            framenos = range(1,200)
    
        for frameno in framenos:
            try:
                grid, solution = self.get_frame(frameno)
                t = solution.t
                ppd.timeframes_frametimes[frameno] = t
                self.plotfg(frameno)
            except IOError:
                break
            draw()
    
        os.chdir(startdir)
        ppd.plotdir = self.plotdir
        ppd.html_index_fname = "_PlotIndex_FixedGrid%s.html" \
            % str(self.fgno).zfill(2)
        ppd.html_index_title = "Fixed Grids Plot Index"
        ppd.timeframes_prefix='FixedGrid%sFrame' % str(self.fgno).zfill(2)
        ppd.html_homelink = "_PlotIndex.html"
        ppd.timeframes_fignames[150] = 'Surface'
        ppd.timeframes_fignames[151] = 'Inundation'
        ppd.timeframes_fignames[152] = 'Exposed seafloor'
        plotpages.timeframes2html(ppd)
Example #3
0
def fg2html(fgno=1, outdir='_output'):
    plotdir = '_fgplots_fg%s' % fgno
    startdir = os.getcwd()
    outdir = os.path.abspath(outdir)
    plotpages.cd_with_mkdir(plotdir, overwrite=True)

    for frameno in range(1, 100):
        try:
            fg = plotfg(fgno, frameno, outdir, save_png=True)
        except IOError:
            break
        draw()

    os.chdir(startdir)
    ppd = plotpages.PlotPagesData()
    ppd.timeframes_prefix = 'FixedGrid%sFrame' % str(fgno).zfill(2)
    plotpages.timeframes2html(ppd)
Example #4
0
def fg2html(fgno=1, outdir='_output'):
    plotdir='_fgplots_fg%s' % fgno
    startdir = os.getcwd()
    outdir = os.path.abspath(outdir)
    plotpages.cd_with_mkdir(plotdir, overwrite=True)

    for frameno in range(1,100):
        try:
            fg = plotfg(fgno, frameno, outdir, save_png=True)
        except IOError:
            break
        draw()

    os.chdir(startdir)
    ppd = plotpages.PlotPagesData()
    ppd.timeframes_prefix='FixedGrid%sFrame' % str(fgno).zfill(2)
    plotpages.timeframes2html(ppd)