城市增长模型的python包装器。
sleuth-automation的Python项目详细描述
此库是 SLEUTH urban growth model。
它将自动从目录创建方案文件 包含数据层,它可以通过 MPI和 HT-Condor。
安装
可以使用pip安装此库和帮助程序脚本。
$ pip install sleuth_automation
应用程序编程接口
importsleuth_automationassa# the library must be configured at least with the path to SLEUTHsa.configure(sleuth_path='/opt/sleuth',use_mpi=True,mpi_cores=32)# a directory containing input layers is given to a location instancel=sa.Location('my_location','/path/to/my_location')l.calibrate_coarse()l.calibrate_fine()l.calibrate_final()l.sleuth_predict(end=2050)
命令行界面
使用包含的sleuth_n.py脚本可以实现一次运行。
$ sleuth_run.py --sleuth_path /opt/sleuth/ \ --location_dir /path/to/location/ \ --location_name my_location \ --mpi_cores 40\ --montecarlo_iterations 50\ --predict_end 2060
这将为 校准,从control_stats.log文件中提取参数, 运行预测。
如果你想预测几个地点,你可以把它们归为 将它们作为批处理运行。使用 create_sleuth_condor_batch.py可以为 ht-condor队列管理系统。
$ create_sleuth_condor_batch.py --sleuth_path /opt/sleuth/ \ --region_dir /path/to/locations_group/ \ --mpi_cores 32\ --predict_end 2060
这将在locations目录中创建一个submit.condor文件, 使用适当的sleuth_run.py命令设置。