Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/respec/BASINS
Browse files Browse the repository at this point in the history
  • Loading branch information
mishranurag committed Mar 28, 2018
2 parents d4d3d98 + ddc7617 commit b2ffea2
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 19 deletions.
2 changes: 1 addition & 1 deletion BASINS/modBasinsPlugin.vb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Public Module modBasinsPlugin
#ElseIf ProgramName = "USGS SW Toolbox" Then
Public Const g_AppNameRegistry As String = "USGS-SW" 'For preferences in registry
Friend Const g_AppNameShort As String = "SW Toolbox"
Friend Const g_AppNameLong As String = "USGS SW Toolbox 1.0.1"
Friend Const g_AppNameLong As String = "USGS SW Toolbox 1.0.2"
Friend Const g_URL_Home As String = "https://water.usgs.gov/osw/swtoolbox/"
Friend Const g_URL_Register As String = "http://hspf.com/pub/USGS-SW/register.html"
#Else
Expand Down
3 changes: 2 additions & 1 deletion BASINS/modDownload.vb
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,8 @@ NoIcon: Logger.Dbg("Icon not found for met station a

Public Function CheckCore(ByVal aRegion As String, ByVal aNewDataDir As String, ByVal aDataPath As String, ByVal aProjectFileName As String) As Boolean
'new check to see if the core data is available before attempting to download it
Dim lBaseURL As String = "http://www3.epa.gov/ceampubl/basins/gis_data/huc/"
'Dim lBaseURL As String = "http://www3.epa.gov/ceampubl/basins/gis_data/huc/"
Dim lBaseURL As String = "ftp://newftp.epa.gov/exposure/BasinsData/BasinsCoreData/"
Dim lHUC8s As New atcCollection
Dim lHUC8BoundaryOnly As Boolean = False
'get huc8s in this region
Expand Down
3 changes: 2 additions & 1 deletion D4EMDownloadData/frmDownload.vb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ Public Class frmDownload
End If
If chkNHDplus2_All.Checked Or chkNHDplus2_Catchment.Checked Or chkNHDplus2_elev_cm.Checked Or chkNHDplus2_hydrography.Checked Then
For Each lHuc8 As String In HUC8s()
If Not CheckAddress("https://s3.amazonaws.com/nhdplus/NHDPlusV2/NHDPlusExtensions/SubBasins/NHDPlus" & lHuc8.Substring(0, 2) & "/" & "NHDPlus" & lHuc8 & ".zip") Then
'If Not CheckAddress("https://s3.amazonaws.com/nhdplus/NHDPlusV2/NHDPlusExtensions/SubBasins/NHDPlus" & lHuc8.Substring(0, 2) & "/" & "NHDPlus" & lHuc8 & ".zip") Then
If Not CheckAddress("ftp://newftp.epa.gov/exposure/BasinsData/NHDPlus21/NHDPlus" & lHuc8 & ".zip") Then
lProblem = True
End If
Next
Expand Down
20 changes: 20 additions & 0 deletions RunR/RunR15.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RunR", "RunR15.vbproj", "{35A06BB5-F3B6-4E13-99C1-96F2A3D10258}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{35A06BB5-F3B6-4E13-99C1-96F2A3D10258}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35A06BB5-F3B6-4E13-99C1-96F2A3D10258}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35A06BB5-F3B6-4E13-99C1-96F2A3D10258}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35A06BB5-F3B6-4E13-99C1-96F2A3D10258}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
32 changes: 16 additions & 16 deletions atcTimeseriesHDF5/atcDataSourceTimeseriesHDF5.vb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Public Class atcDataSourceTimeseriesHSF5
Dim lTsGrpId As H5GroupId = H5G.open(aGrpID, aTsName)

Dim lTsAtCnt As Integer = H5A.getNumberOfAttributes(lTsGrpId)
Debug.Print("Attribute Count " & lTsAtCnt & " for " & aTsName)
'Debug.Print("Attribute Count " & lTsAtCnt & " for " & aTsName)

Dim lTimeSeries As New atcTimeseries(Me)

Expand All @@ -194,15 +194,15 @@ Public Class atcDataSourceTimeseriesHSF5
Dim lAtTypeId As H5DataTypeId = H5A.getType(lAt)
Dim lAtType As H5T.H5Type = H5T.getClass(lAtTypeId)
Dim lAtName As String = H5A.getName(lAt).ToUpper
Debug.Print(" Name,Size,Type " & lAtName & ":" & lAtSize & ":" & lAtType)
'Debug.Print(" Name,Size,Type " & lAtName & ":" & lAtSize & ":" & lAtType)
Select Case lAtType
Case H5T.H5TClass.STRING
Dim lAtValue(lAtSize - 1) As Byte
H5A.read(Of Byte)(lAt, lAtTypeId, New H5Array(Of Byte)(lAtValue))
Dim lAtString As String = System.Text.Encoding.ASCII.GetString(lAtValue)
If lAtString <> vbNullChar Then
Dim lValue As String = lAtString.Substring(0, lAtSize)
Debug.Print(" Length,Value " & lAtValue.Length & ":'" & lValue & "'")
'Debug.Print(" Length,Value " & lAtValue.Length & ":'" & lValue & "'")
If lAtName = "SCENARIO" And lValue = "NA" Then
lValue = aScenario
End If
Expand All @@ -213,15 +213,15 @@ Public Class atcDataSourceTimeseriesHSF5
Case H5T.H5TClass.FLOAT
Dim lAtValue(0) As Double
H5A.read(Of Double)(lAt, lAtTypeId, New H5Array(Of Double)(lAtValue))
Debug.Print(" Length,Value " & lAtValue.Length & ":'" & lAtValue(0).ToString & "'")
'Debug.Print(" Length,Value " & lAtValue.Length & ":'" & lAtValue(0).ToString & "'")
lTimeSeries.Attributes.Add(lAtName, lAtValue(0))
Case H5T.H5TClass.INTEGER
Dim lAtvalue(0) As Integer
H5A.read(Of Integer)(lAt, lAtTypeId, New H5Array(Of Integer)(lAtvalue))
Debug.Print(" Length,Value " & lAtvalue.Length & ":'" & lAtvalue(0).ToString & "'")
'Debug.Print(" Length,Value " & lAtvalue.Length & ":'" & lAtvalue(0).ToString & "'")
lTimeSeries.Attributes.Add(lAtName, lAtvalue(0))
Case Else
Debug.Print(" Unknown Type")
'Debug.Print(" Unknown Type")
lTimeSeries.Attributes.Add(lAtName, "?")
End Select
Next
Expand All @@ -248,7 +248,7 @@ Public Class atcDataSourceTimeseriesHSF5
Dim lDates(lNumValues - 1) As Long
Dim lDateTypeId As H5DataTypeId = H5D.getType(lDateGrpId)
H5D.read(Of Int64)(lDateGrpId, lDateTypeId, New H5Array(Of Long)(lDates))
Debug.Print(lDateStorageSize.ToString & ":" & lNumValues.ToString & ":" & lDates(0).ToString)
'Debug.Print(lDateStorageSize.ToString & ":" & lNumValues.ToString & ":" & lDates(0).ToString)
Dim lDateBase As New System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local)
Dim lDateNow As System.DateTime = lDateBase.AddMilliseconds(lDates(0) / (10 ^ 6))
Dim lDatesJ(lNumValues) As Double
Expand All @@ -258,23 +258,23 @@ Public Class atcDataSourceTimeseriesHSF5
lDatesJ(lIndex) = Date2J(.Year, .Month, .Day, .Hour, .Minute, .Second)
End With
If lIndex < 3 Or lIndex > lNumValues - 2 Then
Debug.Print(lDateNow.ToString & ":" & DumpDate(lDatesJ(lIndex)))
'Debug.Print(lDateNow.ToString & ":" & DumpDate(lDatesJ(lIndex)))
End If
Next
lDatesJ(lNumValues) = (2 * (lDatesJ(lNumValues - 1))) - lDatesJ(lNumValues - 2)
Debug.Print(DumpDate(lDatesJ(lNumValues)))
'Debug.Print(DumpDate(lDatesJ(lNumValues)))
aTimeseries.Dates = New atcTimeseries(Me)
aTimeseries.Dates.Values = lDatesJ
Else
Debug.Print("Why?")
Debug.Print("ReadDates, no dates, why?")
End If
End Sub

Public Overrides Sub ReadData(ByVal aData As atcDataSet)
If aData.Attributes.GetValue("OutputSection") Is Nothing Then
'data has been read
Else
Debug.Print("Need to read data for " & aData.ToString)
'Debug.Print("Need to read data for " & aData.ToString)
Dim lTimeseries As atcTimeseries = aData
Dim lNumValues As Integer = lTimeseries.Dates.numValues
Dim lColumn As Integer = lTimeseries.Attributes.GetValue("OutputColumn")
Expand All @@ -288,7 +288,7 @@ Public Class atcDataSourceTimeseriesHSF5
Dim lValueTypeId As H5DataTypeId = H5D.getType(lValueGrpId)
'read all data (may be multiple ts)
H5D.read(Of Single)(lValueGrpId, lValueTypeId, New H5Array(Of Single)(lValues))
Debug.Print(lValuesArraySize.ToString & ":" & lValueArraySize.ToString & ":" & lValues(0).ToString & ":" & lValues(1).ToString)
'Debug.Print(lValuesArraySize.ToString & ":" & lValueArraySize.ToString & ":" & lValues(0).ToString & ":" & lValues(1).ToString)
ReDim lTimeseries.Values(lNumValues)
For lIndex As Integer = 1 To lNumValues
Dim lArrayIndex As Integer = (lValueColumns * (lIndex - 1)) + lColumn
Expand All @@ -312,7 +312,7 @@ Public Class atcDataSourceTimeseriesHSF5
Dim lDates(lNumValues - 1) As Long
Dim lDateTypeId As H5DataTypeId = H5D.getType(lDateGrpId)
H5D.read(Of Int64)(lDateGrpId, lDateTypeId, New H5Array(Of Long)(lDates))
Debug.Print(lDateStorageSize.ToString & ":" & lNumValues.ToString & ":" & lDates(0).ToString)
'Debug.Print(lDateStorageSize.ToString & ":" & lNumValues.ToString & ":" & lDates(0).ToString)
Dim lDateBase As New System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local)
Dim lDateNow As System.DateTime = lDateBase.AddMilliseconds(lDates(0) / (10 ^ 6))
Dim lDatesJ(lNumValues) As Double
Expand All @@ -322,11 +322,11 @@ Public Class atcDataSourceTimeseriesHSF5
lDatesJ(lIndex) = Date2J(.Year, .Month, .Day, .Hour, .Minute, .Second)
End With
If lIndex < 3 Or lIndex > lNumValues - 2 Then
Debug.Print(lDateNow.ToString & ":" & DumpDate(lDatesJ(lIndex)))
'Debug.Print(lDateNow.ToString & ":" & DumpDate(lDatesJ(lIndex)))
End If
Next
lDatesJ(lNumValues) = (2 * (lDatesJ(lNumValues - 1))) - lDatesJ(lNumValues - 2)
Debug.Print(DumpDate(lDatesJ(lNumValues)))
'Debug.Print(DumpDate(lDatesJ(lNumValues)))
aTimeseries.Dates = New atcTimeseries(Me)
aTimeseries.Dates.Values = lDatesJ
Else 'using dates from first column
Expand All @@ -341,7 +341,7 @@ Public Class atcDataSourceTimeseriesHSF5
Dim lValueTypeId As H5DataTypeId = H5D.getType(lValueGrpId)
'read all data (may be multiple ts)
H5D.read(Of Single)(lValueGrpId, lValueTypeId, New H5Array(Of Single)(lValues))
Debug.Print(lValuesArraySize.ToString & ":" & lValueArraySize.ToString & ":" & lValues(0).ToString & ":" & lValues(1).ToString)
'Debug.Print(lValuesArraySize.ToString & ":" & lValueArraySize.ToString & ":" & lValues(0).ToString & ":" & lValues(1).ToString)
ReDim aTimeseries.Values(lNumValues)
For lIndex As Integer = 1 To lNumValues
Dim lArrayIndex As Integer = (lValueColumns * (lIndex - 1)) + lColumn
Expand Down

0 comments on commit b2ffea2

Please sign in to comment.