Skip to content

Commit

Permalink
More SortByArea Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
TCallaghan2 committed Jan 23, 2025
1 parent 0a62b41 commit d2c317c
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions PythonScripts/GUI/GeoSAM/SortByAreaFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,16 +405,17 @@ def ExportThis(self, nomsg=False):
with open(self.exportFileName, 'w') as f:
##f.write('AREA,YEAR,' + outStr + ' ('+ units + ')\n')
# Write Header
f.write('Area #,Comment,Area,Units,Init State')
f.write('Param, Area #,Comment,Area,Units,Init State')
for yr in range(1,self.numYears):
f.write(',' + str(yr+self.yearStart))
f.write('\n')

for a in range(self.numAreas):
f.write(str(a+1))
f.write(outStr)
f.write(',' + str(a+1))
f.write(',' + self.areas.areaSubFrame[a].commentEntry.myEntry.get())
f.write(',' + self.areas.areaSubFrame[a].compAreaEntry.myEntry.get())
f.write(',' + outStr + ' ('+ units + ')')
f.write(',' + units)
for yr in range(self.numYears):
f.write( ',' + self.areas.areaSubFrame[a].results[yr].myEntry.get())
f.write('\n')
Expand All @@ -434,11 +435,11 @@ def ExportAll(self):
# Check that data files are present
filesExist = True
n = len(self.paramStr)
for i in range(n):
dataFileName = 'Lat_Lon_Grid_' + self.paramStr[i] + self.domainName + '_' + str(self.yearStart) + '_' + str(self.yearStop) + '.csv'
if not os.path.isfile(os.path.join('Results', dataFileName)):
filesExist = False
break
# for i in range(n):
# dataFileName = 'Lat_Lon_Grid_' + self.paramStr[i] + self.domainName + '_' + str(self.yearStart) + '_' + str(self.yearStop) + '.csv'
# if not os.path.isfile(os.path.join('Results', dataFileName)):
# filesExist = False
# break

if filesExist:
# Create Initial File
Expand All @@ -459,7 +460,11 @@ def ExportAll(self):
#print('appending '+outStr)

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

0 comments on commit d2c317c

Please sign in to comment.