Skip to content

Commit

Permalink
update sample data info, vernum, conda depends
Browse files Browse the repository at this point in the history
  • Loading branch information
RJbalikian committed Sep 25, 2023
1 parent b809697 commit 7083090
Show file tree
Hide file tree
Showing 13 changed files with 175 additions and 56 deletions.
4 changes: 2 additions & 2 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: sprit
version: 0.1.34
version: 0.1.35

source:
git_url: https://github.com/RJbalikian/SPRIT-HVSR
Expand All @@ -23,7 +23,7 @@ requirements:
- matplotlib
- pandas
- numpy
- pyqt5
- PyQt5
- pyproj

about:
Expand Down
3 changes: 1 addition & 2 deletions docs/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
#Whether to convert_md using markdown library (True), or let github do it (False)
convert_md=True
rtd_theme=False #Not currently working
release_version= '0.1.34'
release_version= '0.1.35'

currentDir = pathlib.Path((__file__)).parent
docsDir = currentDir
repoDir = docsDir.parent
print(repoDir)
spritDir = repoDir.joinpath('sprit')
spritGUIPath = spritDir.joinpath('sprit_gui.py')
spritUtilsPath = spritDir.joinpath('sprit_utils.py')
Expand Down
54 changes: 42 additions & 12 deletions docs/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ <h2 id="parameters">Parameters</h2>

combined_csvReport = pd.DataFrame()
for site_name in hvsr_results.keys():
if &#39;CSV_Report&#39; in hvsr_results[site_name]:
if &#39;CSV_Report&#39; in hvsr_results[site_name].keys():
combined_csvReport = pd.concat([combined_csvReport, hvsr_results[site_name][&#39;CSV_Report&#39;]], ignore_index=True, join=&#39;inner&#39;)

if export_path is not None:
Expand All @@ -1744,7 +1744,7 @@ <h2 id="parameters">Parameters</h2>
else:
csvExportPath = csvExportPath.parent

combined_csvReport.to_csv(csvExportPath, index=False)
combined_csvReport.to_csv(csvExportPath, index=False)

if return_results:
return hvsr_results
Expand Down Expand Up @@ -3289,12 +3289,23 @@ <h2 id="raises">Raises</h2>
data_noiseRemoved = remove_noise(hvsr_data=dataIN, verbose=verbose,**remove_noise_kwargs)
except:
data_noiseRemoved = dataIN
data_noiseRemoved[&#39;ProcessingStatus&#39;][&#39;RemoveNoiseStatus&#39;]=False
#Since noise removal is not required for data processing, check others first
if dataIN[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;]:
data_noiseRemoved[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = True
else:
data_noiseRemoved[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#Reformat data so HVSRData and HVSRBatch data both work here
if isinstance(data_noiseRemoved, HVSRData):
data_noiseRemoved = {&#39;place_holder_sitename&#39;:data_noiseRemoved}
dataIN = {&#39;place_holder_sitename&#39;:dataIN}

for site_name in data_noiseRemoved.keys():
data_noiseRemoved[site_name][&#39;ProcessingStatus&#39;][&#39;RemoveNoiseStatus&#39;]=False
#Since noise removal is not required for data processing, check others first
if dataIN[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;]:
data_noiseRemoved[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = True
else:
data_noiseRemoved[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#If it wasn&#39;t originally HVSRBatch, make it HVSRData object again
if not data_noiseRemoved[site_name][&#39;batch&#39;]:
data_noiseRemoved = data_noiseRemoved[site_name]

#Generate PPSDs
try:
Expand All @@ -3310,18 +3321,37 @@ <h2 id="raises">Raises</h2>
else:
errMsg = e
raise RuntimeError(f&#34;generate_ppsds() error: {errMsg}&#34;)
#Reformat data so HVSRData and HVSRBatch data both work here
ppsd_data = data_noiseRemoved
ppsd_data[&#39;ProcessingStatus&#39;][&#39;PPSDStatus&#39;]=False
ppsd_data[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False
if isinstance(ppsd_data, HVSRData):
ppsd_data = {&#39;place_holder_sitename&#39;:ppsd_data}

for site_name in ppsd_data.keys(): #This should work more or less the same for batch and regular data now
ppsd_data[site_name][&#39;ProcessingStatus&#39;][&#39;PPSDStatus&#39;]=False
ppsd_data[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#If it wasn&#39;t originally HVSRBatch, make it HVSRData object again
if not ppsd_data[site_name][&#39;batch&#39;]:
ppsd_data = ppsd_data[site_name]

#Process HVSR Curves
try:
process_hvsr_kwargs = {k: v for k, v in locals()[&#39;kwargs&#39;].items() if k in process_hvsr.__code__.co_varnames}
hvsr_results = process_hvsr(params=ppsd_data, verbose=verbose,**process_hvsr_kwargs)
except:
hvsr_results = ppsd_data
hvsr_results[&#39;ProcessingStatus&#39;][&#39;HVStatus&#39;]=False
hvsr_results[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False
if isinstance(hvsr_results, HVSRData):
hvsr_results = {&#39;place_holder_sitename&#39;:hvsr_results}

for site_name in hvsr_results.keys(): #This should work more or less the same for batch and regular data now

hvsr_results[site_name][&#39;ProcessingStatus&#39;][&#39;HVStatus&#39;]=False
hvsr_results[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#If it wasn&#39;t originally HVSRBatch, make it HVSRData object again
if not hvsr_results[site_name][&#39;batch&#39;]:
hvsr_results = hvsr_results[site_name]

#Final post-processing/reporting

#Check peaks
Expand Down
108 changes: 84 additions & 24 deletions docs/sprit_hvsr.html
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,23 @@ <h1 class="title">Module <code>sprit.sprit_hvsr</code></h1>
data_noiseRemoved = remove_noise(hvsr_data=dataIN, verbose=verbose,**remove_noise_kwargs)
except:
data_noiseRemoved = dataIN
data_noiseRemoved[&#39;ProcessingStatus&#39;][&#39;RemoveNoiseStatus&#39;]=False
#Since noise removal is not required for data processing, check others first
if dataIN[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;]:
data_noiseRemoved[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = True
else:
data_noiseRemoved[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#Reformat data so HVSRData and HVSRBatch data both work here
if isinstance(data_noiseRemoved, HVSRData):
data_noiseRemoved = {&#39;place_holder_sitename&#39;:data_noiseRemoved}
dataIN = {&#39;place_holder_sitename&#39;:dataIN}

for site_name in data_noiseRemoved.keys():
data_noiseRemoved[site_name][&#39;ProcessingStatus&#39;][&#39;RemoveNoiseStatus&#39;]=False
#Since noise removal is not required for data processing, check others first
if dataIN[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;]:
data_noiseRemoved[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = True
else:
data_noiseRemoved[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#If it wasn&#39;t originally HVSRBatch, make it HVSRData object again
if not data_noiseRemoved[site_name][&#39;batch&#39;]:
data_noiseRemoved = data_noiseRemoved[site_name]

#Generate PPSDs
try:
Expand All @@ -466,18 +477,37 @@ <h1 class="title">Module <code>sprit.sprit_hvsr</code></h1>
else:
errMsg = e
raise RuntimeError(f&#34;generate_ppsds() error: {errMsg}&#34;)
#Reformat data so HVSRData and HVSRBatch data both work here
ppsd_data = data_noiseRemoved
ppsd_data[&#39;ProcessingStatus&#39;][&#39;PPSDStatus&#39;]=False
ppsd_data[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False
if isinstance(ppsd_data, HVSRData):
ppsd_data = {&#39;place_holder_sitename&#39;:ppsd_data}

for site_name in ppsd_data.keys(): #This should work more or less the same for batch and regular data now
ppsd_data[site_name][&#39;ProcessingStatus&#39;][&#39;PPSDStatus&#39;]=False
ppsd_data[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#If it wasn&#39;t originally HVSRBatch, make it HVSRData object again
if not ppsd_data[site_name][&#39;batch&#39;]:
ppsd_data = ppsd_data[site_name]

#Process HVSR Curves
try:
process_hvsr_kwargs = {k: v for k, v in locals()[&#39;kwargs&#39;].items() if k in process_hvsr.__code__.co_varnames}
hvsr_results = process_hvsr(params=ppsd_data, verbose=verbose,**process_hvsr_kwargs)
except:
hvsr_results = ppsd_data
hvsr_results[&#39;ProcessingStatus&#39;][&#39;HVStatus&#39;]=False
hvsr_results[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False
if isinstance(hvsr_results, HVSRData):
hvsr_results = {&#39;place_holder_sitename&#39;:hvsr_results}

for site_name in hvsr_results.keys(): #This should work more or less the same for batch and regular data now

hvsr_results[site_name][&#39;ProcessingStatus&#39;][&#39;HVStatus&#39;]=False
hvsr_results[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#If it wasn&#39;t originally HVSRBatch, make it HVSRData object again
if not hvsr_results[site_name][&#39;batch&#39;]:
hvsr_results = hvsr_results[site_name]

#Final post-processing/reporting

#Check peaks
Expand Down Expand Up @@ -1315,7 +1345,7 @@ <h1 class="title">Module <code>sprit.sprit_hvsr</code></h1>

combined_csvReport = pd.DataFrame()
for site_name in hvsr_results.keys():
if &#39;CSV_Report&#39; in hvsr_results[site_name]:
if &#39;CSV_Report&#39; in hvsr_results[site_name].keys():
combined_csvReport = pd.concat([combined_csvReport, hvsr_results[site_name][&#39;CSV_Report&#39;]], ignore_index=True, join=&#39;inner&#39;)

if export_path is not None:
Expand All @@ -1330,7 +1360,7 @@ <h1 class="title">Module <code>sprit.sprit_hvsr</code></h1>
else:
csvExportPath = csvExportPath.parent

combined_csvReport.to_csv(csvExportPath, index=False)
combined_csvReport.to_csv(csvExportPath, index=False)

if return_results:
return hvsr_results
Expand Down Expand Up @@ -6900,7 +6930,7 @@ <h2 id="parameters">Parameters</h2>

combined_csvReport = pd.DataFrame()
for site_name in hvsr_results.keys():
if &#39;CSV_Report&#39; in hvsr_results[site_name]:
if &#39;CSV_Report&#39; in hvsr_results[site_name].keys():
combined_csvReport = pd.concat([combined_csvReport, hvsr_results[site_name][&#39;CSV_Report&#39;]], ignore_index=True, join=&#39;inner&#39;)

if export_path is not None:
Expand All @@ -6915,7 +6945,7 @@ <h2 id="parameters">Parameters</h2>
else:
csvExportPath = csvExportPath.parent

combined_csvReport.to_csv(csvExportPath, index=False)
combined_csvReport.to_csv(csvExportPath, index=False)

if return_results:
return hvsr_results
Expand Down Expand Up @@ -8548,12 +8578,23 @@ <h2 id="raises">Raises</h2>
data_noiseRemoved = remove_noise(hvsr_data=dataIN, verbose=verbose,**remove_noise_kwargs)
except:
data_noiseRemoved = dataIN
data_noiseRemoved[&#39;ProcessingStatus&#39;][&#39;RemoveNoiseStatus&#39;]=False
#Since noise removal is not required for data processing, check others first
if dataIN[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;]:
data_noiseRemoved[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = True
else:
data_noiseRemoved[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#Reformat data so HVSRData and HVSRBatch data both work here
if isinstance(data_noiseRemoved, HVSRData):
data_noiseRemoved = {&#39;place_holder_sitename&#39;:data_noiseRemoved}
dataIN = {&#39;place_holder_sitename&#39;:dataIN}

for site_name in data_noiseRemoved.keys():
data_noiseRemoved[site_name][&#39;ProcessingStatus&#39;][&#39;RemoveNoiseStatus&#39;]=False
#Since noise removal is not required for data processing, check others first
if dataIN[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;]:
data_noiseRemoved[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = True
else:
data_noiseRemoved[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#If it wasn&#39;t originally HVSRBatch, make it HVSRData object again
if not data_noiseRemoved[site_name][&#39;batch&#39;]:
data_noiseRemoved = data_noiseRemoved[site_name]

#Generate PPSDs
try:
Expand All @@ -8569,18 +8610,37 @@ <h2 id="raises">Raises</h2>
else:
errMsg = e
raise RuntimeError(f&#34;generate_ppsds() error: {errMsg}&#34;)
#Reformat data so HVSRData and HVSRBatch data both work here
ppsd_data = data_noiseRemoved
ppsd_data[&#39;ProcessingStatus&#39;][&#39;PPSDStatus&#39;]=False
ppsd_data[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False
if isinstance(ppsd_data, HVSRData):
ppsd_data = {&#39;place_holder_sitename&#39;:ppsd_data}

for site_name in ppsd_data.keys(): #This should work more or less the same for batch and regular data now
ppsd_data[site_name][&#39;ProcessingStatus&#39;][&#39;PPSDStatus&#39;]=False
ppsd_data[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#If it wasn&#39;t originally HVSRBatch, make it HVSRData object again
if not ppsd_data[site_name][&#39;batch&#39;]:
ppsd_data = ppsd_data[site_name]

#Process HVSR Curves
try:
process_hvsr_kwargs = {k: v for k, v in locals()[&#39;kwargs&#39;].items() if k in process_hvsr.__code__.co_varnames}
hvsr_results = process_hvsr(params=ppsd_data, verbose=verbose,**process_hvsr_kwargs)
except:
hvsr_results = ppsd_data
hvsr_results[&#39;ProcessingStatus&#39;][&#39;HVStatus&#39;]=False
hvsr_results[&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False
if isinstance(hvsr_results, HVSRData):
hvsr_results = {&#39;place_holder_sitename&#39;:hvsr_results}

for site_name in hvsr_results.keys(): #This should work more or less the same for batch and regular data now

hvsr_results[site_name][&#39;ProcessingStatus&#39;][&#39;HVStatus&#39;]=False
hvsr_results[site_name][&#39;ProcessingStatus&#39;][&#39;OverallStatus&#39;] = False

#If it wasn&#39;t originally HVSRBatch, make it HVSRData object again
if not hvsr_results[site_name][&#39;batch&#39;]:
hvsr_results = hvsr_results[site_name]

#Final post-processing/reporting

#Check peaks
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "sprit"
dynamic = ["readme"]
license = {file = "LICENSE"}
version="0.1.34"
version="0.1.35"
description = "A package for processing and analyzing HVSR (Horizontal to Vertical Spectral Ratio) data"
keywords = ["HVSR", "seismic", "horizontal to vertical spectral ratio", "obspy", 'geology', 'geophysics', 'geotechnical']
requires-python = ">=3.9"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name="sprit",
author= "Riley Balikian",
author_email = "balikian@illinois.edu",
version="0.1.34",
version="0.1.35",
package_data={'sprit': ['resources/*', 'resources/themes/*', 'resources/themes/forest-dark/*', 'resources/themes/forest-light/*', 'resources/sample_data/*',]},
long_description_content_type="text/markdown",
long_description=long_description,
Expand Down
Binary file modified sprit/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified sprit/__pycache__/sprit_gui.cpython-310.pyc
Binary file not shown.
Binary file modified sprit/__pycache__/sprit_hvsr.cpython-310.pyc
Binary file not shown.
Binary file modified sprit/__pycache__/sprit_hvsr.cpython-311.pyc
Binary file not shown.
Binary file modified sprit/__pycache__/sprit_utils.cpython-310.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions sprit/resources/sample_data/Batch_SampleData.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
datapath,site,source,acq_date,starttime,endtime,tzone,xcoord,ycoord,elevation,input_crs
SampleHVSRSite1_AM.RAC84.00.2023.046_2023-02-15_1704-1734.MSEED,SampleHVSRSite1,file,2/15/2023,17:04,17:34,UTC,-87.529,41.691,582.2,EPSG:4326
SampleHVSRSite2_AM.RAC84.00.2023-02-15_2132-2200.MSEED,SampleHVSRSite2,file,2/15/2023,16:32,17:00,US/Central,-87.53764,41.6695,584.9,EPSG:4326
SampleHVSRSite2_AM.RAC84.00.2023-02-15_2132-2200.MSEED,SampleHVSRSite2,file,2/15/2023,15:32,16:00,US/Central,-87.53764,41.6695,584.9,EPSG:4326
SampleHVSRSite3_AM.RAC84.00.2023.199_2023-07-18_1432-1455.MSEED,SampleHVSRSite3,file,7/18/2023,14:32,14:55,UTC,,,,
SampleHVSRSite4_AM.RAC84.00.2023.199_2023-07-18_1609-1629.MSEED,SampleHVSRSite4,file,7/18/2023,16:09,16:29,UTC,,,,
SampleHVSRSite5_AM.RAC84.00.2023.199_2023-07-18_2039-2100.MSEED,SampleHVSRSite5,file,7/18/2023,16:39,17:00,US/Eastern,,,,
SampleHVSRSite6_AM.RAC84.00.2023.192_2023-07-11_1510-1528.MSEED,SampleHVSRSite6,file,7/11/2023,15:10,15:28,UTC,,,,
SampleHVSRSite6_AM.RAC84.00.2023.192_2023-07-11_1510-1528.MSEED,SampleHVSRSite6,file,7/11/2023,15:10,15:28,UTC,,,,
Loading

0 comments on commit 7083090

Please sign in to comment.