dssat module

Class definition for the DSSAT model interface

class dssat.DSSAT(dbname, name, resolution, startyear, startmonth, startday, endyear, endmonth, endday, nens, vicopts, shapefile=None, assimilate=True)[source]
readVICOutput(gid, depths)[source]

Reads DSSAT time-varying inputs by reading either from files or a database.

readVICSoil()[source]

Extract information from VIC database table on latitude, longitude, elevation and soil depths.

run(dssatexe, crop_threshold=0.1)[source]

Runs DSSAT simulation.

save(modelpaths, startdt)[source]

Saves DSSAT output to database.

writeConfigFile(modelpath, nlayers, startdate, enddate)[source]

Write DSSAT-ENKF config file.

writeControlFile(modelpath, vsm, depths, startdate, gid, lat, lon, planting, fertildates, irrigdates)[source]

Writes DSSAT control file for specific pixel.

writeLAI(modelpath, gid, viclai=None, tablename='lai.modis')[source]

Writes LAI file for DSSAT.

writeSoilMoist(modelpath, year, month, day, smi, dz)[source]

Writes soil moisture information file.

writeWeatherFiles(modelpath, name, year, month, day, weather, elev, lat, lon, ts=None, te=None)[source]

Writes ensemble weather files for specific pixel.

dssat.addCultivar(dbname, shapefile, params, nens=40, crop='maize')[source]

Add cultivar parameters to the database dbname corresponding to the area defined in the shapefile. The params is a list of dictionaries, where the keys of each dictionary correspond to parameters, and each object in the list corresponds to a cultivar variant. The nens parameters is the size of the ensemble to be created.