1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
|
%global _empty_manifest_terminate_build 0
Name: python-astrobase
Version: 0.5.3
Release: 1
Summary: Python modules and scripts useful for variable star work in astronomy.
License: MIT
URL: https://github.com/waqasbhatti/astrobase
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/ee/39/35b98fc1b57ce23ea5017b335cc09821290844452306e5be8e1a0aa86b09/astrobase-0.5.3.tar.gz
BuildArch: noarch
Requires: python3-numpy
Requires: python3-scipy
Requires: python3-astropy
Requires: python3-matplotlib
Requires: python3-Pillow
Requires: python3-jplephem
Requires: python3-requests
Requires: python3-tornado
Requires: python3-pyeebls
Requires: python3-tqdm
Requires: python3-scikit-learn
Requires: python3-psycopg2-binary
Requires: python3-emcee
Requires: python3-h5py
Requires: python3-batman-package
Requires: python3-corner
Requires: python3-transitleastsquares
Requires: python3-paramiko
Requires: python3-boto3
Requires: python3-awscli
Requires: python3-google-api-python-client
Requires: python3-google-cloud-storage
Requires: python3-google-cloud-pubsub
Requires: python3-paramiko
Requires: python3-boto3
Requires: python3-awscli
Requires: python3-paramiko
Requires: python3-google-api-python-client
Requires: python3-google-cloud-storage
Requires: python3-google-cloud-pubsub
Requires: python3-emcee
Requires: python3-h5py
Requires: python3-batman-package
Requires: python3-corner
Requires: python3-emcee
Requires: python3-h5py
Requires: python3-batman-package
Requires: python3-transitleastsquares
Requires: python3-corner
%description
[](https://zenodo.org/badge/latestdoi/75150575) [](https://astrobase.readthedocs.io/en/latest/?badge=latest)
Astrobase is a Python package for analyzing light curves and finding variable
stars. It includes implementations of several period-finding algorithms, batch
work drivers for working on large collections of light curves, and a small
web-app useful for reviewing and classifying light curves by stellar variability
type.
Most functions in this package that deal with light curves usually require three
Numpy ndarrays as input: `times`, `mags`, and `errs`, so they should work with
any time-series data that can be represented in this form. If you have flux time
series measurements, most functions also take a `magsarefluxes` keyword argument
that makes them handle flux light curves correctly.
- Read the docs: https://astrobase.readthedocs.io/en/latest/
- Jupyter notebooks that demonstrate some of the functionality are available in
the [astrobase-notebooks](https://github.com/waqasbhatti/astrobase-notebooks)
repository.
- A [overview](#contents) of the modules and subpackages is provided below.
Install **[astrobase](https://pypi.org/project/astrobase/)** from the
Python Package Index (PyPI):
```bash
$ pip install numpy # needed to set up Fortran wrappers
$ pip install astrobase
```
See the [installation instructions](#installation) below for details. This
package requires Python >= 3.5 as of version 0.5.0. Use `pip install
astrobase<0.5.0` for older Python versions.
Python 3.6: [](https://ci.wbhatti.org/job/astrobase-py3)
Python 3.7: [](https://ci.wbhatti.org/job/astrobase-py37)
Python 3.8: [](https://ci.wbhatti.org/job/astrobase-py38)
Python 3.9: [](https://ci.wbhatti.org/job/astrobase-py39)
# Contents
- **[astrokep](https://astrobase.readthedocs.io/en/latest/astrobase.astrokep.html)**:
contains functions for dealing with Kepler and K2 Mission light curves from
STScI MAST (reading the FITS files, consolidating light curves for objects
over quarters), and some basic operations (converting fluxes to mags,
decorrelation of light curves, filtering light curves, and fitting object
centroids for eclipse analysis, etc.)
- **[astrotess](https://astrobase.readthedocs.io/en/latest/astrobase.astrotess.html)**:
contains functions for dealing with TESS 2-minute cadence light curves from
STScI MAST (reading the FITS files, consolidating light curves for objects
over sectors), and some basic operations (converting fluxes to mags, filtering
light curves, etc.)
- **[checkplot](https://astrobase.readthedocs.io/en/latest/astrobase.checkplot.html)**:
contains functions to make checkplots: a grid of plots used to quickly decide
if a period search for a possibly variable object was successful. Checkplots
come in two forms:
Python pickles: If you want to interactively browse through large numbers of
checkplots (e.g., as part of a large variable star classification project),
you can use the `checkplotserver` webapp that works on checkplot pickle
files. This interface allows you to review all phased light curves from all
period-finder methods applied, set and save variability tags, object type
tags, best periods and epochs, and comments for each object using a
browser-based UI (see below). The information entered can then be exported as
CSV or JSON for the next stage of a variable star classification pipeline.
The
[lightcurves-and-checkplots](https://nbviewer.jupyter.org/github/waqasbhatti/astrobase-notebooks/blob/master/lightcurves-and-checkplots.ipynb)
Jupyter notebook outlines how to do this. A more detailed example using light
curves of an arbitrary format is available in the
[lc-collection-work](https://nbviewer.jupyter.org/github/waqasbhatti/astrobase-notebooks/blob/master/lc-collection-work.ipynb)
notebook, which shows how to add in support for a custom LC format, add
neighbor, cross-match, and color-mag diagram info to checkplots, and visualize
these with the checkplotserver.

PNG images: Alternatively, if you want to simply glance through lots of
checkplots (e.g. for an initial look at a collection of light curves), there's
a `checkplot-viewer` webapp available that operates on checkplot PNG
images. The
[lightcurve-work](https://nbviewer.jupyter.org/github/waqasbhatti/astrobase-notebooks/blob/master/lightcurve-work.ipynb)
Jupyter notebook goes through an example of generating these checkplot PNGs
for light curves. See the
[checkplot-viewer.js](https://github.com/waqasbhatti/astrobase/blob/master/astrobase/cpserver/checkplot-viewer.js) file for more
instructions and [checkplot-viewer.png](https://raw.githubusercontent.com/waqasbhatti/astrobase/master/astrobase/data/checkplot-viewer.png)
for a screenshot.
- **[coordutils](https://astrobase.readthedocs.io/en/latest/astrobase.coordutils.html)**:
functions for dealing with coordinates (conversions, distances, proper motion)
- **[fakelcs](https://astrobase.readthedocs.io/en/latest/astrobase.fakelcs.html)**:
modules and functions to conduct an end-to-end variable star recovery
simulation.
- **[hatsurveys](https://astrobase.readthedocs.io/en/latest/astrobase.hatsurveys.html)**:
modules to read, filter, and normalize light curves from various HAT surveys.
- **[lcfit](https://astrobase.readthedocs.io/en/latest/astrobase.lcfit.html)**:
functions for fitting light curve models to observations, including
sinusoidal, trapezoidal and full Mandel-Agol planet transits, eclipses, and
splines.
- **[lcmath](https://astrobase.readthedocs.io/en/latest/astrobase.lcmath.html)**: functions for light curve operations such
as phasing, normalization, binning (in time and phase), sigma-clipping,
external parameter decorrelation (EPD), etc.
- **[lcmodels](https://astrobase.readthedocs.io/en/latest/astrobase.lcmodels.html)**:
first order models for fast fitting (for the purposes of variable
classification) to various periodic variable types, including sinusoidal
variables, eclipsing binaries, transiting planets, and flares.
- **[lcproc](https://astrobase.readthedocs.io/en/latest/astrobase.lcproc.html)**:
driver functions for running an end-to-end pipeline including: (i) object
selection from a collection of light curves by position, cross-matching to
external catalogs, or light curve objectinfo keys, (ii) running variability
feature calculation and detection, (iii) running period-finding, and (iv)
object review using the checkplotserver webapp for variability
classification.
- **[periodbase](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.html)**: parallelized functions (using
`multiprocessing.map`) to run fast period searches on light curves, including:
the generalized Lomb-Scargle algorithm from Zechmeister & Kurster
([2008](http://adsabs.harvard.edu/abs/2009A%26A...496..577Z);
**[periodbase.zgls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.zgls.html)**), the phase dispersion
minimization algorithm from Stellingwerf
([1978](http://adsabs.harvard.edu/abs/1978ApJ...224..953S),
[2011](http://adsabs.harvard.edu/abs/2011rrls.conf...47S);
**[periodbase.spdm](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.spdm.html)**), the AoV and
AoV-multiharmonic algorithms from Schwarzenberg-Czerny
([1989](http://adsabs.harvard.edu/abs/1989MNRAS.241..153S),
[1996](http://adsabs.harvard.edu/abs/1996ApJ...460L.107S);
**[periodbase.saov](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.saov.html)**,
**[periodbase.smav](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.smav.html)**), the BLS algorithm from
Kovacs et al. ([2002](http://adsabs.harvard.edu/abs/2002A%26A...391..369K);
**[periodbase.kbls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.kbls.html)**
and **[periodbase.abls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.abls.html)**),
the similar TLS algorithm from Hippke & Heller
([2019](https://ui.adsabs.harvard.edu/abs/2019A%26A...623A..39H/abstract);
**[periodbase.htls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.htls.html)**),
and the ACF period-finding algorithm from McQuillan et al.
([2013a](http://adsabs.harvard.edu/abs/2013MNRAS.432.1203M),
[2014](http://adsabs.harvard.edu/abs/2014ApJS..211...24M);
**[periodbase.macf](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.macf.html)**).
- **[plotbase](https://astrobase.readthedocs.io/en/latest/astrobase.plotbase.html)**: functions to plot light curves, phased
light curves, periodograms, and download Digitized Sky Survey cutouts from the
NASA SkyView service.
- **[services](https://astrobase.readthedocs.io/en/latest/astrobase.services.html)**: modules and functions to query various
astronomical catalogs and data services, including GAIA, SIMBAD, TRILEGAL,
NASA SkyView, and 2MASS DUST.
- **[timeutils](https://astrobase.readthedocs.io/en/latest/astrobase.timeutils.html)**: functions for converting from
Julian dates to Baryocentric Julian dates, and precessing coordinates between
equinoxes and due to proper motion; this will automatically download and save
the JPL ephemerides **de430.bsp** from JPL upon first import.
- **[varbase](https://astrobase.readthedocs.io/en/latest/astrobase.varbase.html)**:
functions for calculating auto-correlation features, masking and pre-whitening
periodic signals in light curves, and planet transit specific tools.
- **[varclass](https://astrobase.readthedocs.io/en/latest/astrobase.varclass.html)**: functions for calculating various
variability, stellar color and motion, and neighbor proximity features, along
with a Random Forest based classifier.
# Changelog
Please see https://github.com/waqasbhatti/astrobase/blob/master/CHANGELOG.md for
a list of changes applicable to tagged release versions.
# Installation
## Requirements
This package requires the following other packages:
- numpy
- scipy
- astropy
- matplotlib
- Pillow
- jplephem
- requests
- tornado
- pyeebls
- tqdm
- scikit-learn
For optional functionality, some additional packages are required:
- for `astrobase.lcdb` to work, you'll need `psycopg2-binary`.
- for `lcfit.transits.mandelagol_fit_magseries`, you'll need `batman-package`,
`emcee`, `corner`, and `h5py`.
- for `lcproc.awsrun`, you'll need `paramiko`, `boto3`, and `awscli`.
- for `periodbase.tls`, you'll need `transitleastsquares`
## Installing with pip
If you're using:
- 64-bit Linux and Python 2.7, 3.4, 3.5, 3.6, 3.7
- 64-bit Mac OSX 10.12+ with Python 2.7 or 3.6
- 64-bit Windows with Python 2.7 and 3.6
You can simply install astrobase with:
```bash
(venv)$ pip install astrobase
```
Otherwise, you'll need to make sure that a Fortran compiler and numpy are
installed beforehand to compile the pyeebls package that astrobase depends on:
```bash
## you'll need a Fortran compiler. ##
## on Linux: dnf/yum/apt install gcc gfortran ##
## on OSX (using homebrew): brew install gcc && brew link gcc ##
## make sure numpy is installed as well! ##
## this is required for the pyeebls module installation ##
(venv)$ pip install numpy # in a virtualenv
# or use dnf/yum/apt install numpy to install systemwide
```
Once that's done, install astrobase.
```bash
(venv)$ pip install astrobase
```
### Other installation methods
Install all the optional dependencies as well:
```bash
(venv)$ pip install astrobase[all]
```
Install the latest version (may be unstable at times):
```bash
$ git clone https://github.com/waqasbhatti/astrobase
$ cd astrobase
$ python setup.py install
$ # or use pip install . to install requirements automatically
$ # or use pip install -e . to install in develop mode along with requirements
$ # or use pip install -e .[all] to install in develop mode along with all requirements
```
# License
`astrobase` is provided under the MIT License. See the LICENSE file for the full
text.
%package -n python3-astrobase
Summary: Python modules and scripts useful for variable star work in astronomy.
Provides: python-astrobase
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-astrobase
[](https://zenodo.org/badge/latestdoi/75150575) [](https://astrobase.readthedocs.io/en/latest/?badge=latest)
Astrobase is a Python package for analyzing light curves and finding variable
stars. It includes implementations of several period-finding algorithms, batch
work drivers for working on large collections of light curves, and a small
web-app useful for reviewing and classifying light curves by stellar variability
type.
Most functions in this package that deal with light curves usually require three
Numpy ndarrays as input: `times`, `mags`, and `errs`, so they should work with
any time-series data that can be represented in this form. If you have flux time
series measurements, most functions also take a `magsarefluxes` keyword argument
that makes them handle flux light curves correctly.
- Read the docs: https://astrobase.readthedocs.io/en/latest/
- Jupyter notebooks that demonstrate some of the functionality are available in
the [astrobase-notebooks](https://github.com/waqasbhatti/astrobase-notebooks)
repository.
- A [overview](#contents) of the modules and subpackages is provided below.
Install **[astrobase](https://pypi.org/project/astrobase/)** from the
Python Package Index (PyPI):
```bash
$ pip install numpy # needed to set up Fortran wrappers
$ pip install astrobase
```
See the [installation instructions](#installation) below for details. This
package requires Python >= 3.5 as of version 0.5.0. Use `pip install
astrobase<0.5.0` for older Python versions.
Python 3.6: [](https://ci.wbhatti.org/job/astrobase-py3)
Python 3.7: [](https://ci.wbhatti.org/job/astrobase-py37)
Python 3.8: [](https://ci.wbhatti.org/job/astrobase-py38)
Python 3.9: [](https://ci.wbhatti.org/job/astrobase-py39)
# Contents
- **[astrokep](https://astrobase.readthedocs.io/en/latest/astrobase.astrokep.html)**:
contains functions for dealing with Kepler and K2 Mission light curves from
STScI MAST (reading the FITS files, consolidating light curves for objects
over quarters), and some basic operations (converting fluxes to mags,
decorrelation of light curves, filtering light curves, and fitting object
centroids for eclipse analysis, etc.)
- **[astrotess](https://astrobase.readthedocs.io/en/latest/astrobase.astrotess.html)**:
contains functions for dealing with TESS 2-minute cadence light curves from
STScI MAST (reading the FITS files, consolidating light curves for objects
over sectors), and some basic operations (converting fluxes to mags, filtering
light curves, etc.)
- **[checkplot](https://astrobase.readthedocs.io/en/latest/astrobase.checkplot.html)**:
contains functions to make checkplots: a grid of plots used to quickly decide
if a period search for a possibly variable object was successful. Checkplots
come in two forms:
Python pickles: If you want to interactively browse through large numbers of
checkplots (e.g., as part of a large variable star classification project),
you can use the `checkplotserver` webapp that works on checkplot pickle
files. This interface allows you to review all phased light curves from all
period-finder methods applied, set and save variability tags, object type
tags, best periods and epochs, and comments for each object using a
browser-based UI (see below). The information entered can then be exported as
CSV or JSON for the next stage of a variable star classification pipeline.
The
[lightcurves-and-checkplots](https://nbviewer.jupyter.org/github/waqasbhatti/astrobase-notebooks/blob/master/lightcurves-and-checkplots.ipynb)
Jupyter notebook outlines how to do this. A more detailed example using light
curves of an arbitrary format is available in the
[lc-collection-work](https://nbviewer.jupyter.org/github/waqasbhatti/astrobase-notebooks/blob/master/lc-collection-work.ipynb)
notebook, which shows how to add in support for a custom LC format, add
neighbor, cross-match, and color-mag diagram info to checkplots, and visualize
these with the checkplotserver.

PNG images: Alternatively, if you want to simply glance through lots of
checkplots (e.g. for an initial look at a collection of light curves), there's
a `checkplot-viewer` webapp available that operates on checkplot PNG
images. The
[lightcurve-work](https://nbviewer.jupyter.org/github/waqasbhatti/astrobase-notebooks/blob/master/lightcurve-work.ipynb)
Jupyter notebook goes through an example of generating these checkplot PNGs
for light curves. See the
[checkplot-viewer.js](https://github.com/waqasbhatti/astrobase/blob/master/astrobase/cpserver/checkplot-viewer.js) file for more
instructions and [checkplot-viewer.png](https://raw.githubusercontent.com/waqasbhatti/astrobase/master/astrobase/data/checkplot-viewer.png)
for a screenshot.
- **[coordutils](https://astrobase.readthedocs.io/en/latest/astrobase.coordutils.html)**:
functions for dealing with coordinates (conversions, distances, proper motion)
- **[fakelcs](https://astrobase.readthedocs.io/en/latest/astrobase.fakelcs.html)**:
modules and functions to conduct an end-to-end variable star recovery
simulation.
- **[hatsurveys](https://astrobase.readthedocs.io/en/latest/astrobase.hatsurveys.html)**:
modules to read, filter, and normalize light curves from various HAT surveys.
- **[lcfit](https://astrobase.readthedocs.io/en/latest/astrobase.lcfit.html)**:
functions for fitting light curve models to observations, including
sinusoidal, trapezoidal and full Mandel-Agol planet transits, eclipses, and
splines.
- **[lcmath](https://astrobase.readthedocs.io/en/latest/astrobase.lcmath.html)**: functions for light curve operations such
as phasing, normalization, binning (in time and phase), sigma-clipping,
external parameter decorrelation (EPD), etc.
- **[lcmodels](https://astrobase.readthedocs.io/en/latest/astrobase.lcmodels.html)**:
first order models for fast fitting (for the purposes of variable
classification) to various periodic variable types, including sinusoidal
variables, eclipsing binaries, transiting planets, and flares.
- **[lcproc](https://astrobase.readthedocs.io/en/latest/astrobase.lcproc.html)**:
driver functions for running an end-to-end pipeline including: (i) object
selection from a collection of light curves by position, cross-matching to
external catalogs, or light curve objectinfo keys, (ii) running variability
feature calculation and detection, (iii) running period-finding, and (iv)
object review using the checkplotserver webapp for variability
classification.
- **[periodbase](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.html)**: parallelized functions (using
`multiprocessing.map`) to run fast period searches on light curves, including:
the generalized Lomb-Scargle algorithm from Zechmeister & Kurster
([2008](http://adsabs.harvard.edu/abs/2009A%26A...496..577Z);
**[periodbase.zgls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.zgls.html)**), the phase dispersion
minimization algorithm from Stellingwerf
([1978](http://adsabs.harvard.edu/abs/1978ApJ...224..953S),
[2011](http://adsabs.harvard.edu/abs/2011rrls.conf...47S);
**[periodbase.spdm](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.spdm.html)**), the AoV and
AoV-multiharmonic algorithms from Schwarzenberg-Czerny
([1989](http://adsabs.harvard.edu/abs/1989MNRAS.241..153S),
[1996](http://adsabs.harvard.edu/abs/1996ApJ...460L.107S);
**[periodbase.saov](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.saov.html)**,
**[periodbase.smav](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.smav.html)**), the BLS algorithm from
Kovacs et al. ([2002](http://adsabs.harvard.edu/abs/2002A%26A...391..369K);
**[periodbase.kbls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.kbls.html)**
and **[periodbase.abls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.abls.html)**),
the similar TLS algorithm from Hippke & Heller
([2019](https://ui.adsabs.harvard.edu/abs/2019A%26A...623A..39H/abstract);
**[periodbase.htls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.htls.html)**),
and the ACF period-finding algorithm from McQuillan et al.
([2013a](http://adsabs.harvard.edu/abs/2013MNRAS.432.1203M),
[2014](http://adsabs.harvard.edu/abs/2014ApJS..211...24M);
**[periodbase.macf](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.macf.html)**).
- **[plotbase](https://astrobase.readthedocs.io/en/latest/astrobase.plotbase.html)**: functions to plot light curves, phased
light curves, periodograms, and download Digitized Sky Survey cutouts from the
NASA SkyView service.
- **[services](https://astrobase.readthedocs.io/en/latest/astrobase.services.html)**: modules and functions to query various
astronomical catalogs and data services, including GAIA, SIMBAD, TRILEGAL,
NASA SkyView, and 2MASS DUST.
- **[timeutils](https://astrobase.readthedocs.io/en/latest/astrobase.timeutils.html)**: functions for converting from
Julian dates to Baryocentric Julian dates, and precessing coordinates between
equinoxes and due to proper motion; this will automatically download and save
the JPL ephemerides **de430.bsp** from JPL upon first import.
- **[varbase](https://astrobase.readthedocs.io/en/latest/astrobase.varbase.html)**:
functions for calculating auto-correlation features, masking and pre-whitening
periodic signals in light curves, and planet transit specific tools.
- **[varclass](https://astrobase.readthedocs.io/en/latest/astrobase.varclass.html)**: functions for calculating various
variability, stellar color and motion, and neighbor proximity features, along
with a Random Forest based classifier.
# Changelog
Please see https://github.com/waqasbhatti/astrobase/blob/master/CHANGELOG.md for
a list of changes applicable to tagged release versions.
# Installation
## Requirements
This package requires the following other packages:
- numpy
- scipy
- astropy
- matplotlib
- Pillow
- jplephem
- requests
- tornado
- pyeebls
- tqdm
- scikit-learn
For optional functionality, some additional packages are required:
- for `astrobase.lcdb` to work, you'll need `psycopg2-binary`.
- for `lcfit.transits.mandelagol_fit_magseries`, you'll need `batman-package`,
`emcee`, `corner`, and `h5py`.
- for `lcproc.awsrun`, you'll need `paramiko`, `boto3`, and `awscli`.
- for `periodbase.tls`, you'll need `transitleastsquares`
## Installing with pip
If you're using:
- 64-bit Linux and Python 2.7, 3.4, 3.5, 3.6, 3.7
- 64-bit Mac OSX 10.12+ with Python 2.7 or 3.6
- 64-bit Windows with Python 2.7 and 3.6
You can simply install astrobase with:
```bash
(venv)$ pip install astrobase
```
Otherwise, you'll need to make sure that a Fortran compiler and numpy are
installed beforehand to compile the pyeebls package that astrobase depends on:
```bash
## you'll need a Fortran compiler. ##
## on Linux: dnf/yum/apt install gcc gfortran ##
## on OSX (using homebrew): brew install gcc && brew link gcc ##
## make sure numpy is installed as well! ##
## this is required for the pyeebls module installation ##
(venv)$ pip install numpy # in a virtualenv
# or use dnf/yum/apt install numpy to install systemwide
```
Once that's done, install astrobase.
```bash
(venv)$ pip install astrobase
```
### Other installation methods
Install all the optional dependencies as well:
```bash
(venv)$ pip install astrobase[all]
```
Install the latest version (may be unstable at times):
```bash
$ git clone https://github.com/waqasbhatti/astrobase
$ cd astrobase
$ python setup.py install
$ # or use pip install . to install requirements automatically
$ # or use pip install -e . to install in develop mode along with requirements
$ # or use pip install -e .[all] to install in develop mode along with all requirements
```
# License
`astrobase` is provided under the MIT License. See the LICENSE file for the full
text.
%package help
Summary: Development documents and examples for astrobase
Provides: python3-astrobase-doc
%description help
[](https://zenodo.org/badge/latestdoi/75150575) [](https://astrobase.readthedocs.io/en/latest/?badge=latest)
Astrobase is a Python package for analyzing light curves and finding variable
stars. It includes implementations of several period-finding algorithms, batch
work drivers for working on large collections of light curves, and a small
web-app useful for reviewing and classifying light curves by stellar variability
type.
Most functions in this package that deal with light curves usually require three
Numpy ndarrays as input: `times`, `mags`, and `errs`, so they should work with
any time-series data that can be represented in this form. If you have flux time
series measurements, most functions also take a `magsarefluxes` keyword argument
that makes them handle flux light curves correctly.
- Read the docs: https://astrobase.readthedocs.io/en/latest/
- Jupyter notebooks that demonstrate some of the functionality are available in
the [astrobase-notebooks](https://github.com/waqasbhatti/astrobase-notebooks)
repository.
- A [overview](#contents) of the modules and subpackages is provided below.
Install **[astrobase](https://pypi.org/project/astrobase/)** from the
Python Package Index (PyPI):
```bash
$ pip install numpy # needed to set up Fortran wrappers
$ pip install astrobase
```
See the [installation instructions](#installation) below for details. This
package requires Python >= 3.5 as of version 0.5.0. Use `pip install
astrobase<0.5.0` for older Python versions.
Python 3.6: [](https://ci.wbhatti.org/job/astrobase-py3)
Python 3.7: [](https://ci.wbhatti.org/job/astrobase-py37)
Python 3.8: [](https://ci.wbhatti.org/job/astrobase-py38)
Python 3.9: [](https://ci.wbhatti.org/job/astrobase-py39)
# Contents
- **[astrokep](https://astrobase.readthedocs.io/en/latest/astrobase.astrokep.html)**:
contains functions for dealing with Kepler and K2 Mission light curves from
STScI MAST (reading the FITS files, consolidating light curves for objects
over quarters), and some basic operations (converting fluxes to mags,
decorrelation of light curves, filtering light curves, and fitting object
centroids for eclipse analysis, etc.)
- **[astrotess](https://astrobase.readthedocs.io/en/latest/astrobase.astrotess.html)**:
contains functions for dealing with TESS 2-minute cadence light curves from
STScI MAST (reading the FITS files, consolidating light curves for objects
over sectors), and some basic operations (converting fluxes to mags, filtering
light curves, etc.)
- **[checkplot](https://astrobase.readthedocs.io/en/latest/astrobase.checkplot.html)**:
contains functions to make checkplots: a grid of plots used to quickly decide
if a period search for a possibly variable object was successful. Checkplots
come in two forms:
Python pickles: If you want to interactively browse through large numbers of
checkplots (e.g., as part of a large variable star classification project),
you can use the `checkplotserver` webapp that works on checkplot pickle
files. This interface allows you to review all phased light curves from all
period-finder methods applied, set and save variability tags, object type
tags, best periods and epochs, and comments for each object using a
browser-based UI (see below). The information entered can then be exported as
CSV or JSON for the next stage of a variable star classification pipeline.
The
[lightcurves-and-checkplots](https://nbviewer.jupyter.org/github/waqasbhatti/astrobase-notebooks/blob/master/lightcurves-and-checkplots.ipynb)
Jupyter notebook outlines how to do this. A more detailed example using light
curves of an arbitrary format is available in the
[lc-collection-work](https://nbviewer.jupyter.org/github/waqasbhatti/astrobase-notebooks/blob/master/lc-collection-work.ipynb)
notebook, which shows how to add in support for a custom LC format, add
neighbor, cross-match, and color-mag diagram info to checkplots, and visualize
these with the checkplotserver.

PNG images: Alternatively, if you want to simply glance through lots of
checkplots (e.g. for an initial look at a collection of light curves), there's
a `checkplot-viewer` webapp available that operates on checkplot PNG
images. The
[lightcurve-work](https://nbviewer.jupyter.org/github/waqasbhatti/astrobase-notebooks/blob/master/lightcurve-work.ipynb)
Jupyter notebook goes through an example of generating these checkplot PNGs
for light curves. See the
[checkplot-viewer.js](https://github.com/waqasbhatti/astrobase/blob/master/astrobase/cpserver/checkplot-viewer.js) file for more
instructions and [checkplot-viewer.png](https://raw.githubusercontent.com/waqasbhatti/astrobase/master/astrobase/data/checkplot-viewer.png)
for a screenshot.
- **[coordutils](https://astrobase.readthedocs.io/en/latest/astrobase.coordutils.html)**:
functions for dealing with coordinates (conversions, distances, proper motion)
- **[fakelcs](https://astrobase.readthedocs.io/en/latest/astrobase.fakelcs.html)**:
modules and functions to conduct an end-to-end variable star recovery
simulation.
- **[hatsurveys](https://astrobase.readthedocs.io/en/latest/astrobase.hatsurveys.html)**:
modules to read, filter, and normalize light curves from various HAT surveys.
- **[lcfit](https://astrobase.readthedocs.io/en/latest/astrobase.lcfit.html)**:
functions for fitting light curve models to observations, including
sinusoidal, trapezoidal and full Mandel-Agol planet transits, eclipses, and
splines.
- **[lcmath](https://astrobase.readthedocs.io/en/latest/astrobase.lcmath.html)**: functions for light curve operations such
as phasing, normalization, binning (in time and phase), sigma-clipping,
external parameter decorrelation (EPD), etc.
- **[lcmodels](https://astrobase.readthedocs.io/en/latest/astrobase.lcmodels.html)**:
first order models for fast fitting (for the purposes of variable
classification) to various periodic variable types, including sinusoidal
variables, eclipsing binaries, transiting planets, and flares.
- **[lcproc](https://astrobase.readthedocs.io/en/latest/astrobase.lcproc.html)**:
driver functions for running an end-to-end pipeline including: (i) object
selection from a collection of light curves by position, cross-matching to
external catalogs, or light curve objectinfo keys, (ii) running variability
feature calculation and detection, (iii) running period-finding, and (iv)
object review using the checkplotserver webapp for variability
classification.
- **[periodbase](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.html)**: parallelized functions (using
`multiprocessing.map`) to run fast period searches on light curves, including:
the generalized Lomb-Scargle algorithm from Zechmeister & Kurster
([2008](http://adsabs.harvard.edu/abs/2009A%26A...496..577Z);
**[periodbase.zgls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.zgls.html)**), the phase dispersion
minimization algorithm from Stellingwerf
([1978](http://adsabs.harvard.edu/abs/1978ApJ...224..953S),
[2011](http://adsabs.harvard.edu/abs/2011rrls.conf...47S);
**[periodbase.spdm](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.spdm.html)**), the AoV and
AoV-multiharmonic algorithms from Schwarzenberg-Czerny
([1989](http://adsabs.harvard.edu/abs/1989MNRAS.241..153S),
[1996](http://adsabs.harvard.edu/abs/1996ApJ...460L.107S);
**[periodbase.saov](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.saov.html)**,
**[periodbase.smav](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.smav.html)**), the BLS algorithm from
Kovacs et al. ([2002](http://adsabs.harvard.edu/abs/2002A%26A...391..369K);
**[periodbase.kbls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.kbls.html)**
and **[periodbase.abls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.abls.html)**),
the similar TLS algorithm from Hippke & Heller
([2019](https://ui.adsabs.harvard.edu/abs/2019A%26A...623A..39H/abstract);
**[periodbase.htls](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.htls.html)**),
and the ACF period-finding algorithm from McQuillan et al.
([2013a](http://adsabs.harvard.edu/abs/2013MNRAS.432.1203M),
[2014](http://adsabs.harvard.edu/abs/2014ApJS..211...24M);
**[periodbase.macf](https://astrobase.readthedocs.io/en/latest/astrobase.periodbase.macf.html)**).
- **[plotbase](https://astrobase.readthedocs.io/en/latest/astrobase.plotbase.html)**: functions to plot light curves, phased
light curves, periodograms, and download Digitized Sky Survey cutouts from the
NASA SkyView service.
- **[services](https://astrobase.readthedocs.io/en/latest/astrobase.services.html)**: modules and functions to query various
astronomical catalogs and data services, including GAIA, SIMBAD, TRILEGAL,
NASA SkyView, and 2MASS DUST.
- **[timeutils](https://astrobase.readthedocs.io/en/latest/astrobase.timeutils.html)**: functions for converting from
Julian dates to Baryocentric Julian dates, and precessing coordinates between
equinoxes and due to proper motion; this will automatically download and save
the JPL ephemerides **de430.bsp** from JPL upon first import.
- **[varbase](https://astrobase.readthedocs.io/en/latest/astrobase.varbase.html)**:
functions for calculating auto-correlation features, masking and pre-whitening
periodic signals in light curves, and planet transit specific tools.
- **[varclass](https://astrobase.readthedocs.io/en/latest/astrobase.varclass.html)**: functions for calculating various
variability, stellar color and motion, and neighbor proximity features, along
with a Random Forest based classifier.
# Changelog
Please see https://github.com/waqasbhatti/astrobase/blob/master/CHANGELOG.md for
a list of changes applicable to tagged release versions.
# Installation
## Requirements
This package requires the following other packages:
- numpy
- scipy
- astropy
- matplotlib
- Pillow
- jplephem
- requests
- tornado
- pyeebls
- tqdm
- scikit-learn
For optional functionality, some additional packages are required:
- for `astrobase.lcdb` to work, you'll need `psycopg2-binary`.
- for `lcfit.transits.mandelagol_fit_magseries`, you'll need `batman-package`,
`emcee`, `corner`, and `h5py`.
- for `lcproc.awsrun`, you'll need `paramiko`, `boto3`, and `awscli`.
- for `periodbase.tls`, you'll need `transitleastsquares`
## Installing with pip
If you're using:
- 64-bit Linux and Python 2.7, 3.4, 3.5, 3.6, 3.7
- 64-bit Mac OSX 10.12+ with Python 2.7 or 3.6
- 64-bit Windows with Python 2.7 and 3.6
You can simply install astrobase with:
```bash
(venv)$ pip install astrobase
```
Otherwise, you'll need to make sure that a Fortran compiler and numpy are
installed beforehand to compile the pyeebls package that astrobase depends on:
```bash
## you'll need a Fortran compiler. ##
## on Linux: dnf/yum/apt install gcc gfortran ##
## on OSX (using homebrew): brew install gcc && brew link gcc ##
## make sure numpy is installed as well! ##
## this is required for the pyeebls module installation ##
(venv)$ pip install numpy # in a virtualenv
# or use dnf/yum/apt install numpy to install systemwide
```
Once that's done, install astrobase.
```bash
(venv)$ pip install astrobase
```
### Other installation methods
Install all the optional dependencies as well:
```bash
(venv)$ pip install astrobase[all]
```
Install the latest version (may be unstable at times):
```bash
$ git clone https://github.com/waqasbhatti/astrobase
$ cd astrobase
$ python setup.py install
$ # or use pip install . to install requirements automatically
$ # or use pip install -e . to install in develop mode along with requirements
$ # or use pip install -e .[all] to install in develop mode along with all requirements
```
# License
`astrobase` is provided under the MIT License. See the LICENSE file for the full
text.
%prep
%autosetup -n astrobase-0.5.3
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-astrobase -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue May 30 2023 Python_Bot <Python_Bot@openeuler.org> - 0.5.3-1
- Package Spec generated
|