Skip to main content

StackMaster

A collection of methods for data stacking

Introduction

A collection of methods for stacking of generic time series data.

Available modules

This package is under active development. The currently available modules are listed here.

  1. utils: This module contains frequently used utility functions.

  2. core: This module contains core stacking functions.

Installation

  1. Install stackmaster package functions using pip
$ pip install stackmaster

This step will install the StackMaster package. The modules would then be imported under any working directory.

  1. Install with local copy:

cd to the directory you want to save the package files. Then run:

$ pip install .

Test the installation

Run the following commands to test your installation, under the root directory of StackMaster.

iimport os,pickle
import numpy as np
import matplotlib.pyplot as plt
from stackmaster.core import stack
from scipy.signal import sosfiltfilt, butter

dataroot='./data'
dfile=dataroot+"/stackmaster_testdataset.pk"
d=pickle.load(open(dfile,'rb'))

scale=60
data,dt,lag,d_id=[d["data"],d["dt"],d['lag'],d['id']]
tx=np.arange(-lag,lag+0.5*dt,dt)
extent=[-lag,lag,data.shape[0],0]
dn=data.copy()

sos=butter(4,[0.05,0.5],fs=1/dt,btype="bandpass",output='sos')

stack_method="robust"

for i in range(data.shape[0]):
    dn[i,:]=sosfiltfilt(sos,data[i,:]/np.max(np.abs(data[i,:])))

## plot
plt.figure(figsize=(10,5),facecolor="w")
plt.imshow(dn,extent=extent,cmap="seismic",aspect="auto")

dstack=stack(dn,method=stack_method)
plt.plot(tx,scale*dstack+0.5*data.shape[0],'k',lw=2,label=stack_method)
plt.vlines(0,0,data.shape[0],'k')
plt.xlim([-200,200])
plt.ylim([0,data.shape[0]])
plt.xticks(fontsize=14)
plt.yticks(fontsize=14)
plt.title(d_id)
plt.xlabel("time (s)",fontsize=14)
plt.ylabel("order",fontsize=14)
plt.legend(fontsize=12)
plt.show()

You should get a plot of the data and the stacked trace.

Tutorials on key functionalities

See https://github.com/xtyangpsp/StackMaster for tutorials and more detailed descriptions.

Contribute

Any bugs and ideas are welcome. Please file an issue through GitHub https://github.com/xtyangpsp/StackMaster.

References

  • To be added.

Metadata

Release files for stackmaster 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stackmaster 1.2.0
File Size Uploaded Provenance Actions
stackmaster-1.2.0.tar.gz 13.3 MB Without provenance Details for stackmaster-1.2.0.tar.gz

Release files / stackmaster-1.2.0.tar.gz

Download URL stackmaster-1.2.0.tar.gz
Size 13.3 MB
Tags Source
SHA-256 checksum
How to use checksums
719a3ac80735e6659ed685f2a8d88b41b8ffbfd65187907ce7a9ed867f89e3c2
BLAKE2b-256 checksum
How to use checksums
aabe41044bf1f2ee1b01bbce222ea097fdf1806aa0c15008725533f896872c20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.60.0 importlib-metadata/3.10.1 keyring/23.0.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.8.8

Security for stackmaster 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page