From abec3a5be8afcebd4fb51d7efd1407769f3d1f48 Mon Sep 17 00:00:00 2001 From: crazyzlj Date: Mon, 4 Sep 2017 14:29:09 +0800 Subject: [PATCH] tidy code --- .gitignore | 3 ++- seims/nogit/export_scenario_demo.py | 30 ----------------------------- 2 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 seims/nogit/export_scenario_demo.py diff --git a/.gitignore b/.gitignore index 81bc638d26..e3fdcc8f5c 100644 --- a/.gitignore +++ b/.gitignore @@ -70,4 +70,5 @@ doc/img/ .nfs* # add nogit directory which contains personal test code -/seims/nogit/* +seims/nogit +seims/nogit/* diff --git a/seims/nogit/export_scenario_demo.py b/seims/nogit/export_scenario_demo.py deleted file mode 100644 index 8c40417343..0000000000 --- a/seims/nogit/export_scenario_demo.py +++ /dev/null @@ -1,30 +0,0 @@ -#! /usr/bin/env python -# -*- coding: utf-8 -*- -"""Export scenario to tiff. - @author : Liangjun Zhu - @changelog: -""" -from seims.pygeoc.pygeoc.utils.utils import get_config_parser -from seims.scenario_analysis.slpposunits.config import SASPUConfig -from seims.scenario_analysis.slpposunits.scenario import SPScenario - - -def export_scenario_demo(): - """Export scenario as raster data.""" - cf = get_config_parser() - cfg = SASPUConfig(cf) - gene_array = [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, - 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 2.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 2.0, 0.0, 2.0, 0.0, 2.0, 0.0, 2.0, 0.0, 0.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 4.0, 0.0, 0.0, 0.0, - 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - out_raster = r'C:\z_data\ChangTing\seims_models\NSGA2_Output\0830_method3\rule_mth3_3rd\gen100_158736296.tif' - sce = SPScenario(cfg) - setattr(sce, 'gene_values', gene_array) - sce.export_scenario_to_gtiff(out_raster) - - -if __name__ == '__main__': - export_scenario_demo()