Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calibration: Add error handling to plate_solve method #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions stvid/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
import os

import subprocess
import sys

import numpy as np

from termcolor import colored

import astropy.units as u
from astropy import wcs
from astropy.time import Time
from astropy.io import fits
from astropy.coordinates import SkyCoord, ICRS, FK5


class AstrometricCatalog:
"""AstrometricCatalog class"""

Expand Down Expand Up @@ -124,6 +128,12 @@ def plate_solve(fname, cfg, store_as_fname=None):
hdu.close()
except OSError:
w, t = None, None
except subprocess.CalledProcessError as err:
print(colored("ERROR: ", "red", attrs=["bold"]) + "solve-field failed.")
print("Command: " + colored(command, "cyan"))
print("Output:")
print(colored(err.output.decode('ascii'), "cyan"))
sys.exit(-1)

# Solved
if w is not None:
Expand Down