Ignore:
Timestamp:
Mar 31, 2013, 10:18:37 PM (12 years ago)
Author:
aslmd
Message:

UTIL PYTHON planetoplot_v2

PPCLASS AND PPPLOT

  • added global plot settings in pp() objects
  • self is returned for each method to allow e.g. one-line get + attribution
  • added labeling of 1D plots
  • fine-tuning of plot appearance (e.g. vector key)
  • corrected a problem with plotin (same object can be referred to all along)
  • fixed meanarea for 1D requests

PP.PY

  • no more -f for pp.py (files are simply given as arguments!)
  • added missing options to pp.py
  • nice informative header

PP_RELOAD.PY

  • pp_reload.py can now change colorbars and 1D markers

EXAMPLES

  • general update of examples + few additions
  • added a nice example tide with mixed 2D+1D plots
Location:
trunk/UTIL/PYTHON/planetoplot_v2/examples
Files:
3 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/aire.py

    r921 r923  
    1111tpond.compute = "meanarea"
    1212tpond.superpose = True
     13tpond.label = "mean with ponderation by mesh area"
    1314tpond.getplot(extraplot=1)
    1415
     
    1718tnormal.compute = "mean"
    1819tnormal.plotin = tpond
     20tnormal.label = "simple mean (kind of wrong)"
     21tnormal.filename = "aire"
    1922tnormal.getplot()
    2023
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/anomaly.py

    r910 r923  
    1717## COMPUTE AND PLOT RELATIVE ANOMALY in %
    1818anomaly = ((simple-mean)/mean)*100.
     19anomaly.filename = "anomaly"
    1920anomaly.defineplot()
    2021anomaly.p[0].title = "surface temperature anomaly in %"
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/chain_pp.sh

    r910 r923  
    11#! /bin/bash
    22
    3 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc
    4 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -v v -t 0.5 -z 10.
    5 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -y 2
    6 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -y 2 -m 1000 -L --
    7 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -C spectral
    8 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P ortho
    9 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P moll
    10 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P npstere
    11 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P spstere
    12 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P cyl -A Tharsis
    13 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P lcc -A Tharsis
    14 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P laea -A Tharsis
    15 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -A Tropics -P merc
    16 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -c phisinit -t 0.5 -z 10. -T Yeah -P laea -A Tharsis
    17 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P merc -A Whole_No_High
    18 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin
     3./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc
     4./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -v v -t 0.5 -z 10.
     5./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -y 2
     6./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -y 2 -m 1000 -L --
     7./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -C spectral
     8./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P ortho
     9./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P moll
     10./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P npstere
     11./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P spstere
     12./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P cyl -A Tharsis
     13./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P lcc -A Tharsis
     14./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -z 10. -T Yeah -P laea -A Tharsis
     15./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -A Tropics -P merc
     16./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -c phisinit -t 0.5 -z 10. -T Yeah -P laea -A Tharsis
     17./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P merc -A Whole_No_High
     18./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin
    1919
    20 ./pp.py -f /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00
    21 ./pp.py -f /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -B vishires
    22 ./pp.py -f /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -t 1. -B vishires -H 0.5
    23 ./pp.py -f /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -t 1. -P ortho -B vishires
     20./pp.py /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00
     21./pp.py /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -B vishires
     22./pp.py /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -t 1. -B vishires -H 0.5
     23./pp.py /home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00\:00\:00 -v HGT -t 1. -P ortho -B vishires
    2424
    25 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin
    26 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -x 10 -C jet -P robin
    27 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin -H 0.5 -B vishires
     25./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin
     26./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v u -t 0.5 -x 10 -C jet -P robin
     27./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v ps -t 0.5 -z 10. -C jet -P robin -H 0.5 -B vishires
    2828
    29 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -P robin
    30 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120.
    31 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120. -v phisinit -I 120
    32 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120. -v phisinit
    33 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P robin -I -120. -v icetot -I 120.
     29./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -P robin
     30./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120.
     31./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120. -v phisinit -I 120
     32./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v phisinit -P ortho -I -120. -v phisinit
     33./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P robin -I -120. -v icetot -I 120.
    3434
    35 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll
    36 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v
    37 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v -z 10.
    38 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v -z 10000.
    39 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -i u -j v -z 10000. --verbose
    40 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -i u -j v -z 10000. -c phisinit
    41 ./pp.py -f /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -z 10000. -c temp
     35./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll
     36./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v
     37./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v -z 10.
     38./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P moll -i u -j v -z 10000.
     39./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -i u -j v -z 10000. --verbose
     40./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -i u -j v -z 10000. -c phisinit
     41./pp.py /home/aymeric/Big_Data/DATAPLOT/diagfired.nc -v icetot -t 1. -P cyl -z 10000. -c temp
    4242
    43 ./pp.py -f wrfout_d03_2024-06-09_00\:00\:00_z -v tk -c HGT -t 1 -z 0 -P lcc -i Um -j Vm --verbose
     43./pp.py wrfout_d03_2024-06-09_00\:00\:00_z -v tk -c HGT -t 1 -z 0 -P lcc -i Um -j Vm --verbose
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/hodograph.py

    r910 r923  
    1717# u as a function of v
    1818hodo = u.f(v)
     19hodo.filename = "hodograph"
    1920hodo.makeplot()
    2021
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/les_psfc.py

    r910 r923  
    1414les.y = None
    1515les.t = ["10"]
    16 #les.stridex = 3
    17 #les.stridey = 3
     16les.stridex = 3
     17les.stridey = 3
     18les.filename = "les_psfc"
    1819les.getplot()
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/meso_profile.py

    r910 r923  
    4747S.p[0].ylabel="Geopotential height (km)"
    4848S.p[0].xlabel="Potential temperature (K)"
     49S.filename = "meso_profile"
    4950
    5051# make the plot
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/scatter.py

    r910 r923  
    5050S3.p[0].color="k"
    5151S3.p[0].ylabel="wind speed $\sqrt{u^{2}+v^{2}}$ (m s$^{-1}$)"
     52S3.filename="scatter"
    5253S3.makeplot()
    5354
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/simple.py

    r910 r923  
    2121u.p[0].title = "This is what we name $u$ (m s$^{-1}$)"
    2222u.p[0].proj = "robin"
     23u.filename = "simple"
    2324
    2425# we plot
     
    2829# ... no need to reload data
    2930u.p[0].colorb = "RdBu"
     31u.filename = "myplot"
    3032u.makeplot()
    3133
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/vector.py

    r910 r923  
    88u.t = "0.5,0.8"
    99u.z = "50000"
     10u.filename = "vector"
    1011u.get()
    1112u.defineplot()
     
    1617
    1718u.z = "50"
     19u.filename = "myplot"
    1820u.getplot()
    1921
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/vertpress.py

    r910 r923  
    99prof.x = 30
    1010prof.y = 30
     11prof.filename = "vertpress"
    1112
    1213prof.get()
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/windspeed.py

    r910 r923  
    2525wind = wind**0.5
    2626wind.plotin = v
     27wind.filename = "windspeed"
    2728wind.defineplot()
    2829wind.p[2].title = "$\sqrt{u^2+v^2}$ (m s$^{-1}$)"
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/zonalcontour.py

    r910 r923  
    88u.x = "0"
    99u.t = "0.5"
     10u.filename = "zonalcontour"
    1011u.get()
    1112u.defineplot()
  • trunk/UTIL/PYTHON/planetoplot_v2/examples/zonalmean.py

    r910 r923  
    2121u.y = None
    2222u.t = "0.5"
     23u.filename = "zonalmean"
    2324u.get()
    2425u.defineplot()
     
    3031## ZONAL MINIMUM
    3132u.compute = "min"
     33u.filename = "zonalmin"
    3234u.get()
    3335u.defineplot()
     
    3941## ZONAL MAXIMUM
    4042u.compute = "max"
     43u.filename = "myplot"
    4144u.get()
    4245u.defineplot()
Note: See TracChangeset for help on using the changeset viewer.