Skip to content

Commit

Permalink
update vernum
Browse files Browse the repository at this point in the history
  • Loading branch information
RJbalikian committed Oct 17, 2023
1 parent 3416319 commit d7d7d9c
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 30 deletions.
4 changes: 2 additions & 2 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package:
name: sprit
version: 0.1.45
version: 0.1.46

source:
git_url: https://github.com/RJbalikian/SPRIT-HVSR
git_tag: v0.1.45
git_tag: v0.1.46

build:
number: 0
Expand Down
2 changes: 1 addition & 1 deletion docs/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#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.45'
release_version= '0.1.46'

currentDir = pathlib.Path((__file__)).parent
docsDir = currentDir
Expand Down
37 changes: 28 additions & 9 deletions docs/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -904,15 +904,15 @@ <h2 id="parameters">Parameters</h2>
</details>
</dd>
<dt id="sprit.fetch_data"><code class="name flex">
<span>def <span class="ident">fetch_data</span></span>(<span>params, inv=None, source='file', trim_dir=None, export_format='mseed', detrend='spline', detrend_order=2, update_metadata=True, plot_input_stream=False, verbose=False, **kwargs)</span>
<span>def <span class="ident">fetch_data</span></span>(<span>params, source='file', trim_dir=None, export_format='mseed', detrend='spline', detrend_order=2, update_metadata=True, plot_input_stream=False, verbose=False, **kwargs)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def fetch_data(params, inv=None, source=&#39;file&#39;, trim_dir=None, export_format=&#39;mseed&#39;, detrend=&#39;spline&#39;, detrend_order=2, update_metadata=True, plot_input_stream=False, verbose=False, **kwargs):
<pre><code class="python">def fetch_data(params, source=&#39;file&#39;, trim_dir=None, export_format=&#39;mseed&#39;, detrend=&#39;spline&#39;, detrend_order=2, update_metadata=True, plot_input_stream=False, verbose=False, **kwargs):
import warnings

&#34;&#34;&#34;Fetch ambient seismic data from a source to read into obspy stream
Expand All @@ -922,8 +922,6 @@ <h2 id="parameters">Parameters</h2>
params : dict
Dictionary containing all the necessary params to get data.
Parameters defined using input_params() function.
inv : obspy inventory object, default=None
Obspy inventory object containing metadata for instrument that collected data to be fetched. By default, the inventory object is read from params[&#39;inv&#39;], but this can be manually specified here too.
source : str, {&#39;raw&#39;, &#39;dir&#39;, &#39;file&#39;, &#39;batch&#39;}
String indicating where/how data file was created. For example, if raw data, will need to find correct channels.
&#39;raw&#39; finds raspberry shake data, from raw output copied using scp directly from Raspberry Shake, either in folder or subfolders;
Expand Down Expand Up @@ -1274,7 +1272,7 @@ <h2 id="parameters">Parameters</h2>
dataIN.merge()

params[&#39;batch&#39;] = False #Set False by default, will get corrected later in batch mode
params[&#39;input_stream&#39;] = dataIN
params[&#39;input_stream&#39;]
params[&#39;stream&#39;] = dataIN.copy()
params[&#39;ProcessingStatus&#39;][&#39;FetchDataStatus&#39;] = True
if verbose and not isinstance(params, HVSRBatch):
Expand Down Expand Up @@ -1773,7 +1771,7 @@ <h2 id="returns">Returns</h2>
</details>
</dd>
<dt id="sprit.get_metadata"><code class="name flex">
<span>def <span class="ident">get_metadata</span></span>(<span>params, write_path='', update_metadata=True, source=None)</span>
<span>def <span class="ident">get_metadata</span></span>(<span>params, write_path='', update_metadata=True, source=None, **read_inventory_kwargs)</span>
</code></dt>
<dd>
<div class="desc"><p>Get metadata and calculate or get paz parameter needed for PPSD</p>
Expand All @@ -1785,6 +1783,10 @@ <h2 id="parameters">Parameters</h2>
<dt><strong><code>write_path</code></strong> :&ensp;<code>str</code></dt>
<dd>String with output filepath of where to write updated inventory or metadata file
If not specified, does not write file</dd>
<dt><strong><code>update_metadata</code></strong> :&ensp;<code>bool</code></dt>
<dd>Whether to update the metadata file itself, or just read as-is. If using provided raspberry shake metadata file, select True.</dd>
<dt><strong><code>source</code></strong> :&ensp;<code>str</code>, default=<code>None</code></dt>
<dd>This passes the source variable value to _read_RS_metadata. It is expected that this is passed directly from the source parameter of sprit.fetch_data()</dd>
</dl>
<h2 id="returns">Returns</h2>
<dl>
Expand All @@ -1795,7 +1797,7 @@ <h2 id="returns">Returns</h2>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def get_metadata(params, write_path=&#39;&#39;, update_metadata=True, source=None):
<pre><code class="python">def get_metadata(params, write_path=&#39;&#39;, update_metadata=True, source=None, **read_inventory_kwargs):
&#34;&#34;&#34;Get metadata and calculate or get paz parameter needed for PPSD

Parameters
Expand All @@ -1806,6 +1808,10 @@ <h2 id="returns">Returns</h2>
write_path : str
String with output filepath of where to write updated inventory or metadata file
If not specified, does not write file
update_metadata : bool
Whether to update the metadata file itself, or just read as-is. If using provided raspberry shake metadata file, select True.
source : str, default=None
This passes the source variable value to _read_RS_metadata. It is expected that this is passed directly from the source parameter of sprit.fetch_data()

Returns
-------
Expand All @@ -1815,13 +1821,26 @@ <h2 id="returns">Returns</h2>

invPath = params[&#39;metapath&#39;]
raspShakeInstNameList = [&#39;raspberry shake&#39;, &#39;shake&#39;, &#39;raspberry&#39;, &#39;rs&#39;, &#39;rs3d&#39;, &#39;rasp. shake&#39;, &#39;raspshake&#39;]

if params[&#39;instrument&#39;].lower() in raspShakeInstNameList:
if update_metadata:
params = _update_shake_metadata(filepath=invPath, params=params, write_path=write_path)
params = _read_RS_Metadata(params, source=source)
else:
warnings.warn(&#39;{} not currently supported\n Returning input params dictionary.&#39;.format(params[&#39;instrument&#39;]))
return params
if not pathlib.Path(invPath).exists() or invPath==&#39;&#39;:
warnings.warn(f&#34;The metapath parameter was not specified correctly. Returning original params value {params[&#39;metapath&#39;]}&#34;)
return params
readInvKwargs = {}
argspecs = inspect.getfullargspec(obspy.read_inventory)
for argName in argspecs[0]:
if argName in read_inventory_kwargs.keys():
readInvKwargs[argName] = read_inventory_kwargs[argName]

readInvKwargs[&#39;path_or_file_object&#39;] = invPath
params[&#39;inv&#39;] = obspy.read_inventory(invPath)
if &#39;params&#39; in params.keys():
params[&#39;params&#39;][&#39;inv&#39;] = params[&#39;inv&#39;]

return params</code></pre>
</details>
</dd>
Expand Down
66 changes: 50 additions & 16 deletions docs/sprit_hvsr.html
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ <h1 class="title">Module <code>sprit.sprit_hvsr</code></h1>
return

#Reads in traces to obspy stream
def fetch_data(params, inv=None, source=&#39;file&#39;, trim_dir=None, export_format=&#39;mseed&#39;, detrend=&#39;spline&#39;, detrend_order=2, update_metadata=True, plot_input_stream=False, verbose=False, **kwargs):
def fetch_data(params, source=&#39;file&#39;, trim_dir=None, export_format=&#39;mseed&#39;, detrend=&#39;spline&#39;, detrend_order=2, update_metadata=True, plot_input_stream=False, verbose=False, **kwargs):
import warnings

&#34;&#34;&#34;Fetch ambient seismic data from a source to read into obspy stream
Expand All @@ -919,8 +919,6 @@ <h1 class="title">Module <code>sprit.sprit_hvsr</code></h1>
params : dict
Dictionary containing all the necessary params to get data.
Parameters defined using input_params() function.
inv : obspy inventory object, default=None
Obspy inventory object containing metadata for instrument that collected data to be fetched. By default, the inventory object is read from params[&#39;inv&#39;], but this can be manually specified here too.
source : str, {&#39;raw&#39;, &#39;dir&#39;, &#39;file&#39;, &#39;batch&#39;}
String indicating where/how data file was created. For example, if raw data, will need to find correct channels.
&#39;raw&#39; finds raspberry shake data, from raw output copied using scp directly from Raspberry Shake, either in folder or subfolders;
Expand Down Expand Up @@ -1271,7 +1269,7 @@ <h1 class="title">Module <code>sprit.sprit_hvsr</code></h1>
dataIN.merge()

params[&#39;batch&#39;] = False #Set False by default, will get corrected later in batch mode
params[&#39;input_stream&#39;] = dataIN
params[&#39;input_stream&#39;]
params[&#39;stream&#39;] = dataIN.copy()
params[&#39;ProcessingStatus&#39;][&#39;FetchDataStatus&#39;] = True
if verbose and not isinstance(params, HVSRBatch):
Expand Down Expand Up @@ -1530,7 +1528,7 @@ <h1 class="title">Module <code>sprit.sprit_hvsr</code></h1>
return params

#Gets the metadata for Raspberry Shake, specifically for 3D v.7
def get_metadata(params, write_path=&#39;&#39;, update_metadata=True, source=None):
def get_metadata(params, write_path=&#39;&#39;, update_metadata=True, source=None, **read_inventory_kwargs):
&#34;&#34;&#34;Get metadata and calculate or get paz parameter needed for PPSD

Parameters
Expand All @@ -1541,6 +1539,10 @@ <h1 class="title">Module <code>sprit.sprit_hvsr</code></h1>
write_path : str
String with output filepath of where to write updated inventory or metadata file
If not specified, does not write file
update_metadata : bool
Whether to update the metadata file itself, or just read as-is. If using provided raspberry shake metadata file, select True.
source : str, default=None
This passes the source variable value to _read_RS_metadata. It is expected that this is passed directly from the source parameter of sprit.fetch_data()

Returns
-------
Expand All @@ -1550,13 +1552,26 @@ <h1 class="title">Module <code>sprit.sprit_hvsr</code></h1>

invPath = params[&#39;metapath&#39;]
raspShakeInstNameList = [&#39;raspberry shake&#39;, &#39;shake&#39;, &#39;raspberry&#39;, &#39;rs&#39;, &#39;rs3d&#39;, &#39;rasp. shake&#39;, &#39;raspshake&#39;]

if params[&#39;instrument&#39;].lower() in raspShakeInstNameList:
if update_metadata:
params = _update_shake_metadata(filepath=invPath, params=params, write_path=write_path)
params = _read_RS_Metadata(params, source=source)
else:
warnings.warn(&#39;{} not currently supported\n Returning input params dictionary.&#39;.format(params[&#39;instrument&#39;]))
return params
if not pathlib.Path(invPath).exists() or invPath==&#39;&#39;:
warnings.warn(f&#34;The metapath parameter was not specified correctly. Returning original params value {params[&#39;metapath&#39;]}&#34;)
return params
readInvKwargs = {}
argspecs = inspect.getfullargspec(obspy.read_inventory)
for argName in argspecs[0]:
if argName in read_inventory_kwargs.keys():
readInvKwargs[argName] = read_inventory_kwargs[argName]

readInvKwargs[&#39;path_or_file_object&#39;] = invPath
params[&#39;inv&#39;] = obspy.read_inventory(invPath)
if &#39;params&#39; in params.keys():
params[&#39;params&#39;][&#39;inv&#39;] = params[&#39;inv&#39;]

return params

#Get or print report
Expand Down Expand Up @@ -6712,15 +6727,15 @@ <h2 id="parameters">Parameters</h2>
</details>
</dd>
<dt id="sprit.sprit_hvsr.fetch_data"><code class="name flex">
<span>def <span class="ident">fetch_data</span></span>(<span>params, inv=None, source='file', trim_dir=None, export_format='mseed', detrend='spline', detrend_order=2, update_metadata=True, plot_input_stream=False, verbose=False, **kwargs)</span>
<span>def <span class="ident">fetch_data</span></span>(<span>params, source='file', trim_dir=None, export_format='mseed', detrend='spline', detrend_order=2, update_metadata=True, plot_input_stream=False, verbose=False, **kwargs)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def fetch_data(params, inv=None, source=&#39;file&#39;, trim_dir=None, export_format=&#39;mseed&#39;, detrend=&#39;spline&#39;, detrend_order=2, update_metadata=True, plot_input_stream=False, verbose=False, **kwargs):
<pre><code class="python">def fetch_data(params, source=&#39;file&#39;, trim_dir=None, export_format=&#39;mseed&#39;, detrend=&#39;spline&#39;, detrend_order=2, update_metadata=True, plot_input_stream=False, verbose=False, **kwargs):
import warnings

&#34;&#34;&#34;Fetch ambient seismic data from a source to read into obspy stream
Expand All @@ -6730,8 +6745,6 @@ <h2 id="parameters">Parameters</h2>
params : dict
Dictionary containing all the necessary params to get data.
Parameters defined using input_params() function.
inv : obspy inventory object, default=None
Obspy inventory object containing metadata for instrument that collected data to be fetched. By default, the inventory object is read from params[&#39;inv&#39;], but this can be manually specified here too.
source : str, {&#39;raw&#39;, &#39;dir&#39;, &#39;file&#39;, &#39;batch&#39;}
String indicating where/how data file was created. For example, if raw data, will need to find correct channels.
&#39;raw&#39; finds raspberry shake data, from raw output copied using scp directly from Raspberry Shake, either in folder or subfolders;
Expand Down Expand Up @@ -7082,7 +7095,7 @@ <h2 id="parameters">Parameters</h2>
dataIN.merge()

params[&#39;batch&#39;] = False #Set False by default, will get corrected later in batch mode
params[&#39;input_stream&#39;] = dataIN
params[&#39;input_stream&#39;]
params[&#39;stream&#39;] = dataIN.copy()
params[&#39;ProcessingStatus&#39;][&#39;FetchDataStatus&#39;] = True
if verbose and not isinstance(params, HVSRBatch):
Expand Down Expand Up @@ -7375,7 +7388,7 @@ <h2 id="returns">Returns</h2>
</details>
</dd>
<dt id="sprit.sprit_hvsr.get_metadata"><code class="name flex">
<span>def <span class="ident">get_metadata</span></span>(<span>params, write_path='', update_metadata=True, source=None)</span>
<span>def <span class="ident">get_metadata</span></span>(<span>params, write_path='', update_metadata=True, source=None, **read_inventory_kwargs)</span>
</code></dt>
<dd>
<div class="desc"><p>Get metadata and calculate or get paz parameter needed for PPSD</p>
Expand All @@ -7387,6 +7400,10 @@ <h2 id="parameters">Parameters</h2>
<dt><strong><code>write_path</code></strong> :&ensp;<code>str</code></dt>
<dd>String with output filepath of where to write updated inventory or metadata file
If not specified, does not write file</dd>
<dt><strong><code>update_metadata</code></strong> :&ensp;<code>bool</code></dt>
<dd>Whether to update the metadata file itself, or just read as-is. If using provided raspberry shake metadata file, select True.</dd>
<dt><strong><code>source</code></strong> :&ensp;<code>str</code>, default=<code>None</code></dt>
<dd>This passes the source variable value to _read_RS_metadata. It is expected that this is passed directly from the source parameter of sprit.fetch_data()</dd>
</dl>
<h2 id="returns">Returns</h2>
<dl>
Expand All @@ -7397,7 +7414,7 @@ <h2 id="returns">Returns</h2>
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def get_metadata(params, write_path=&#39;&#39;, update_metadata=True, source=None):
<pre><code class="python">def get_metadata(params, write_path=&#39;&#39;, update_metadata=True, source=None, **read_inventory_kwargs):
&#34;&#34;&#34;Get metadata and calculate or get paz parameter needed for PPSD

Parameters
Expand All @@ -7408,6 +7425,10 @@ <h2 id="returns">Returns</h2>
write_path : str
String with output filepath of where to write updated inventory or metadata file
If not specified, does not write file
update_metadata : bool
Whether to update the metadata file itself, or just read as-is. If using provided raspberry shake metadata file, select True.
source : str, default=None
This passes the source variable value to _read_RS_metadata. It is expected that this is passed directly from the source parameter of sprit.fetch_data()

Returns
-------
Expand All @@ -7417,13 +7438,26 @@ <h2 id="returns">Returns</h2>

invPath = params[&#39;metapath&#39;]
raspShakeInstNameList = [&#39;raspberry shake&#39;, &#39;shake&#39;, &#39;raspberry&#39;, &#39;rs&#39;, &#39;rs3d&#39;, &#39;rasp. shake&#39;, &#39;raspshake&#39;]

if params[&#39;instrument&#39;].lower() in raspShakeInstNameList:
if update_metadata:
params = _update_shake_metadata(filepath=invPath, params=params, write_path=write_path)
params = _read_RS_Metadata(params, source=source)
else:
warnings.warn(&#39;{} not currently supported\n Returning input params dictionary.&#39;.format(params[&#39;instrument&#39;]))
return params
if not pathlib.Path(invPath).exists() or invPath==&#39;&#39;:
warnings.warn(f&#34;The metapath parameter was not specified correctly. Returning original params value {params[&#39;metapath&#39;]}&#34;)
return params
readInvKwargs = {}
argspecs = inspect.getfullargspec(obspy.read_inventory)
for argName in argspecs[0]:
if argName in read_inventory_kwargs.keys():
readInvKwargs[argName] = read_inventory_kwargs[argName]

readInvKwargs[&#39;path_or_file_object&#39;] = invPath
params[&#39;inv&#39;] = obspy.read_inventory(invPath)
if &#39;params&#39; in params.keys():
params[&#39;params&#39;][&#39;inv&#39;] = params[&#39;inv&#39;]

return params</code></pre>
</details>
</dd>
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "sprit"
authors = [{name="Riley Balikian"}, {name="Hongyu Xaio"}]
dynamic = ["readme"]
license = {file = "LICENSE"}
version="0.1.45"
version="0.1.46"
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.45",
version="0.1.46",
package_data={'sprit': ['resources/*', 'resources/icon/*', '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__/sprit_hvsr.cpython-310.pyc
Binary file not shown.

0 comments on commit d7d7d9c

Please sign in to comment.