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-01-30 10:50 pm] hchocanopy: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 15: Line 15:
   * ArcPy   * ArcPy
   * Python 2 standard module: os   * Python 2 standard module: os
-  * Feature Analyst (TM) by the Textron Systems+  * Feature Analyst(tm) by the Textron Systems
   * Automated Feature Extraction (AFE) models trained using Feature Analyst   * Automated Feature Extraction (AFE) models trained using Feature Analyst
  
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 162: 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 270: Line 270:
   * ''results_path = canopy_config.results_path''   * ''results_path = canopy_config.results_path''
  
-==== generate_ground_truthing_points(phyreg_ids, analysis_yearspoint_count) ====+==== generate_gtpoints(phyreg_ids, point_densitymax_points=400, min_points=200) ====
  
-**NOTE:** This function is still a work in progress. +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 analysis years.+
  
 Arguments: Arguments:
   * ''phyreg_ids'' (list of ''int''): IDs of physiographic regions to process   * ''phyreg_ids'' (list of ''int''): IDs of physiographic regions to process
-  * ''analysis_years'' (list of ''int''): Years to add as fields +  * ''point_density'' (''int''): Number of randomly generated points per square kilometer 
-  * ''point_count'' (''int''): Number of randomly generate points in each region.+  * ''max_points'' (''int, //default=400//''): Maximum 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'' +  *''phyregs_layer = canopy_config.phyregs_layer'' 
-  * ''spatref_wkid = canopy_config.spatref_wkid'' +  *''naipqq_layer = canopy_config.naipqq_layer'' 
-  * ''project_path = canopy_config.project_path'' +  *''spatref_wkid = canopy_config.spatref_wkid'' 
-  * ''analysis_path_format = canopy_config.analysis_path_format''+  *''analysis_year = canopy_config.analysis_year'' 
 +  *''results_path = canopy_config.results_path''
  
 Process: Process:
   - 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 values of each classified cell that contains the randomized points will be read. This task will be implemented using the NumPy module.+  - 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 arrayThe 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 ''calculate_row_column()''
 +  - 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'' are deleted in the spatially joined shapefile.  
 +  - The originally generated point shapefile is deleted.
  
 {{tag>software}} {{tag>software}}
canopy/technical_manual.1580449830.txt.gz · Last modified: 2020-01-30 10:50 pm by hcho

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki