-
Notifications
You must be signed in to change notification settings - Fork 4
/
doastphot.py
47 lines (40 loc) · 1.23 KB
/
doastphot.py
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
from astrolib import astronomy
from astrolib import photometry
from astrolib import visuals
import glob
import sys
import os
print("""
DATE/
| \
BDF/ SCI_IMAGES
Örnek: python3 doastphot.py DATE/SCI_IMAGES/ R --skip-calib
""")
fitsdir = sys.argv[1]
filter = sys.argv[2]
# Ön indirgeme
if filter != "--plot-lc":
target = os.path.basename(fitsdir).split('.')[0]
if not "--skip-calib" in sys.argv:
print("Ön indirgeme başladı!")
ro = astronomy.RedOps()
ro.ccdproc(fitsdir, filter=filter)
# astrometry
# Solve field with astrometry.net
# Please provide image path, so ./ is important!
if not "--skip-astrometry" in sys.argv:
ac = astronomy.AstCalc()
print("Astrometry başladı!")
fitsfiles = glob.glob("./atmp/bf_*.fit?")
for fitsfile in fitsfiles:
ac.solve_field(fitsfile)
# photometry
if not "--skip-photometry" in sys.argv:
ap = photometry.PhotOps()
ap.asteroids_phot("./atmp/bf_*new.fits", multi_object=True, radius=11)
# For plotting ligt curve of results.
# plot-lc
elif filter == "--plot-lc":
# fitsdir burada dosya sonuç soyasını tutan değişken!
plc = visuals.StarPlot()
plc.lc_plot(fitsdir)