| 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('-K','--marker',action='store',dest='marker',type="string",default=None,help="[1D] Define a new marker") |
|---|
| 13 | parser.add_option('-P','--proj',action='store',dest='proj',type="string",default=None,help='[2D] Define a new map projection') |
|---|
| 14 | parser.add_option('-C','--colorb',action='store',dest='colorb',type="string",default=None,help="[2D] Define a new colormap") |
|---|
| 15 | (opt,args) = parser.parse_args() |
|---|
| 16 | # ----------------------------------------------------------------------- |
|---|
| 17 | for files in args: |
|---|
| 18 | yeah = pp() |
|---|
| 19 | yeah.defineplot(loadfile=files) |
|---|
| 20 | yeah.out = opt.out |
|---|
| 21 | if opt.proj is not None: |
|---|
| 22 | for plot in yeah.p: |
|---|
| 23 | plot.proj = opt.proj |
|---|
| 24 | if opt.colorb is not None: |
|---|
| 25 | for plot in yeah.p: |
|---|
| 26 | plot.colorb = opt.colorb |
|---|
| 27 | if opt.marker is not None: |
|---|
| 28 | for plot in yeah.p: |
|---|
| 29 | plot.marker = opt.marker |
|---|
| 30 | yeah.makeplot() |
|---|
| 31 | |
|---|