1 | #! /usr/bin/env python |
---|
2 | # ----------------------------------------------------------------------- |
---|
3 | # A very simple script to reload a previously saved plot array in ppclass |
---|
4 | # ... for a demo, try "pp_reload.py demo_data/*" |
---|
5 | # Author: A. Spiga 03/2013 |
---|
6 | # ----------------------------------------------------------------------- |
---|
7 | from optparse import OptionParser ### TBR by argparse |
---|
8 | from ppclass import pp |
---|
9 | # ----------------------------------------------------------------------- |
---|
10 | parser = OptionParser() |
---|
11 | parser.add_option('-O','--out',action='store',dest='out',type="string",default="gui",help='Specify a new output format') |
---|
12 | parser.add_option('-T','--title',action='store',dest='title',type="string",default=None,help='Give a new title') |
---|
13 | parser.add_option('-K','--marker',action='store',dest='marker',type="string",default=None,help="[1D] Define a new marker") |
---|
14 | parser.add_option('-P','--proj',action='store',dest='proj',type="string",default=None,help='[2D] Define a new map projection') |
---|
15 | parser.add_option('-C','--colorb',action='store',dest='colorb',type="string",default=None,help="[2D] Define a new colormap") |
---|
16 | (opt,args) = parser.parse_args() |
---|
17 | # ----------------------------------------------------------------------- |
---|
18 | for files in args: |
---|
19 | yeah = pp() |
---|
20 | yeah.defineplot(loadfile=files) |
---|
21 | yeah.out = opt.out |
---|
22 | if opt.proj is not None: |
---|
23 | for plot in yeah.p: |
---|
24 | plot.proj = opt.proj |
---|
25 | if opt.colorb is not None: |
---|
26 | for plot in yeah.p: |
---|
27 | plot.colorb = opt.colorb |
---|
28 | if opt.marker is not None: |
---|
29 | for plot in yeah.p: |
---|
30 | plot.marker = opt.marker |
---|
31 | if opt.title is not None: |
---|
32 | for plot in yeah.p: |
---|
33 | plot.title = opt.title |
---|
34 | yeah.makeplot() |
---|
35 | |
---|