traDSSAT
TraDSSAT is a library to easily read and write DSSAT input and output files.
Status
Installation
poetry add tradssat
or
pip install tradssat
Full docs
Read the full thing here.
Citation
If you use traDSSAT, please consider citing this repository until we write a real publication about traDSSAT.
Quick examples
Parse and edit any DSSAT file directly:
from tradssat import SoilFile, WTHFile, ExpFile, set_dssat_dir
from tradssat import GeneticMgr, CULFile, ECOFile
soil = SoilFile('path/to/my/file.SOL')
wth = WTHFile('path/to/my/WTHR0001.WTH')
exp = ExpFile('path/to/my/experiment.EXP')
cul = CULFile('path/to/my/MZIXM.CUL')
eco = ECOFile('path/to/my/MZIXM.ECO')
cul.get_value('P1')
eco.get_value('TOPT')
set_dssat_dir('C:/DSSAT47')
gen = GeneticMgr(crop='MZIXM', cult='PC0001')
gen.get_value('P1')
gen.get_value('TOPT')
Read, edit and write experiments, with automatic access to referenced
external soil, genetic and weather files:
from tradssat import DSSATRun
run = DSSATRun('path/to/my/experiment.EXP')
run.get_trt_val('INGENO', trt=1)
run.set_trt_factor_level(trt=1, factor='CULTIVARS', level=2)
run.set_factor_level_val('INGENO', 'IB0067', level=1)
Access output from a run:
from tradssat import DSSATResults
out = DSSATResults('path/to/my/output/dir')
out.get_value('FWAD', trt=1)
out.get_value('FWAD', trt=1, t=13, at='DAS')
out.get_value('FWAD', trt=1, t=13, at='DAP')
out.get_value('FWAD', trt=1, t='1989 123', at='DOY')
Contributing
Don't forget to add your name to the authors list in the docs/source/acknow.rst
file!
Licensing
MIT License