Giter Site home page Giter Site logo

meanperiodspacing's Introduction

mean period spacing

Statistical tests for mean spacings among a set of values.

If you use this code in your work, I would appreciate an acknowledgement.

I describe how these tests work in a blog post at https://keatonb.github.io/archivers/mps

Usage example:

# Values to test for mean spacings
values = np.array([640.533, 678.433, 597.554, 485.527, 604.642, 557.649, 749.27, 865.97]) 

# Determine what spacings to sample in the range of interest
maxperiod = 60
minperiod = 15
periodsample = getperiodsampling(values, minperiod, maxperiod, oversample_factor=20)

# Run all three mean-period-spacing tests
iv = IV(values, periodsample)
ks = KS(values, periodsample)
ft = FT(values, periodsample)

# Plot the results
fig, axs = plt.subplots(3,1)

axs[0].plot(periodsample, iv)
axs[0].set_title("Inverse Variance")
axs[0].set_ylabel("IV")
axs[0].set_ylim(0)

axs[1].plot(periodsample, ks)
axs[1].set_title("K-S Test")
axs[1].set_ylabel("log(Q)")

axs[2].plot(periodsample, ft)
axs[2].set_title("Fourier Transform")
axs[2].set_ylabel("power")
axs[2].set_ylim(0)

for ax in axs:
    ax.set_xlim(periodsample[0],periodsample[-1])
    ax.set_xlabel("period")

plt.tight_layout()
plt.show()

Here is the resulting plot, with all three tests supporting a mean period spacing around 38 seconds.

mpstests

meanperiodspacing's People

Contributors

keatonb avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.