Merge pull request #47 from interplanetarychris/feature/tracking_mount

Feature/tracking mount
pull/49/head
Cees Bassa 2019-11-10 12:48:24 +01:00 committed by GitHub
commit e64d3e71e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 10 deletions

View File

@ -46,6 +46,7 @@ sdk = /path/to/libASICamera2.so # path to the SDK library
[Astrometry]
sex_config = /path/to/solve.sex
tracking_mount = False # Set to True for sidereal tracking mounts
no_sex = False # Set to True to use only astrometry.net
low_app = 18 # Arcsec per pixel low scale - Resolution of camera
high_app = 20 # Arcsec per pixel high scale - Resolution of camera

View File

@ -45,10 +45,12 @@ if __name__ == "__main__":
# Process commandline options and parse configuration
cfg = configparser.ConfigParser(inline_comment_prefixes=('#', ';'))
if args.conf_file:
cfg.read([args.conf_file])
else:
cfg.read('configuration.ini')
conf_file = args.conf_file if args.conf_file else "configuration.ini"
result = cfg.read([conf_file])
if not result:
print("Could not read config file: %s\nExiting..." % conf_file)
sys.exit()
# Set warnings
warnings.filterwarnings("ignore", category=UserWarning, append=True)
@ -67,6 +69,7 @@ if __name__ == "__main__":
houghrmin = cfg.getfloat('Processing', 'houghrmin')
nhoughmin = cfg.getint('Processing', 'nhoughmin')
nstarsmin = cfg.getint('Processing', 'nstarsmin')
tracking_mount = cfg.getboolean('Astrometry', 'tracking_mount')
# Move to processing directory
os.chdir(args.file_dir)
@ -123,7 +126,7 @@ if __name__ == "__main__":
pix_catalog = pixel_catalog(fname+".cat")
# Calibrate from reference
calibrate_from_reference(fname, "test.fits", pix_catalog)
calibrate_from_reference(fname, "test.fits", pix_catalog, tracking_mount)
# Store calibration
store_calibration(pix_catalog, fname + ".cal")

View File

@ -32,7 +32,7 @@ class tycho2_catalog:
# Estimate the WCS from a reference file
def estimate_wcs_from_reference(ref, fname):
def estimate_wcs_from_reference(ref, fname, tracking_mount):
# Read header of reference
hdu = fits.open(ref)
hdu[0].header["NAXIS"] = 2
@ -50,8 +50,11 @@ def estimate_wcs_from_reference(ref, fname):
t = Time(hdu[0].header["MJD-OBS"], format="mjd", scale="utc")
# Correct wcs
dra = (t.sidereal_time("mean", "greenwich")
- tref.sidereal_time("mean", "greenwich"))
if tracking_mount:
dra = 0.0*u.deg
else:
dra = (t.sidereal_time("mean", "greenwich")
- tref.sidereal_time("mean", "greenwich"))
p = FK5(ra=pref.ra+dra, dec=pref.dec, equinox=t).transform_to(ICRS)
w.wcs.crval = np.array([p.ra.degree, p.dec.degree])
@ -186,9 +189,9 @@ def add_wcs(fname, w, rmsx, rmsy):
return
def calibrate_from_reference(fname, ref, pix_catalog):
def calibrate_from_reference(fname, ref, pix_catalog, tracking_mount):
# Estimated WCS
w = estimate_wcs_from_reference(ref, fname)
w = estimate_wcs_from_reference(ref, fname, tracking_mount)
# Default rms values
rmsx = 0.0