Giter Club home page Giter Club logo

psd_analysis's Introduction

psd_analysis

Scripts to determine the power spectral density (PSD) of blazar light curves.

Requirements

This script uses the following standard python packages:

  • datetime
  • math
  • os
  • sys

This script uses the following python packages:

  • numpy
  • scipy
  • statsmodels
  • matplotlib
  • pytables

Getting Started

Get the python script:

$ git clone https://github.com/skiehl/psd_analysis.git

Usage

powerspectraldensity.py contains the relevant scripts. run_psd_analysis.py provides a useful "wrapper" script for easily running the PSD analysis for many light curves. In the CONFIG part of the script all parameters for the analsis can be set. In the MAIN part the "load data" lines may be edited if the light curve files follow a different file structure than assumed here.

Example

An example of a light curve, the analysis, and the resulting plots and data files is given in the directory example/.

Notes

  • This PSD analysis code is an extension of the algorithm introduced by [1]. The detailed explanation is given in [2].
  • Different PSD models are implemented in the script (power-law, broken power-law, knee-model, explained in [1]). However, the optimization is only implemented for the power-law model, which has a single free parameter. Any other models do not work with the current code.
  • In principle this code allows us to use the light curve simulation algorithm by [4]. Everything necessary is implemented and could be chosen by setting scaling = 'pdf' in the CONFIG part of run_psd_analysis.py. However, in [1] Sec. 4.2.5 I showed that the simulation algorithm by [4] is not feasible for estimating the PSD, because it will lead to strong biases. While this implementation still allows its usage, the user should be strongly discouraged from doing so.
  • Though first uploaded to GitHub in 2023, the script was originally written in 2015 for python 2.7, with some modifications made over the years. This is now a port to python 3 with updated string formatting, updated docstrings, and with some new formatting of the script files. My programming style has strongly changed (evolved, I would claim) over these years. This code now may be inconsistently formatted. Generally, I find it not well structured. And as explained in the points above, the code includes functions that cannot or should not be used. I would favor a complete overhaul of this code, but currently I do not have the time to do it. Maybe it is useful to someone in its current form nethertheless.

References

[1] Uttley et al., 2002 [2] Kiehlmann, 2015 [2] Timmer&Koenig, 1995. [3] Emmanoulopoulos et al., 2013.

License

psd_analysis is licensed under the BSD 3-Clause License - see the LICENSE file.

Alternatives

At least one other python implementation of this method is available on GitHub:

psd_analysis's People

Contributors

skiehl avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

syc20020618

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.