AstrometryNetClass¶
- class astroquery.astrometry_net.AstrometryNetClass[source]¶
Bases:
astroquery.query.BaseQuery
Perform queries to the astrometry.net service to fit WCS to images or source lists.
Show a warning message if the API key is not in the configuration file.
Attributes Summary
Return the Astrometry.net API key.
Construct a dict of settings using the defaults
Methods Summary
login
()monitor_submission
(submission_id[, ...])Monitor the submission for completion.
There are a ton of options available for solving.
solve_from_image
(image_file_path[, ...])Plate solve from an image, either by uploading the image to astrometry.net or by finding sources locally using photutils and solving with source locations.
solve_from_source_list
(x, y, image_width, ...)Plate solve from a list of source positions.
Attributes Documentation
- API_URL = 'http://nova.astrometry.net/api'¶
- TIMEOUT = 120¶
- URL = 'http://nova.astrometry.net'¶
- api_key¶
Return the Astrometry.net API key.
- empty_settings¶
Construct a dict of settings using the defaults
Methods Documentation
- login()¶
- monitor_submission(submission_id, solve_timeout=120)[source]¶
Monitor the submission for completion.
- Parameters
- submission_id
int
orstr
Submission ID number from astrometry.net.
- solve_timeout
int
Time, in seconds, to wait for the astrometry.net solver to find a solution.
- submission_id
- Returns
- None or
astropy.io.fits.Header
The contents of the returned object depend on whether the solve succeeds or fails. If the solve succeeds the header with the WCS solution generated by astrometry.net is returned. If the solve fails then an empty dictionary is returned. See below for the outcome if the solve times out.
- None or
- Raises
TimeoutError
Raised if
astroquery.astrometry_net.AstrometryNetClass.TIMEOUT
is exceeded before the solve either succeeds or fails. The second argument in the exception is the submission ID.
- show_allowed_settings()[source]¶
There are a ton of options available for solving. This displays them in a nice way.
- solve_from_image(image_file_path, force_image_upload=False, ra_key=None, dec_key=None, ra_dec_units=None, fwhm=3, detect_threshold=5, solve_timeout=120, **settings)[source]¶
Plate solve from an image, either by uploading the image to astrometry.net or by finding sources locally using photutils and solving with source locations.
- Parameters
- image_file_pathstr or Path object
Path to the image.
- force_image_uploadbool, optional
If
True
, upload the image to astrometry.net even if it is possible to detect sources in the image locally. This option will almost always take longer than finding sources locally. It will even take longer than installing photutils and then rerunning this.Even if this is
False
the image will be upload unless photutils is installed.- ra_keystr, optional
Name of the key in the FITS header that contains right ascension of the image. The ra can be specified using the
center_ra
setting instead if desired.- dec_keystr, optional
Name of the key in the FITS header that contains declination of the image. The dec can be specified using the
center_dec
setting instead if desired.- ra_dec_unitstuple, optional
Tuple specifying the units of the right ascension and declination in the header. The default value is
('hour', 'degree')
.- solve_timeoutint
Time, in seconds, to wait for the astrometry.net solver to find a solution.
- For a list of the remaining settings, use the method
- `~AstrometryNetClass.show_allowed_settings`.
- solve_from_source_list(x, y, image_width, image_height, solve_timeout=120, **settings)[source]¶
Plate solve from a list of source positions.
- Parameters
- xlist-like
List of x-coordinate of source positions.
- ylist-like
List of y-coordinate of source positions.
- image_widthint
Size of the image in the x-direction.
- image_heightint
Size of the image in the y-direction.
- solve_timeoutint
Time, in seconds, to wait for the astrometry.net solver to find a solution.
- For a list of the remaining settings, use the method
- `~AstrometryNetClass.show_allowed_settings`.