Giter Club home page Giter Club logo

lcsim's Introduction

ascl:2310.002

lcsim

A python3 package to create artificial blazar light curves with a predefined power spectral density (PSD) and probability density function (PDF).

Requirements

The lcsim script uses the following standard python packages:

  • copy
  • math

The lcsim script uses the following python packages:

  • numpy
  • scipy
  • statsmodels

The simdb script uses the following standard python packages:

  • os
  • sys

The simdb script uses the following python packages:

  • numpy
  • sqlite3

Getting Started

Get the python scripts:

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

Open the jupyter notebook SimulationDemo.ipynb for a demonstation of the code. Either use jupyter lab:

$ jupyter lab

Or jupyter notebook:

$ jupyter notebook SimulationDemo.ipynb

Modules

  • lcsim.py: The main module for simulating light curves.
  • simdb.py: A SQLite3-based database backend to store simulations.
  • run_lcsim.py: A wrapper script to run and save light curve simulations for multiple sources.

Usage

Usage of the package is demonstrated in the jupyter notebook SimulationDemo.ipynb

Note: Documentation of the simdb.py module is not yet included.

A complete code documentation is given in html/.

Citation

Bibtex:

@MISC{2023ascl.soft10002K,
       author = {{Kiehlmann}, Sebastian},
        title = "{lcsim: Light curve simulation code}",
     keywords = {Software},
 howpublished = {Astrophysics Source Code Library, record ascl:2310.002},
         year = 2023,
        month = oct,
          eid = {ascl:2310.002},
        pages = {ascl:2310.002},
archivePrefix = {ascl},
       eprint = {2310.002},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2023ascl.soft10002K},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

This software package is indexed on ASCL and ADS.

License

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

References

Timmer&Koenig, 1995. Emmanoulopoulos et al., 2013.

Alternatives

At least on other python implementations of the Emmanoulopoulos+ method is available:

lcsim's People

Contributors

skiehl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lcsim's Issues

Method to check PDF

Add a method to check the PDF of simulated light curves against a target PDF and accept/reject simulations based on a matching criterion.

Parallelization

Parallelize the simulation of multiple light curves and/or the Emmanoulopoulos algorithm.

Verbosity

Add verbosity option to the main methods to get some feedback about the progress.

Separate number of light curves from low power coverage

Currently, power at lower frequencies can be included by setting nlcs>1 in the sim_tk() or sim_emp() methods. With e.g. nlcs=10, a single long light curve is simulated ten times as long as the requested total time. This is then split into 10 independent light curves, that have the requested total time, but include power at frequencies ten times lower than the one corresponding to the total time of the light curves. With this setup it is not possible to produce more than 10 light curves with a single method call, if this is the low frequency range that is wished for. Either even lower frequencies need to be included by increasing nlcs, which increases the run time as the long light curve grows in length, or multiple method calls are required.
The low frequency coverage should be separated from the number of light curves.

multi_logn method should be moved

The multi_logn method implements a custom distribution. It is not an integral part of the LightCurveSimulator class and should not be part of it. Better move it to a separate module.

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.