Giter Club home page Giter Club logo

bayesflare's Introduction

BayesFlare

Semver GitHub version

Automated flare-finding algorithm for Kepler photometric data

This repository contains a series of Python scripts which are designed to analyse photometric data produced by the Kepler program to find flaring events. The long-term aim for the program is to be capable of running on data from all quarters collected by the spacecraft, and at both long and short cadences.

If using this code for a publication would we be grateful if you cite the paper by Pitkin, Williams, Fletcher & Grant, arXiv:1406.1712.

Requirements

  • Python 2.7
  • NumPy 1.6.1
  • SciPy 0.9.0
  • Matplotlib 1.1.1
  • PyFITS 2.4.0

Documentation

The documentation is available online at readthedocs.

The Documentation for BayesFlare is produced by Sphinx with two extension packages,

  • numpydoc
  • sphinx_rtd_theme

bayesflare's People

Contributors

mattpitkin avatar transientlunatic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bayesflare's Issues

New smoothing method

I've recently seen the @jakevdp's supersmoother code and it looks like a nice option for trying to smooth the Kepler data - in particular the periodic functionality that it has. I should implement this soon and seen how it effects flares, or whether it is able to leave them relatively untouched.

Allow the background variations to be sinusoids

I have created a patch that allows the background variations in the light curve to be modelled by a number of sinusoids as well as a polynomial variation. If you specify how many sinusoids to fit then the code will perform a Lomb-Scargle periodogram of the light curve and find the frequencies of the peaks. It will sort the peaks in descending amplitude and use the number of sinusoids you specified from this descending list. The amplitude and phase of each of these will then be analytically marginalised over (by splitting each sinusoid into a sine and cosine part with separate amplitudes, e.g. Bretthort, and marginalising over the amplitudes in the same way as is done for the polynomial coefficients. This will hopefully help allow the code to be used when high frequency variations are present, and remove some of the effects of the sliding background window.

Some other minor things in the patch:

  • In the Bayes factor functions I've now removed the bits of code that tried to deal with edge effects (e.g. the model sliding onto and off of the data). This was just confusing code and was generally redundant as you would generally just ignore the edges of the data anyway.
  • In the cython codes now just refer to the number of background models and not the background polynomial order. This makes things more general and slightly less confusing.

import problem

Hello,

when I try to import the package I get the following error, I'm running it on a Mac:

import bayesflare
Traceback (most recent call last):
File "", line 1, in
File "/Users/aaron/anaconda/lib/python2.7/site-packages/bayesflare/init.py", line 36, in
from .models import Model, Flare, Transit, Expdecay, Impulse, Gaussian, Step, ModelCurve
File "/Users/aaron/anaconda/lib/python2.7/site-packages/bayesflare/models/init.py", line 5, in
from .model import Model, Flare, Transit, Expdecay, Impulse, Gaussian, Step, ModelCurve
File "/Users/aaron/anaconda/lib/python2.7/site-packages/bayesflare/models/model.py", line 4, in
from ..stats.general import logminus
File "/Users/aaron/anaconda/lib/python2.7/site-packages/bayesflare/stats/init.py", line 11, in
from .general import *
ImportError: No module named general

Use lightkurve?

If we continue maintaining bayesflare we should probably switch to using lightkurve for loading and storing Kepler light curves (it also works with TESS light curves too).

Faster periodogram calculation

When calculating the Lomb-Scargle periodogram there appears to be a fast method available in astroML/gatspy (see also here). It may be worth implementing this as the current periodogram calculation does take a fair bit of time.

Model classes updated

In the models branch there have been enhancements so that there is now a generic Model class. The individual signal models (e.g. the Flare model) now inherit the characteristics of the Model class.

In this update the methods within the classes that define the model function now only take in dictionaries of parameter values, with the dictionaries having to contain parameters required for the given model.

A new model class for a Step function is also included.

This has been tested and the plot_lightcurve script works correctly, but other tests should be performed (i.e. do the analysis scripts, and threshold/efficiency scripts still work). It should then be merged with the master branch and a new release be created.

Generalisation of the Lightcurve Class

The Lightcurve class, which is used to handle observational data within the package is currently suitable only for working with Kepler data.

An improved approach should include means of working with data from solar observatories such as GOES and RHESSI, with the option to work with other data sources, including neutron observations.

I propose to rewrite the Lightcurve class, while preserving backwards-compatibility, and utilising pydata/pandas, further, I propose incorporating `transientlunatic/lightcurve' as a Git submodule to do this, to allow the code to be reused outside the BayesFlare project.

An important consideration will be maintaining backwards-compatibility, and to do this a number of methods may need to be added purely for compatibility.

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.