Module Expr Str Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword NameLoad keyword Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore NameLoad If AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr Str Str body Expr Call AttributeLoad NameLoad attr BinOpBitAnd Str TupleLoad AttributeLoad NameLoad attr Str Str Assign NameStore SubscriptLoad ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr NameLoad CompareEq AttributeLoad NameLoad attr Str Index Num If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore ListComp SubscriptLoad NameLoad Slice Num comprehension NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str For NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpMod Str TupleLoad NameLoad Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad
N/A N/A @package GenerateSoilPropertyRastersFromSOLIM

@brief Infer soil attributes associated with SSURGO mapunit features using SOLIM

This software is provided free of charge under the New BSD License. Please see
the following license information:

Copyright (c) 2013, University of North Carolina at Chapel Hill
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the University of North Carolina at Chapel Hill nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


@author Brian Miles <brian_miles@unc.edu>
  

Pre conditions
--------------
1. Configuration file must define the following sections and values:
   'SOLIM', 'PATH_OF_SOLIM'

2. The following metadata entry(ies) must be present in the manifest section of the metadata associated with the project directory:
   soil_features [the name of the vector file containing the soil features]

3. The following metadata entry(ies) must be present in the study area section of the metadata associated with the project directory:
   dem_res_x
   dem_res_y

Post conditions
---------------
1. Will write the following entry(ies) to the manifest section of metadata associated with the project directory:
   soil_raster_<attr> [the name of the raster file for each soil property raster]

Usage:
@code
GenerateSoilPropertyRastersFromSOLIM.py -p /path/to/project_dir
@endcode

@note EcohydroLib configuration file must be specified by environmental variable 'ECOHYDROWORKFLOW_CFG',
or -i option must be specified.

@todo Recognize when DEM resolution is less than 10m, resample temporary DEM, run SOLIM with resampled DEM
 N/A os N/A sys N/A argparse ecohydrolib.context Context ecohydrolib.metadata GenericMetadata ecohydrolib.metadata AssetProvenance ecohydrolib.ssurgo rasterize ecohydrolib.ssurgo attributequery ecohydrolib.solim.inference inferSoilPropertiesForSSURGOAndTerrainData N/A parser N/A N/A argparse ArgumentParser description Get SSURGO features for a bounding box N/A N/A N/A parser add_argument -i --configfile dest configfile required False help The configuration file N/A N/A N/A parser add_argument -p --projectDir dest projectDir required True help The directory to which metadata, intermediate, and final files should be saved N/A args N/A N/A parser parse_args N/A cmdline N/A N/A GenericMetadata getCommandLine N/A configFile None N/A N/A args configfile N/A N/A configFile N/A args configfile N/A context N/A Context N/A args projectDir configFile N/A N/A N/A N/A N/A context config has_option SOLIM PATH_OF_SOLIM N/A N/A N/A N/A sys exit N/A Config file %s does not define option %s in section %s N/A N/A args configfile SOLIM PATH_OF_SOLIM N/A ssurgoProvenance N/A N/A i N/A i N/A N/A GenericMetadata readAssetProvenanceObjects context N/A N/A i name soil_features N/A 0 N/A N/A ssurgoProvenance None N/A N/A N/A N/A sys exit Unable to load SSURGO provenance information from metadata N/A manifest N/A N/A GenericMetadata readManifestEntries context N/A shpFilename N/A manifest N/A soil_features N/A shpFilepath N/A N/A N/A os path join N/A context projectDir shpFilename N/A demFilename N/A manifest N/A dem N/A demFilepath N/A N/A N/A os path join N/A context projectDir demFilename N/A layerName N/A N/A N/A N/A os path splitext shpFilename N/A 0 N/A studyArea N/A N/A GenericMetadata readStudyAreaEntries context N/A outputrasterresolutionX N/A studyArea N/A dem_res_x N/A outputrasterresolutionY N/A studyArea N/A dem_res_y N/A N/A N/A N/A sys stdout write Generating soil property maps using SOLIM... N/A N/A N/A N/A sys stdout flush N/A attrList N/A N/A elem N/A 10 N/A elem N/A attributequery ATTRIBUTE_LIST_NUMERIC N/A rasterFiles N/A inferSoilPropertiesForSSURGOAndTerrainData config N/A context config outputDir N/A context projectDir shpFilepath shpFilepath demFilepath demFilepath featureAttrList attrList N/A N/A N/A N/A sys stdout write done
 N/A attr N/A N/A rasterFiles keys N/A N/A asset N/A AssetProvenance N/A GenericMetadata MANIFEST_SECTION N/A N/A asset name N/A soil_raster_%s N/A attr N/A N/A asset dcIdentifier N/A rasterFiles N/A attr N/A N/A asset dcSource http://solim.geography.wisc.edu N/A N/A asset dcTitle attr N/A N/A asset dcPublisher Department of Geography, UW-Madison N/A N/A asset dcDescription cmdline N/A N/A N/A asset writeToMetadata context N/A N/A N/A GenericMetadata appendProcessingHistoryItem context cmdline