Errormapο
- class Errormap[source]ο
Class representing an error map image for astronomical data processing.
Inherits from DummyImage and provides methods for creating, combining, and managing various types of error maps including background weight, background RMS, source weight, and source RMS maps.
- Parameters:
path (Union[str, Path]) β Path to the error map FITS image.
emaptype (str, optional) β Type of error map (βnoneβ, βbkgweightβ, βbkgrmsβ, βsourceweightβ,βsourcermsβ).
status (Status, optional) β Initial status object. If not provided, status is loaded from file or initialized.
load (bool, optional) β Whether to load status and header upon initialization.
Methodsο
- show(self, cmap='gray', scale='zscale', downsample=4, figsize=(8, 6), title=None, save_path=False, close_fig=False)ο
Visualize the FITS image using slicing-based downsampling and scaling.
- Parameters:
cmap (str, optional) β Matplotlib colormap. Default is βgrayβ.
scale (str, optional) β Scaling method. Default is βzscaleβ.
downsample (int, optional) β Step size for downsampling via slicing. Default is 4.
figsize (tuple, optional) β Matplotlib figure size. Default is (8, 6).
title (str, optional) β Plot title. Default is None.
save_path (str, optional) β Path to save the figure. Default is None.
close_fig (bool, optional) β If True, close the figure after saving. Default is False.
- run_ds9(self)ο
Open the image with SAOImage DS9.
- Parameters:
None
- Return type:
None
- to_rms(self)ο
Convert the Errormap to a Background RMS image.
- Parameters:
None
- Return type:
None
- to_weight(self)ο
Convert the Errormap to a Weight image.
- Parameters:
None
- Return type:
None
- load(self)ο
Load both image data and header from disk.
- Parameters:
None
- Return type:
None
- write(self, verbose=True)ο
Save Errormap to FITS file.
- Parameters:
None
- Return type:
None
- remove(self, remove_main=True, remove_connected_files=True, skip_patterns=['*.png', '*.cat'], verbose=True)ο
- Return type:
dict
- copy(self)ο
Return an in-memory deep copy of this Mask instance,
- Parameters:
None
- Return type:
None
- rename(self, new_name, verbose=True)ο
Rename the image file and update the internal path.
- Parameters:
new_name (str) β New name of the image file.
- Return type:
None
- clear(self, clear_data=True, clear_header=False, verbose=True)ο
Clear the image data and/or header from memory.
- Parameters:
clear_data (bool, optional) β If True, clear the image data. Default is True.
clear_header (bool, optional) β If True, clear the image header. Default is False.
Additional Methodsο
- update_header(self, **kwargs)ο
Update FITS header values using known key variants.
- Parameters:
kwargs (dict) β Keyword arguments to update the FITS header.
- Return type:
None
- load_status(self)ο
Load processing status from a JSON file.
- Parameters:
None
- Return type:
None
- save_status(self)ο
Save processing status to a JSON file.
- Parameters:
None
- Return type:
None
- add_status(self, event_name, **event_details)ο
Add a status event to the mask.
- Parameters:
event_name (str) β Name of the event to add.
event_details (dict) β Details of the event to add.
- save_info(self)ο
Save processing info to JSON file.
- Parameters:
None
- Return type:
None
Propertiesο
Key Properties
Property |
Description |
|---|---|
|
Return a list of available telescope keys. |
|
Center pixel (0-based) and its world coordinates (RA, Dec). |
|
Return all associated files that would be deleted in remove() if remove_connected_files=True, |
|
Image data array. |
|
Electron gain of the image. |
|
Exposure time of the image. |
|
Field of view along the first axis. |
|
Field of view along the second axis. |
|
FITS header object. |
|
Register necessary info fields |
|
Check if the image data is loaded. |
|
Check if the image file exists. |
|
Check if the image header is loaded. |
|
Check if the image has been saved |
|
Number of pixels along the first axis. |
|
Number of pixels along the second axis. |
|
Pixel scale of the image. |
|
Return the directory where this image and associated files will be saved. |
|
Dynamically builds save paths based on current header info |
|
|
|
WCS information of the image. |