Skip to content

Commit

Permalink
Stopped accepting 7z command. Left it to script rather than call from…
Browse files Browse the repository at this point in the history
… pythong. Added 2011-2023 HabCam Data.
  • Loading branch information
TCallaghan2 committed Aug 2, 2024
1 parent 5814775 commit 6851c2d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 33 deletions.
Binary file added OriginalData/Habcam_BySegment_2000_2011-2023.zip
Binary file not shown.
Binary file added OriginalData/Habcam_BySegment_2000_2018-2023.zip
Binary file not shown.
42 changes: 9 additions & 33 deletions PythonScripts/GUI/GeoSAM/MainInputFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,45 +320,14 @@ def GetUKConfigFName(self):
#
def SetDredgeFileName(self):
os.environ["DredgeFile"] = self.dredgeDataFile.myEntry.get()
if self.dredgeDataFile.myEntry.get() != 'NONE':
# Verify file exists
fname = os.path.join('OriginalData', os.environ["DredgeFile"]+'.csv')
if not os.path.isfile(fname):
# is there a zipfile
zipFname = os.environ["DredgeFile"]+'.zip'
if os.path.isfile(os.path.join('OriginalData', zipFname)):
#unzip it
if platform.system() == 'Windows':
cmd = ["C:\Program Files\7-Zip\7z e", zipFname]
else:
cmd = ["unzip", zipFname]
os.chdir('OriginalData')
result = subprocess.run(cmd)
os.chdir('..')
else:
messagebox.showerror('Set Environment Variable',f'File {zipFname} does not exist')
print(fname)
fname = os.path.join('OriginalData', os.environ["DredgeFile"]+'.csv')
print(fname)

##
#
def SetHabCamFileName(self):
os.environ["HabCamFile"] = self.habCamDataFile.myEntry.get()
# Verify file exists
fname = os.path.join('OriginalData', os.environ["HabCamFile"]+'.csv')
if not os.path.isfile(fname):
# is there a zipfile
zipFname = os.environ["HabCamFile"]+'.zip'
if os.path.isfile(os.path.join('OriginalData', zipFname)):
#unzip it
if platform.system() == 'Windows':
cmd = ["C:\Program Files\7-Zip\7z e", zipFname]
else:
cmd = ["unzip", zipFname]
os.chdir('OriginalData')
result = subprocess.run(cmd)
os.chdir('..')
else:
messagebox.showerror('Set Environment Variable',f'File {zipFname} does not exist')
print(fname)

def OpenPDF(self):
Expand Down Expand Up @@ -460,6 +429,13 @@ def pop_up(self):
View PDF Plots
Once START Sim has been executed one can use this button to open and view
PDF documents showing plots of the Output selections by lat/lon location.
Survey Data Files
The GUI sets environement variables such that all scripts, M-files, Python,
and shell, access the same data files without having to pass yet another
argument or two. These survey data files are stored in the "OriginalData"
subdirectory as zip files. They are too large to be managed in the git
repositiory as a CSV file. The scripts then unzip the files as necessary.
'''
#about = re.sub("\n\s*", "\n", about) # remove leading whitespace from each line
popup = tk.Toplevel()
Expand Down
3 changes: 3 additions & 0 deletions Unpack.bat
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ if not exist OriginalData\%HabCamFile%.csv (
)

@REM Create Directories used by GeoSAMS
if not exist Data\ (
mkdir Data\
)
if not exist GrowthOutput\ (
mkdir GrowthOutput\
)
Expand Down
3 changes: 3 additions & 0 deletions Unpack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ if [ ! -f "OriginalData/$HabCamFile.csv" ]; then
fi

# Create Directories used by GeoSAMS
if [ ! -d "Data" ]; then
mkdir Data
fi
if [ ! -d "GrowthOutput" ]; then
mkdir GrowthOutput
fi
Expand Down

0 comments on commit 6851c2d

Please sign in to comment.