Total Complexity | 4 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # Licensed under a 3-clause BSD style license - see LICENSE |
||
2 | """Synthetic generation of light curves.""" |
||
3 | |||
4 | import logging |
||
5 | |||
6 | import numpy as np |
||
|
|||
7 | |||
8 | __all__ = ["Astro"] |
||
9 | |||
10 | log = logging.getLogger(__name__) |
||
11 | |||
12 | def pol_angle_reshape(s): |
||
13 | s = np.array(s) |
||
14 | s = np.mod(s,180) # s % 180 |
||
15 | print(np.amax(s)) |
||
16 | sn = np.empty(s.shape) |
||
17 | for i in range(1,len(s)): |
||
18 | #if t[i]-t[i-1] < 35: |
||
19 | d = 181 |
||
20 | n = 0 |
||
21 | for m in range(0,100): |
||
22 | m2 = (-1)**(m+1)*np.floor((m+1)/2) |
||
23 | if np.abs(s[i]+180*m2-sn[i-1]) < d: |
||
24 | d = np.abs(s[i]+180*m2-sn[i-1]) |
||
25 | n = m2 |
||
26 | sn[i] = s[i]+180*n |
||
27 | return sn |
||