MadcubaMap#
- class madcubapy.io.MadcubaMap(data=None, header=None, wcs=None, unit=None, restfreq=None, sigma=None, integrated_range=None, hist=None, ccddata=None, filename=None, _update_hist_on_init=True, _bypass_ccddata_conflict_check=False)[source]#
Bases:
MadcubaFitsA container for MADCUBA FITS maps, using the
MadcubaFitsinterface.This class is basically a wrapper to read MADCUBA exported FITS maps and their history files with astropy.
- Parameters:
- data
ndarray The data array contained in the FITS file.
- header
Header The header object associated with the FITS file.
- wcs
WCS Object with the world coordinate system for the data.
- unit
Unit The unit of the data.
- restfreq
Quantity Rest frequency of the FITS file.
- sigma
Quantity The noise of the data.
- integrated_range
Quantity The range selected for integrating the map.
- hist
Table Table containing the history information of the FITS file, which is stored in a separate _hist.csv file.
- ccddata
CCDData An astropy CCDData object loaded with astropy as a failsafe.
- filename
str Name of the FITS file.
- data
Methods
add_hist(*args)
Load the history table from a csv file.
Attributes Summary
CCDData: An astropy CCDData object loaded with astropy as a failsafe.ndarray: The data array contained in the FITS file.str: Name of the FITS file.Header: The header object associated with the FITS.Table: Table containing the history information.Quantityorndarray: The range selected for integrating the map.Quantity: The rest frequency of the FITS file.Quantity: The noise of the data.Unit: The unit of the data.WCS: Object with the world coordinate system for the data.Methods Summary
add_hist(filename)Load the history table from a csv file.
convert_unit_to(unit)Convert the units of the map to other units.
copy()Create a copy of the
MadcubaMap.Tries to fix problems when the units are incorrectly parsed.
get_input(**kwargs)Return mouse click coordinates from this map.
read(filepath, **kwargs)Classmethodto generate aMadcubaMapobject from a FITS file.show(**kwargs)Show the map in a pop-up window.
update_header_keyword(key, value[, comment])Update a single header keyword.
update_sigma([statistic])Measure the noise (sigma) of the map by calculating the standard deviation (std) or root mean square (rms) inside several polygons selected by mouse clicks, and store it in the SIGMA header card.
write(filepath, **kwargs)Write a
MadcubaMapinto a FITS file alongside its history file.Attributes Documentation
Methods Documentation
- add_hist(filename)#
Load the history table from a csv file.
- copy()[source]#
Create a copy of the
MadcubaMap.
- fix_units()[source]#
Tries to fix problems when the units are incorrectly parsed. The user should confirm that the new units are correct.
- get_input(**kwargs)[source]#
Return mouse click coordinates from this map.
- Other Parameters:
- **kwargs
Additional parameters passed to
add_wcs_axes().
- classmethod read(filepath, **kwargs)[source]#
Classmethodto generate aMadcubaMapobject from a FITS file. This method creates anCCDDatafrom the FITS file.- Parameters:
- filepath
str Name of FITS file.
- filepath
- Other Parameters:
- **kwargs
Additional keyword parameters passed through to the Astropy
fits_ccddata_reader()function.
- show(**kwargs)[source]#
Show the map in a pop-up window.
- Other Parameters:
- **kwargs
Additional parameters passed to
add_wcs_axes().
- update_header_keyword(key, value, comment=None)[source]#
Update a single header keyword. This method correctly adds the header key to both the
MadcubaMapobject and theccddataattribute.
- update_sigma(statistic='std', **kwargs)[source]#
Measure the noise (sigma) of the map by calculating the standard deviation (std) or root mean square (rms) inside several polygons selected by mouse clicks, and store it in the SIGMA header card.
Left clicks create polygon vertices.
Right click closes the current polygon, and a subsequent left click starts a new polygon.
- Parameters:
- statistic{‘std’, ‘rms’}, optional
Statistic to be used as sigma. Defaults to ‘std’ and can be changed at runtime via GUI buttons.
- Other Parameters:
- **kwargs
Additional parameters passed to
add_wcs_axes().
- write(filepath, **kwargs)[source]#
Write a
MadcubaMapinto a FITS file alongside its history file.- Parameters:
- filepath
str Name of output FITS file.
- filepath
- Other Parameters:
- **kwargs
Additional keyword parameters passed through to the Astropy
fits_ccddata_writer()function.