Tools (mpdaf.tools)

Contents:

Reference/API

mpdaf.tools Package

Functions

add_mpdaf_keywords_to_file(path, method, ...)

Add keywords in a FITS file header to describe the method and the corresponding parameters.

add_mpdaf_method_keywords(header, method, ...)

Add keywords in a FITS header to describe the method and the corresponding parameters.

all_subclasses(cls)

Return a set of subclasses of a given cls.

broadcast_to_cube(arr, shape)

Broadcast an array (image or spectrum to a cube.

chdir(dirname)

Context manager to change the current working directory.

copy_header(srchdr[, dsthdr, exclude, unit])

Copy all keywords from a FITS header to another.

copy_keywords(srchdr, dsthdr, keys)

Copy a list of FITS keywords from one header to another.

deprecated(instructions)

Flags a method as deprecated.

fix_unit_read(x)

fix_unit_write(x)

is_valid_fits_file(filename)

Return True is a file exist and is a valid FITS file (based on its extension).

isiter(val)

Return True is val is iterable.

isnotebook()

Detect if running inside a jupyter notebook.

progressbar(*args, **kwargs)

Wrapper for tqdm progress bar, with notebook detection.

read_slice_from_fits(filename_or_hdu[, ...])

Read data from a FITS file.

timeit(f)

Decorator which prints the execution time of a function.

timer()

Context manager which prints the execution time.

Classes

LowercaseOrderedDict(*args)

Ordered dictionary where all strings keys are case insensitive.

MpdafUnitsWarning

MpdafWarning

Class Inheritance Diagram

digraph inheritance80977ea0d8 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "AstropyWarning" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="The base warning class from which all Astropy warnings should inherit."]; "Collection" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Sized" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Iterable" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Container" -> "Collection" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Container" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Iterable" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "LowercaseOrderedDict" [URL="../api/mpdaf.tools.LowercaseOrderedDict.html#mpdaf.tools.LowercaseOrderedDict",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Ordered dictionary where all strings keys are case insensitive."]; "MutableMapping" -> "LowercaseOrderedDict" [arrowsize=0.5,style="setlinewidth(0.5)"]; "OrderedDict" -> "LowercaseOrderedDict" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Mapping" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Collection" -> "Mapping" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MpdafUnitsWarning" [URL="../api/mpdaf.tools.MpdafUnitsWarning.html#mpdaf.tools.MpdafUnitsWarning",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "UnitsWarning" -> "MpdafUnitsWarning" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MpdafWarning" [URL="../api/mpdaf.tools.MpdafWarning.html#mpdaf.tools.MpdafWarning",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "MutableMapping" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Mapping" -> "MutableMapping" [arrowsize=0.5,style="setlinewidth(0.5)"]; "OrderedDict" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Dictionary that remembers insertion order"]; "Sized" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "UnitsWarning" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="The base class for unit-specific warnings."]; "AstropyWarning" -> "UnitsWarning" [arrowsize=0.5,style="setlinewidth(0.5)"]; }