/* CONVERT ICE POLYGONS TO TWO GRIDS template script: mmm190_ice_grids_v3.txt template script last modified 8/14/02 by Bill 1) save this script with a new name: yyy190_ice_grids_v3.txt. This script modified and run xx/xx/xx by xxxxx This script describes how to convert the ice polygon coverage to a grid. In essence, this involves several steps: converting the polygon coverage to a grid with minor1 values converting the polygon coverage to a grid with internal pound numbers creating a new grid of ice grid cells with "minor1" values of 103 only creating a new grid of ice grid cells coded to internal pound numbers, without nunatak grid cells Thus, we'll actually create two grids: one with ice cells all coded to 103, and another where each ice "polygon" is coded by cells with the same unique value. NEEDED: yyy_georef_info.xls yyy_ice, a polygon coverage CREATED: yyy_ice_103, with ice grid cells coded to minor1 = 103 yyy_ice_id, with ice grid cells coded to yyy_ice# numbers 2) change yyy to project prefix. PULL TOGETHER GRID INFORMATION 3) If it hasn't been, transfer the "yyy_georef_info.xls" spreadsheet from the mac to the pc, and put it in the yyy/other folder. 4) Open the spreadsheet, and note (or copy and paste) below: cell size = ____ (e.g., 60) Xmin, Ymin = ____ (e.g., 550680, 6988920) nrows, ncols = ____ (e.g., 1340, 1624) 5) Quit out of excel. START ARC 6) Start Arc, and: w ../modern/yyy &watch yyy_yymmdd.txt &format 6 precision double highest lc lg CONVERT ICE POLYGONS TO GRID -- MINOR1 VALUES Now we're going to interactively run the POLYGRID command to create a grid where each cell is coded by the minor1 attribute (nodata, 0, or 103). 7) At the arc prompt, type (or copy and paste): polygrid yyy_ice t_ice_m1 minor1 at the next prompt, type in cell size Cell Size (square cell): at the next prompt, type in "N" Convert the Entire Coverage? (Y/N): N at the next prompt, type (or copy and paste) Xmin, Ymin Grid Origin (x, y): at the next prompt, type (or copy and paste) nrows, ncols Grid Size (nrows, ncolumns): CONVERT ICE POLYGONS TO GRID -- ID VALUES Now we'll run the polygrid command to create a grid where each cell is coded by the internal "pound" number for each polygon. 8) At the arc prompt, type (or copy and paste): polygrid yyy_ice t_ice_id yyy_ice# at the next prompt, type in cell size Cell Size (square cell): at the next prompt, type in "N" Convert the Entire Coverage? (Y/N): N at the next prompt, type (or copy and paste) Xmin, Ymin Grid Origin (x, y): at the next prompt, type (or copy and paste) nrows, ncols Grid Size (nrows, ncolumns): CHECK THE NEW GRIDS 9) Check that the extent and coordinate system are correct: describe yyy_dem describe t_ice_m1 describe t_ice_id and make sure the following are identical: cell size, nrows, ncols, Xmin, Xmax, Ymin, Ymax, and coordinate system information. CREATE A NEW M1 GRID WITH ONLY 103 VALUES 10) start grid Now we'll we'll use the setnull command to recode all non-glacier cells to nodata. 11) at the grid prompt, type (or copy and paste): yyy_ice_103 = setnull(t_ice_m1 <> 103, t_ice_m1) This says: if the cell value in the t_ice_m1 grid is not 103, set it to null (NODATA), otherwise keep the value in the t_ice_m1 grid. CREATE ICE ID GRID Next we'll use the ArcInfo CON command, a "conditional" command, to create a new grid where each ice grid cell is coded by the internal pound number. 12) at the grid prompt, type (or copy and paste): yyy_ice_id = con(t_ice_m1 == 103, t_ice_id) In essence, this says: if the cell value in the t_ice_m1 grid is 103, then assign to that grid cell the value in t_ice_id, otherwise assign it NODATA. VIEW THE NEW GRIDS 13) In ArcMap, open the new grids and make sure they look ok. DELETE TEMPORARY ITEMS 14) In grid, delete the temporary grids: kill t_ice_m1 all kill t_ice_id all QUIT 15) Quit out of grid, then arc. Done. /* ----------- NOTES ------------- Write below any comments you have on unusual or unexpected steps, errors, etc. Include any questions that you might have for Bill. */