Project

General

Profile

« Previous | Next » 

Revision cc196a45

Added by Rick Reeves over 13 years ago

  • ID cc196a45fad67e5418da3205ea6efd9b0ff285d3

This version used to create the large (36000 row) table used to generate latest bounday analysis scatterplots.

View differences:

terrain/rscripts/makeImagePairTable.r
8 8
#
9 9
# Author: Rick Reeves, NCEAS
10 10
# May 4, 2011
11
# May 17: This version includes raster() extents and input
12
#         image names used to create the (normalized)boundary  
13
#         area Difference Image scatterplots used in the most
14
#         recent 'boundary analysis'
11 15
##############################################################################################
12 16
#
13 17
makeImagePairTable <- function()
......
34 38
# the ASTER and SRTM/CGIAR image components are merged at the 60 Deg N Latitude line.
35 39

  
36 40
#eTestAreaExtent <- extent(-135.2,-100.2, 59.997,60.001) # Creates a 5 row subimage
37
eTestAreaExtent <- extent(-135.2,-100.2, 59.995,60.005) # Creates a 12 row subimage
38
#eTestAreaExtent <- extent(-135.0,-105.0, 59.990,60.010) # Creates a 24 row subimage
41
eTestAreaExtent <- extent(-135.0,-105.0, 59.995,60.005) # Creates a 12 row, 36000 col subimage
39 42

  
40 43
# Extract a sub image corresponding to the selected extent.
41 44
# Two different alternatives:
......
59 62
# get a vector of random column index numbers, constrained by column dimension of image
60 63
# Loop three times, sampling pixel pairs from above, below, across the border
61 64

  
62
nColsToGet <- 2000
65
nColsToGet <- 36000 # Latest input images on even boundary have 36000 columns
66

  
63 67
iDiffVecNorth <- vector(mode="integer",length=nColsToGet)
64 68

  
65 69
iDiffVecBorder <- vector(mode="integer",length=nColsToGet)
......
116 120

  
117 121
message("end of loop - hit key to write output table..")
118 122
browser()
119
write.csv(mOutTable,file="/data/project/organisms/rcr/tableForRick2000_5_8Even.csv",row.names=FALSE)
123
write.csv(mOutTable,file="/data/project/organisms/rcr/ValidateBoundary/pixelPairs36000_5_8Even.csv",row.names=FALSE)
120 124
#
121 125
}

Also available in: Unified diff