- class AstroToolkit.Data.imagequery.ImageStruct[source]
This structure is returned from image queries, when read from a data file that was originally created by an image query, or through the Models module (in which case all attributes are set to None).
Attributes
- kindstr
“image”
- surveystr
survey to which the data belongs
- sourceint
Gaia source ID of target system (if given, else None)
- poslist<float>
Position of target system [right ascension, declination] in degrees
- identifierstr
Position of target system in JHHMMSS.SS±DDMMSS.SS format
- datanamestr
Default file for the
savedata()method- plotnamestr
Default file name for the
showplot()andsaveplot()methods- figureBokeh figure
Stores figures generated by the
plot()method- data: dict
Returned data in format:
"image_data": [raw image data] "image_header": astropy image header "size": image size (arcseconds) "image_time": time at which image was taken ([year,month]) "wcs": astropy wcs "image_focus": centre of image ([right ascension,declination], degrees) "overlay": [data entries to overlay when plotting images]
Methods
- exportplot(fname)
Exports the figure stored in the ‘figure’ attribute to a PNG, and saves it to local files. If the data structure doesn’t yet hold a figure, one will be generated with a default configuration first.
- Parameters:
fname (str, optional) – file name to same the figure to, defaults to file name given by the data structure’s ‘plotname’ attribute
- Returns:
file name to which the figure was saved
- Return type:
str
- plot(**kwargs)[source]
Plots data contained within a given data stucture and assigns the resulting figure to the data structure’s ‘figure’ attribute.
Additional Parameters:
- Parameters:
searchradius – search radius to use in SIMBAD when generating objcet IDs and search URLs in overlays. Defaults to value given in key ‘overlay_simbad_search_radius’ of config.
- savedata(fname)
Saves a data structure’s data to local files.
- Parameters:
fname (str, optional) – overrides file name, defaults to file name given by the data structure’s ‘dataname’ attribute
- Returns:
name of file to which data was saved
- Return type:
str
- saveplot(fname)
Saves the figure stored in the ‘figure’ attribute to local files without opening it in the web browser. If the data structure doesn’t yet hold a figure, one will be generated with a default configuration first.
- Parameters:
fname (str, optional) – file name to save the figure to, defaults to file name given by the data structure’s ‘plotname’ attribute
- Returns:
file name to which the figure was saved
- Return type:
str
- showdata(pprint, print_methods)
Prints data structure to stdout in a readable format.
- Parameters:
pprint (bool, optional) – collapse arrays and other objects to improve readability, defaults to True
- Returns:
Self
- showplot(fname)
Opens the figure stored in the ‘figure’ attribute in the default web browser, and saves it to local files. If the data structure doesn’t yet hold a figure, one will be generated with a default configuration first.
- Parameters:
fname (str, optional) – file name to save the figure to, defaults to file name given by the data structure’s ‘plotname’ attribute
- Returns:
file name to which the figure was saved
- Return type:
str