1 | """ Flare analysis """ |
||
2 | |||
3 | import logging |
||
4 | |||
5 | import numpy as np |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
6 | import scipy as sp |
||
0 ignored issues
–
show
|
|||
7 | import pandas as pd |
||
0 ignored issues
–
show
|
|||
8 | |||
9 | import matplotlib as mplt |
||
0 ignored issues
–
show
|
|||
10 | import matplotlib.pyplot as plt |
||
0 ignored issues
–
show
|
|||
11 | |||
12 | import sys |
||
0 ignored issues
–
show
|
|||
13 | import os |
||
0 ignored issues
–
show
|
|||
14 | import glob |
||
0 ignored issues
–
show
|
|||
15 | |||
16 | import re |
||
0 ignored issues
–
show
|
|||
17 | from datetime import datetime |
||
0 ignored issues
–
show
|
|||
18 | |||
19 | from astropy.stats import bayesian_blocks |
||
0 ignored issues
–
show
|
|||
20 | |||
21 | import warnings |
||
0 ignored issues
–
show
|
|||
22 | |||
23 | from mutis import Signal |
||
0 ignored issues
–
show
|
|||
24 | #from mutis.flares.bayblocks import BayesianBlocks |
||
25 | import mutis.flares.bayblocks as bayblocks |
||
0 ignored issues
–
show
|
|||
26 | |||
27 | log = logging.getLogger(__name__) |
||
28 | |||
29 | |||
30 | |||
0 ignored issues
–
show
|
|||
31 | class Flare: |
||
32 | """Container class for a Flare object |
||
33 | |||
0 ignored issues
–
show
|
|||
34 | Attributes |
||
35 | ---------- |
||
36 | tstart: float |
||
37 | time at which the flare starts |
||
38 | tstop: float |
||
39 | time at which the flare ends |
||
40 | """ |
||
41 | |||
0 ignored issues
–
show
|
|||
42 | def __init__(self, tstart, tstop): |
||
43 | self.tstart = tstart |
||
44 | self.tstop = tstop |
||
45 | |||
0 ignored issues
–
show
|
|||
46 | def __repr__(self): |
||
47 | return f"Flare({self.tstart},{self.tstop})" |
||
48 | |||
0 ignored issues
–
show
|
|||
49 | def __str__(self): |
||
50 | return self.__repr__() |
||
51 | |||
0 ignored issues
–
show
|
|||
52 | |||
0 ignored issues
–
show
|
|||
53 | def plot(self, ax=None, **kwargs): |
||
0 ignored issues
–
show
Argument name "ax" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)
This check looks for invalid names for a range of different identifiers. You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements. If your project includes a Pylint configuration file, the settings contained in that file take precedence. To find out more about Pylint, please refer to their site. ![]() |
|||
54 | """Plots the flare as a colored area """ |
||
55 | ax = plt.gca() if ax is None else ax |
||
56 | |||
0 ignored issues
–
show
|
|||
57 | ax.axvspan(self.tstart, self.tstop, facecolor='r', edgecolor=None, alpha=0.2, **kwargs) |
||
58 | |||
0 ignored issues
–
show
|
|||
59 | pass |
||
0 ignored issues
–
show
|
|||
60 |