Example of how to use the sowfa_precursor API to look at presursor simulation stats

  • Inputs are stored in sowfa_precursor.Sim.input
  • Outputs that are calculated are stored in sowfa_precursor.Sim.output
  • To use this script, sowfa_precursor.py must be in the same folder as this script or in your $PYTHONPATH
  • Settings are read from the SOWFA setUp file and the ABLSolver log file. Accordingly, both files must be in the dir that is specified when the sowfa_precursor.Sim object
  • Please make pull requests if something is broken or if you make improvments to this code
  • See also ./sowfa_precursor_example.py

In [ ]:
import numpy as np
from importlib import reload
import sowfa_precursor
sowfa_precursor = reload(sowfa_precursor)
%matplotlib inline

Creat sowfa_precursor object and enter neccisary user inputs


In [ ]:
precursor =  sowfa_precursor.Sim(
    dir='./',                  # SOWFA case directory
    log='log.1.ABLSolver',     # SOWFA log file
    time_dir='0',              # directory in dir/postProcessing/averaging that will be used to compute averages
    avg_time=29000,            # time (s) which average stats are computed around
    avg_width=2000,            # size of the averaging window in seconds
    z_level=90.0)              # hight at which to plot stats
precursor.input['heights'] = np.array([0,1/2,1,3/2,2,3,4,5])*precursor.input['windHeight']

Make Plots


In [ ]:
precursor.theta_w_avg_cell()

In [ ]:
precursor.Umean_avg_nonnormalized()

In [ ]:
precursor.Tmean_avg_nonnormalized()

In [ ]:
precursor.variances_avg_cell()