Search and retrieve information from a MAST catalog.
Two ways to search for data within a catalog name :
-
You're looking for info on one target, then give the target's
ID or coordinates (ra and
dec ), and a search radius .
-
You're looking for information of a whole field, then give the
field's coordinates (
ra and dec ), and
radius .
If you have a list of targets, you need to loop this function.
If you supply a filename, the results will be saved to that path, and
you will get the filename back as received from urllib.URLopener (should
be the same as the input name, unless something went wrong).
If you don't supply a filename, you should leave filetype
to the default tsv , and the results will be saved to a
temporary file and deleted after the function is finished. The content of
the file will be read into a dictionary, as well as the units (two
separate dictionaries with the same keys, depending on the colum names in
the catalog). The entries in the dictionary are of type
ndarray , and will be converted to a float-array if possible.
If not, the array will consist of strings. The comments are also returned
as a list of strings.
- Parameters:
catalog (str) - name of a MAST mission catalog
filename (str) - name of the file to write the results to (no extension)
- Returns: str/ record array, dict, list of str
- filename / catalog data columns, units, comments
|