-
Notifications
You must be signed in to change notification settings - Fork 3
/
podi_find_guide_otas.py
executable file
·41 lines (31 loc) · 1.17 KB
/
podi_find_guide_otas.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
#!/usr/bin/env python3
import os
import sys
import numpy
from podi_definitions import is_guide_ota, is_image_extension
import astropy.io.fits as pyfits
from podi_commandline import *
if __name__ == "__main__":
debug = cmdline_arg_isset("-debug")
print(get_clean_cmdline())
for fn in get_clean_cmdline()[1:]:
guide_otas = []
print(fn)
hdulist = pyfits.open(fn)
for ext in hdulist:
if (not is_image_extension(ext)):
continue
# if (ext.name != 'OTA41.SCI'):
# continue
# is_guide, excesses, _mean, _median, skynoise, corners, centers = is_guide_ota(hdulist[0], ext, debug=True)
# pyfits.HDUList(centers).writeto("guideota_centers.fits", overwrite=True)
# pyfits.HDUList(corners).writeto("guideota_corners.fits", overwrite=True)
#
# print(excesses)
# print(skynoise)
# print(_mean, _median)
is_guide = is_guide_ota(hdulist[0], ext)
# print(ext.name, is_guide)
if (is_guide):
guide_otas.append(ext.name)
print("%s ==> %s" % (fn, ",".join(guide_otas)))