| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Grid Files

Page history last edited by Dr. Ron Eaglin 15 years, 10 months ago

 Grid Files

 

The grid files are included in Surfer GRD format and also an ASCII format (DAT extension). These files are denoted by return periods (2Y through 500Y) and rainfall durations (1HR to 5D). The files are in 2 separate zip files (GRD Files and DAT Files). Gridding is the first primary step in the production of creating rainfall contour maps. The grid method used is Kriging and all the grid files were produced with the script shown at the bottom of this page.

 

 

 

 

GRD Files KrigingNGT20.zip

 

 

Grid Script Used in Surfer

 

The grid script uses the spreadsheet format available in the main page. This just must be specified as the inputFile.

Sub Main

	Dim surferApp, COntourMap As Object
	Dim inputFile, Gridfile As String
	Dim outputPath As String

Dim dirPath As String

Set surferApp = CreateObject("Surfer.Application")

dirPath = "C:UsersreaglinDocumentsWhitewaterresearchFEMA ProjectsRainfall Reports\"
inputFile = dirPath + "StationCoordinatesModified.xls"
outputPath = dirPath + "Grid FilesKrigingModified\"
' Here we simply Grid COlumns 8 (1 hr ) To columns

Dim outGridFilename As String

Dim colDurations(11) As String
colDurations(1) = "1HR"
colDurations(2) = "2HR"
colDurations(3) = "6HR"
colDurations(4) = "12HR"
colDurations(5) = "24HR"
colDurations(6) = "48HR"
colDurations(7) = "72HR"
colDurations(8) = "4D"
colDurations(9) = "5D"

' An output for each krig method will be produced
'SrfGridAlgorithm Values

'Value Description
'srfInverseDistance Inverse Distance To a Power
'srfKriging Kriging
'srfMinCurvature Minimum Curvature
'srfShepards Modified Shepard's Method
'srfNaturalNeighbor Natural Neighbor
'srfNearestNeighbor Nearest Neighbor
'srfRegression Polynomial Regression
'srfRadialBasis Radial Basis Functions
'srfTriangulation Triangulation With Linear Interpolation
'srfMovingAverage Moving Average
'srfDataMetrics Data Metrics
'srfLocalPolynomial Local Polynomial

' To open a specific worksheet inside a spreadsheet, we must open the file within the
' documents collection and set the active sheet.
Dim ReturnPeriod As String
Dim i As Integer

Set wksdoc1 = surferApp.Documents.Open(inputFile, Options:="Sheet=2 Year")
ReturnPeriod = "2YR"

For i=1 To 9
	surferApp.GridData DataFile:=inputFile, xcol:=6, ycol:=5, zcol:=i+7, Algorithm:=srfKriging, DupMethod:=srfDupNone, ShowReport:=False, OutGrid:=outputPath+ReturnPeriod+colDurations(i)+".grd"
Next i
wksdoc1.Close(SaveChanges:=srfSaveChangesNo)

Set wksdoc1 = surferApp.Documents.Open(inputFile, Options:="Sheet=3 Year")
ReturnPeriod = "3YR"

For i=1 To 9
	surferApp.GridData DataFile:=inputFile, xcol:=6, ycol:=5, zcol:=i+7, Algorithm:=srfKriging, DupMethod:=srfDupNone, ShowReport:=False, OutGrid:=outputPath+ReturnPeriod+colDurations(i)+".grd"
Next i
wksdoc1.Close(SaveChanges:=srfSaveChangesNo)

Set wksdoc1 = surferApp.Documents.Open(inputFile, Options:="Sheet=5 Year")
ReturnPeriod = "5YR"

For i=1 To 9
	surferApp.GridData DataFile:=inputFile, xcol:=6, ycol:=5, zcol:=i+7, Algorithm:=srfKriging, DupMethod:=srfDupNone, ShowReport:=False, OutGrid:=outputPath+ReturnPeriod+colDurations(i)+".grd"
Next i
wksdoc1.Close(SaveChanges:=srfSaveChangesNo)

Set wksdoc1 = surferApp.Documents.Open(inputFile, Options:="Sheet=10 Year")
ReturnPeriod = "10YR"

For i=1 To 9
	surferApp.GridData DataFile:=inputFile, xcol:=6, ycol:=5, zcol:=i+7, Algorithm:=srfKriging, DupMethod:=srfDupNone, ShowReport:=False, OutGrid:=outputPath+ReturnPeriod+colDurations(i)+".grd"
Next i
wksdoc1.Close(SaveChanges:=srfSaveChangesNo)

Set wksdoc1 = surferApp.Documents.Open(inputFile, Options:="Sheet=25 Year")
ReturnPeriod = "25YR"

For i=1 To 9
	surferApp.GridData DataFile:=inputFile, xcol:=6, ycol:=5, zcol:=i+7, Algorithm:=srfKriging, DupMethod:=srfDupNone, ShowReport:=False, OutGrid:=outputPath+ReturnPeriod+colDurations(i)+".grd"
Next i
wksdoc1.Close(SaveChanges:=srfSaveChangesNo)

Set wksdoc1 = surferApp.Documents.Open(inputFile, Options:="Sheet=50 Year")
ReturnPeriod = "50YR"

For i=1 To 9
	surferApp.GridData DataFile:=inputFile, xcol:=6, ycol:=5, zcol:=i+7, Algorithm:=srfKriging, DupMethod:=srfDupNone, ShowReport:=False, OutGrid:=outputPath+ReturnPeriod+colDurations(i)+".grd"
Next i
wksdoc1.Close(SaveChanges:=srfSaveChangesNo)

Set wksdoc1 = surferApp.Documents.Open(inputFile, Options:="Sheet=100 Year")
ReturnPeriod = "100YR"

For i=1 To 9
	surferApp.GridData DataFile:=inputFile, xcol:=6, ycol:=5, zcol:=i+7, Algorithm:=srfKriging, DupMethod:=srfDupNone, ShowReport:=False, OutGrid:=outputPath+ReturnPeriod+colDurations(i)+".grd"
Next i
wksdoc1.Close(SaveChanges:=srfSaveChangesNo)

Set wksdoc1 = surferApp.Documents.Open(inputFile, Options:="Sheet=200 Year")
ReturnPeriod = "200YR"

For i=1 To 9
	surferApp.GridData DataFile:=inputFile, xcol:=6, ycol:=5, zcol:=i+7, Algorithm:=srfKriging, DupMethod:=srfDupNone, ShowReport:=False, OutGrid:=outputPath+ReturnPeriod+colDurations(i)+".grd"
Next i
wksdoc1.Close(SaveChanges:=srfSaveChangesNo)

End Sub

 

Grid Conversion Script 

 

 

Sub Main
	Dim colDurations(11) As String
colDurations(1) = "1HR"
colDurations(2) = "2HR"
colDurations(3) = "6HR"
colDurations(4) = "12HR"
colDurations(5) = "24HR"
colDurations(6) = "48HR"
colDurations(7) = "72HR"
colDurations(8) = "4D"
colDurations(9) = "5D"

Dim returnPeriods(10) As String
returnPeriods(1) = "2YR"
returnPeriods(2) = "3YR"
returnPeriods(3) = "5YR"
returnPeriods(4) = "10YR"
returnPeriods(5) = "25YR"
returnPeriods(6) = "50YR"
returnPeriods(7) = "100YR"
returnPeriods(8) = "200YR"

Dim i	As Integer
Dim j	As Integer
Dim FileName As String
Dim path As String
path = "C:Documents and SettingsAdministratorMy DocumentsresearchFEMA ProjectsRainfall ReportsGrid FilesKrigingNGT20\"

Dim surferApp As  Object
Set surferApp = CreateObject("Surfer.Application")
surferApp.Visible = False


Dim srfGrid As Object


For i=1 To 8
	For j=1 To 9
		FileName = returnPeriods(i) + colDurations(j)
        Set srfGrid = surferApp.Documents.Open(path+FileName + ".grd")

        srfGrid.SaveAs(path + "dat\" + FileName + ".DAT", srfGridFmtAscXYZ)

	Next j
Next i

End Sub

 

 

 

Comments (0)

You don't have permission to comment on this page.