Skip to content

Commit

Permalink
Testing escapes
Browse files Browse the repository at this point in the history
  • Loading branch information
TCallaghan2 committed Nov 14, 2024
1 parent 2ccc075 commit d3b9083
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
1 change: 1 addition & 0 deletions PythonScripts/GUI/GeoSAM/Globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
simCfgDir = 'Simulation'
specAccCfgDir = 'SpecialAccess'
surveyDataDir = 'OriginalData'
shapeFileDir = 'Shapefiles'
resultsDir = 'Results'
analDir = 'Analysis'
comboTFStr = ['T', 'F']
Expand Down
15 changes: 7 additions & 8 deletions PythonScripts/GUI/GeoSAM/MainInputFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __init__(self, container, friend, tsPerYear, selectedOutputs, maxYears):
self.simStartDir = os.path.join(self.root, configDir, simCfgDir)
self.interpStartDir = os.path.join(self.root, configDir, interCfgDir)
self.surveyStartDir = os.path.join(self.root, surveyDataDir)
self.shapeFileDir = os.path.join(self.root, shapeFileDir)
self.friend = friend
self.maxYears = maxYears

Expand Down Expand Up @@ -330,8 +331,8 @@ def SetDredgeFileName(self):
#
def SetDredgeFileEnvVar(self):
os.environ["DredgeFile"] = self.dredgeDataFile.myEntry.get()
fname = os.path.join('OriginalData', os.environ["DredgeFile"]+'.csv')
print(fname)
# fname = os.path.join('OriginalData', os.environ["DredgeFile"]+'.csv')
# print(fname)

##
#
Expand All @@ -350,8 +351,8 @@ def SetHabCamFileName(self):
#
def SetHabCamFileEnvVar(self):
os.environ["HabCamFile"] = self.habCamDataFile.myEntry.get()
fname = os.path.join('OriginalData', os.environ["HabCamFile"]+'.csv')
print(fname)
# fname = os.path.join('OriginalData', os.environ["HabCamFile"]+'.csv')
# print(fname)

##
#
Expand Down Expand Up @@ -380,21 +381,19 @@ def OpenPDF(self):
##
#
def SetMaShapeFile(self):
file_path = filedialog.askopenfilename(title="Open SHP File", filetypes=[("SHP files", "*.shp")], defaultextension='csv', initialdir=self.startDir)
file_path = filedialog.askopenfilename(title="Open SHP File", filetypes=[("SHP files", "*.shp")], defaultextension='csv', initialdir=self.shapeFileDir)
if file_path:
self.areaFName = file_path
self.UpdateWidgets()
self.maShapeFileEntry.delete(0,tk.END)
f = file_path.split('/')
self.maShapeFileEntry.insert(0, f[-1])

##
#
def SetGbShapeFile(self):
file_path = filedialog.askopenfilename(title="Open SHP File", filetypes=[("SHP files", "*.shp")], defaultextension='csv', initialdir=self.startDir)
file_path = filedialog.askopenfilename(title="Open SHP File", filetypes=[("SHP files", "*.shp")], defaultextension='csv', initialdir=self.shapeFileDir)
if file_path:
self.areaFName = file_path
self.UpdateWidgets()
self.gbShapeFileEntry.delete(0,tk.END)
f = file_path.split('/')
self.gbShapeFileEntry.insert(0, f[-1])
Expand Down
8 changes: 4 additions & 4 deletions PythonScripts/GUI/GeoSAM/ShapeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def __init__(self):
shapeMA[n].X[m] = shapes[n].points[m][0]
shapeMA[n].Y[m] = shapes[n].points[m][1]
(shapeMA[n].lat[m], shapeMA[n].lon[m]) = utm.to_latlon(shapeMA[n].X[m], shapeMA[n].Y[m], 18, 'T')
print( shapeMA[n].SAMS, shapeMA[n].NewSAMS, shapeMA[n].areaKm2)
print(n, len(shapes[n].points))
print(n, shapeMA[n].X[5], shapeMA[n].Y[5])
print(n, shapeMA[n].lat[5], shapeMA[n].lon[5])
print('MA', shapeMA[n].SAMS, shapeMA[n].NewSAMS, shapeMA[n].areaKm2)
print('MA', n, len(shapes[n].points))
print('MA', n, shapeMA[n].X[5], shapeMA[n].Y[5])
print('MA', n, shapeMA[n].lat[5], shapeMA[n].lon[5])
print()

sf = shapefile.Reader("ShapeFiles/GB_Estimation_Areas_2024_UTM19_PDT.shp")
Expand Down
6 changes: 3 additions & 3 deletions PythonScripts/GUI/GeoSAM/SortByAreaFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def RunSort(self):

if desiredParam == FEFF or desiredParam == FMOR:
# compute average
accumParamData[row][col] = accumParamData[row][col] / countNonZeroData[row][col]
if countNonZeroData[row][col] > 0: accumParamData[row][col] = accumParamData[row][col] / countNonZeroData[row][col]

if desiredParam == ABUN or desiredParam == RECR:
# compute density average
Expand Down Expand Up @@ -442,7 +442,7 @@ def ExportAll(self):
self.comboParameter.current(0)
self.RunSort()
self.ExportThis(True)
print('Initial file created', n)
#print('Initial file created', n)

# now append remaining outputs
for i in range(1,n):
Expand All @@ -453,7 +453,7 @@ def ExportAll(self):

outStr = self.comboParameter.get()
units = self.dataSortUnitsEntry.get()
print('appending '+outStr)
#print('appending '+outStr)

for a in range(self.numAreas):
f.write(str(a+1)+ ',' + self.areas.areaSubFrame[a].compAreaEntry.myEntry.get()+ ',' + outStr + ' ('+ units + ')')
Expand Down

0 comments on commit d3b9083

Please sign in to comment.