X-RAY Flare Burst Deterministic Detection
Project description
Jux : Solar X-Ray Burst Detector
This package is concerned with identification and analysis of solar xray bursts in provided light curves. This package enables the user to analyse a lightcurve file through a multi-filter based approach resulting in a less noisy data and important flare paramters that can be fed to a Machine Learning Model for the detection of outliers among the flares in the given lightcurve.
How to install it?
pip install jux
Dependencies will build and you can proceed using it.
How to use it?
Inorder to use this package on a specific lightcurve file import the Lightcurve class from jux.jux. Create an instance of the Lightcurve class passing the path to the LightCurve file as an argument. The Lightcurve class contains mainly two functions:
-
Lightcurve.main()
-
The parameters to the function are:
-
picklePath - The path to an existing Pickle file containing the model parameters.
-
check_false_positives - This argument is set to False by default so the function returns the dataframe constructed with important parameters obtained from the filtered lightcurve data. Then this dataframe can be passed as an argument to the Lightcurve.train_classifier() method which will internally train a RandomForest model and save the model in a pickle file in the working directory. the output of the train_classifier method is the dataframe with outlier labels and corresoponds outlier scores. If this is set to True, the functions expects the pickle path of the model for inference,
-
-
-
Lightcurve.train_classifier()
-
The parameters to the function are:
- model_zip - the dataframe containing parameters like "_id", "time_ratio", "intensity_ratio", "bandwidth_1", "bandwidth_2", "error", which is obtained after passing the file to the main function.
-
Demo
from jux.jux import Lightcurve
lc = Lightcurve(path_to_lc_file)
X = lc.main(check_false_positives=False)
Y = lc.train_classifier(x)
These are the followng submodules present in this package:
helper.py
: Contains helper functions including analytical functions that were fitted to the posterior part of a flare.denoise.py
: Contains 3 algorithms including smoothening with fft, smoothening with median windowing and moving average smoothening.flare_detect_minmax.py
: Contains 7 deterministic and condition based filters that help pick out bursts from de-noised data.jux.py
: The main file containing classLightcurve
that accepts file path as argument, The main function will execute all de-noising and filtering and give out flare details and model fitted parameters that can then be used in the Isolation Classifier to detect false positives.false_positive_detection.py
: Contains the functions that can be uses sklearn's Isolation Classifier to pick out outliers in the flares detected by the algorithm implemented above.params.py
: Contains parameters that control all of the algorithms, context mentioned in the file itself.create_df_minmax.py
: Contains functions that handles the dataframe given as the output by filtering.
Algorithms explained
Smoothening of LC
Lightcurve we trained upon has quite a bit of noise, so for de-noising we tried the following:
- Moving Averaging : Taking a small window and taking its mean as the corresponding value for the whole interval, thus effectively reducing the time scale thus this is followed by interpolation
- Interpolation :
- Linear : We opted for Linear Interpolation because of its faster time complexity and not much effect in the results to our filtering algorithms
- Spline : Spline interpolation was tried and performed the best with the filters, but took much longer time, with complexity O(m^2*n)
- FFT Smoothing : Taking the FFT of the whole Light Curve wouldn't be possible as the signal is discontinuous, because we are only considering the GTI (Good Time Intervals). Thus doing that for every interval and again linear interpolation was done.
Filters used
- Filter 0 : Minima and Maxima detected
- Filter 1 : Pairing of minima and maxima
- Filter 2 : Slope Thresholding implemented
- Filter 3 : Height Thresholding implemented
- Filter 4 : Repeated pairs filtered off
- Filter 5 : Close flares filtered off
These filters together actually gave a great result in picking out what we perceived as flares, sharp rises and slow decays.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Jux-0.0.3.tar.gz
.
File metadata
- Download URL: Jux-0.0.3.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ce43468cc1144708a76406c2a983266a5198b561f1ba149eff9f18be16fc98c |
|
MD5 | e02e2f8e81cf67e7453cb69fb47ae376 |
|
BLAKE2b-256 | f8a33d0ac9dc177d6f7b1778709b0b55a24bcd14bb1c6a6c0ae8a5d7a3bd473b |
File details
Details for the file Jux-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: Jux-0.0.3-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4af30c029643742f4af87b31b78699c16e0417f11f8b62fe890e6de730df04b5 |
|
MD5 | d851d528d8f2991d5edbcfd3bb319a0b |
|
BLAKE2b-256 | db03652a38ec483f75f5aa9fb36a0952d3812510144a14d3ac13105d5c099c28 |