Rudimentary star extraction

pull/1/head
Cees Bassa 2018-03-17 23:34:26 +01:00
parent 740e88a2ad
commit e13e3cc51b
1 changed files with 25 additions and 0 deletions

25
extract_stars.py 100644
View File

@ -0,0 +1,25 @@
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess
import glob
# Get files
files=sorted(glob.glob("2*.fits"))
# Get sextractor location
env=os.getenv("ST_DATADIR")
# Loop over files
for file in files:
# Format command
command="sextractor %s -c %s/sextractor/default.sex"%(file,env)
# Run sextractor
output=subprocess.check_output(command,shell=True,stderr=subprocess.STDOUT)
# Rename file
if os.path.exists("test.cat"):
os.rename("test.cat",file+".cat")
else:
print("test.cat does not exist")