pywasp.wasp.Config#
- class pywasp.wasp.Config(par_set='WAsP_12.10')[source]#
Configuration class for the WAsP model parameters
Due to the structure of the original fortran testbench code, parameters from the WAsP model are set in a long array with integers in a Fortran data block. Here we initialize both the climate and terrain parameters. The obstacle model does not, yet, have a similar structure to that of the climate and terrain models. Parameter can be set with a parameter-suite name, like “WAsP_12.8” for the parameters corresponding to WAsP version 12.8. Individual parameters can also be set manually through the methods of the
.terrainand.climateclass attributes (see below). By default, “WAsP_12.8” is used.- Parameters:
par_set (
str) – Named parameter set with different defaults:WAsP_11.4 – Profile model -1; terrain analysis 0
WAsP_12.6 – Profile model 1; terrain analysis 0
WAsP_12.7 – Profile model 1; terrain analysis 1
WAsP_12.8 – Profile model 3; terrain analysis 1
The above numbers are the parameter when calling
Config.climate.set_profile_modelandConfig.terrain.set_terrain_analysisrespectively.
Notes
The
.terrainand.climateclass attributes each respectively hold the parameters for the terrain and climate analysis in WAsP. The attributes are themselves classes with associated methods described below. To interact with the parameters, bothterrainand.climateacts as lists, allowing to get and set parameters by indicies:from pywasp.wasp import Config conf = Config() conf.climate[10] = 1.8 # Set the climate parameter 10 (A0) value to 1.8 decay_length = conf.terrain[31] # get the decay length parameter from the terrain model
Terrain model config
The terrain model allows users to set the terrain analysis parameter-set and whether toggle whether displacement heights are used. This is done through the two methods:
.set_terrain_analysis(index): Set terrain analysis (0=classic, 1=spider).use_displacement_height(flag): Enable/disable displacement heights (True/False)
Climate model config
The climate model config allows users to set the profile model through
.set_profile_model(model). Options are:-1: WAsP 11 profile model (c_g=1.65, powerlaw reversal height)0: WAsP 12 profile model (c_g by iteration)1: WAsP 12 with baroclinicity2: WAsP 12 with sectorwise stability3: WAsP 12 with sectorwise stability and baroclinicity (default)
To see all available parameters, print the Config object or see the WAsP Parameters Reference.
Examples
Config objects can be instantiated with a standard parameter-suite, for example WAsP 12.8:
>>> import pywasp as pw >>> conf = pw.wasp.Config("WAsP_12.8") >>> print(conf) Config >>> conf.climate[10] = 1.8 # Set the climate parameter 10 (A0) value to 1.8 >>> conf.set_profile_model(-1) # Use the WAsP 11 profile model >>> conf.terrain.set_terrain_analysis # Use spider analysis terrain model ... >>> # Use the Config in a WAsP model-call >>> wwc = pw.wasp.downscale(gwc, topo_map, output_locs, conf=conf)
Methods