CLAWRIM Wiki

Computing Lab for Advanced Water Resources Informatics and Modeling

User Tools

Site Tools


canopy:technical_manual

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
canopy:technical_manual [2020-02-09 05:40 pm] – Add ground_truth to config example osmithcanopy:technical_manual [2020-04-19 08:47 pm] (current) hcho
Line 1: Line 1:
 ====== CanoPy technical manual ====== ====== CanoPy technical manual ======
  
-CanoPy is the Python module for the Georgia Canopy Analysis 2009 project sponsored by the Georgia Forestry Commission (GFC). For further information about this project, please refer to the [[CanoPy:]] page.+[[CanoPy:]] is the Python module for [[:GFC canopy assessment|the Georgia Canopy Analysis 2009 project]] sponsored by [[http://www.gfc.state.ga.us/|the Georgia Forestry Commission (GFC)]]. For further information about this project, please refer to the [[CanoPy:]] page.
  
-This document outlines the uses and methodology of the functions contained within the [[CanoPy:]] module. To learn how to use this module, please read the [[user manual]].+This document outlines the uses and methodology of the functions contained within the [[CanoPy:]] module. To learn how to use this module, please read the [[user manual]]. Also refer to the [[tutorial]].
  
 ===== Authors ===== ===== Authors =====
  
-  * Owen Smith +  * [[:Owen Smith]] 
-  * Huidae Cho, Ph.D.+  * [[:Huidae Cho]], Ph.D.
  
 ===== Requirements ===== ===== Requirements =====
Line 131: Line 131:
   * Type: ''str''   * Type: ''str''
   * Snap raster to which all output tiles will be snapped   * Snap raster to which all output tiles will be snapped
-  * This input/output raster is used to snap NAIP tiles to a consistent grid system. If this file does not already exist, the filename part of ''snaprast_path'' must be ''r'' + the filename of an existing original NAIP tile so that ''canopy.reproject_input_tiles()'' can automatically create it based on the folder structure of the NAIP imagery data (''naip_path'').+  * This input/output raster is used to snap NAIP tiles to a consistent grid system. If this file does not already exist, the filename part of ''snaprast_path'' must be ''r'' + the filename of an existing original NAIP tile so that ''canopy.reproject_naip_tiles()'' can automatically create it based on the folder structure of the NAIP imagery data (''naip_path'').
   * Example: ''snaprast_path = '%s/Data/rm_3408504_nw_16_1_20090824.tif' % analysis_path''   * Example: ''snaprast_path = '%s/Data/rm_3408504_nw_16_1_20090824.tif' % analysis_path''
  
Line 139: Line 139:
   * Folder where all results will be stored   * Folder where all results will be stored
   * Example: ''results_path = '%s/Results' % analysis_path''   * Example: ''results_path = '%s/Results' % analysis_path''
- 
- 
-==== ground_truth ==== 
- 
-  * Type: ''str'' 
-  * Folder where all generated ground truthing points will be stored 
-  * Example: ''ground_truth = '%s/ground_truth' % analysis_path'' 
  
 ===== canopy module ===== ===== canopy module =====
Line 169: Line 162:
   - All selections are cleared and each NAIP QQ polygon will contain the ''naip_phyregs_field'' filled with the IDs of physiographic regions that the QQ tile intersects.   - All selections are cleared and each NAIP QQ polygon will contain the ''naip_phyregs_field'' filled with the IDs of physiographic regions that the QQ tile intersects.
  
-==== reproject_input_tiles(phyreg_ids) ====+==== reproject_naip_tiles(phyreg_ids) ====
  
 This function reprojects and snaps the NAIP tiles that intersect selected physiographic regions. This function reprojects and snaps the NAIP tiles that intersect selected physiographic regions.
Line 277: Line 270:
   * ''results_path = canopy_config.results_path''   * ''results_path = canopy_config.results_path''
  
-==== generate_ground_truthing_points(phyreg_ids, point_density=0.25, max_points=400, min_points=0) ====+==== generate_gtpoints(phyreg_ids, point_density, max_points=400, min_points=200) ====
  
 This function generates randomized points for ground truthing with fields for corresponding years populated with the corresponding canopy value at each point. This function generates randomized points for ground truthing with fields for corresponding years populated with the corresponding canopy value at each point.
  
 Arguments: Arguments:
-  * ''phyreg_ids'' (list of ''int''): IDs of physiographic regions to process. +  * ''phyreg_ids'' (list of ''int''): IDs of physiographic regions to process 
-  * ''point_density'' (''int, //default=0.25//''): Number of randomly generated points per square kilometer +  * ''point_density'' (''int''): Number of randomly generated points per square kilometer 
-  * ''max_points'' (''int, //default=400//''): Maximum number of points generated per region +  * ''max_points'' (''int, //default=400//''): Maximum number of points generated per region 
-  * ''min_points'' (''int, //default=0//''): Minimum number of points generated per region.+  * ''min_points'' (''int, //default=200//''): Minimum number of points generated per region
  
 Config variables assigned with ''canopy_config'': Config variables assigned with ''canopy_config'':
-  *''phyregs_layer = canopy_config.''+  *''phyregs_layer = canopy_config.phyregs_layer''
   *''naipqq_layer = canopy_config.naipqq_layer''   *''naipqq_layer = canopy_config.naipqq_layer''
-  *''spatref_wkid = canopy_config.'' +  *''spatref_wkid = canopy_config.spatref_wkid'' 
-  *''gt_output_folder = canopy_config.'' +  *''analysis_year = canopy_config.analysis_year''
-  *''analysis_year = canopy_config.''+
   *''results_path = canopy_config.results_path''   *''results_path = canopy_config.results_path''
  
Line 298: Line 290:
   - The physiographic regions are selected using the input physiographic IDs.   - The physiographic regions are selected using the input physiographic IDs.
   - Random points in each region are created using ''arcpy.CreateRandomPoints''.   - Random points in each region are created using ''arcpy.CreateRandomPoints''.
-  - Fields are created in each point shapefile with the field name of ''GT_//analysis_year//'' (e.g., ''GT_2009'').+  - Fields are created in each point shapefile with the field name of ''GT'' (e.g., ''GT'').
   - The attributes of the ''naip_layer'' are spatially joined with the created random points shapefile and saved as a new point layer.    - The attributes of the ''naip_layer'' are spatially joined with the created random points shapefile and saved as a new point layer. 
   - A new spatially joined point shapefile allows for the file names of each point's corresponding classified NAIP QQ to be read and converted to a NumPy array. The conversion of each NAIP QQ to a NumPy array allows the function to handle the memory requirements of the regions.   - A new spatially joined point shapefile allows for the file names of each point's corresponding classified NAIP QQ to be read and converted to a NumPy array. The conversion of each NAIP QQ to a NumPy array allows the function to handle the memory requirements of the regions.
-  - Each point is converted to corresponding rows and columns within the corresponding NAIP QQ using ''get_array_indices''+  - Each point is converted to corresponding rows and columns within the corresponding NAIP QQ using ''calculate_row_column()''
-  - The value of the NumPy cell at each point's row and column is then added to the ''GT_//analysis_year//'' attribute field of the spatially joined shapefile.  +  - The value of the NumPy cell at each point's row and column is then added to the ''GT'' attribute field of the spatially joined shapefile.  
-  - After all point values are read, all fields except ''FID'', ''Shape'', and ''GT_//analysis_year//'' are deleted in the spatially joined shapefile.  +  - After all point values are read, all fields except ''FID'', ''Shape'', and ''GT'' are deleted in the spatially joined shapefile.  
-  - The originally generated point shapefile is deleted.    +  - The originally generated point shapefile is deleted.
  
 {{tag>software}} {{tag>software}}
canopy/technical_manual.1581295202.txt.gz · Last modified: 2020-02-09 05:40 pm by osmith

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki