Some example scripts which utulize the
Client class, can be found
- class astrometry_net_client.client.Client(session=None, settings=None, **kwargs)¶
Higher level class which makes the interaction with the API easy.
astrometry_net_client.session.Session) – Optional argument to provide the session for the API. If not provided, you must either specify the keyword
location, or have the key present in your environment. See
astrometry_net_client.settings.Settings, dict) – An optional settings object, which will be applied to all uploads. If not specified, the settings object will be created from given keyword arguments which correspond to valid settings. For this see
kwargs (arguments) – Used to create a session or settings object, if either is not specified. Will extract the relevant arguments relevant to the object which is created before passing them to the object constructor. See
- calibrate_file_wcs(filename, settings=None)¶
Uploads a file, returning the wcs header if it succeeds.
Returns the Header if successful, None otherwise.
- Return type:
- upload_file(filename, settings=None)¶
Uploads file and returns completed job when finished solving.
Job – The job of the resulting upload. NOTE: It is possible that the job did not succeed, therefore check with
astrometry_net_client.statusables.Statusable.success()if it did.
- Return type:
- upload_files_gen(files_iter, queue_size=10)¶
Generator which uploads a number of files concurrently, yielding the
astrometry_net_client.statusables.Job& filename when done.
Note that the
files_iterargument is fully consumed when submitting to the executor is done. This means that the results will only be yielded once the iterator is consumed.
files_iter (iterable) – Some iterable containing paths to the files which will be uploaded. Is fully consumed before any result is yielded.
queue_size (int, optional) – A positive integer, controlling the size of the queue. This will determine the maximum number of simultaneous submissions. Must be greater than 0 and lower than
MAX_WORKERS. Default is
str) – A tuple containing the finished
astrometry_net_client.statusables.Joband the corresponding filename. Yields when the Job is finished. NOTE: Order of yielded filenames can (and likely will) be different from the given
ValueError – When the queue_size is invalid.