fluxcompensator.utils.tools

fluxcompensator.utils.tools.properties(wav, val)

Tool to determine the properties of wav and val passed in the FluxCompensator.

Parameters:

wav : numpy.ndarray

The wavelengths of val array in microns.

val : numpy.ndarray

The val array of the FluxCompensator object.

Returns:

properties : dict

Dictionary with relevant properties of the FluxCompensator object.

properties{spacing_wav, pixel, shape}

  • spacing_wav : float width between wav entries.
  • pixel : tuple of (x, y) entries.
  • shape : shape of cube, image, sed or flux.
fluxcompensator.utils.tools.grid_units(x)

Tool to determine the astronomical units of x. (e. g. grid units of the axis in the FOV).

Parameters:

x : float

Length in cm.

Returns:

gird_units : dict

Dictionary with information of x.

grid_units{grid_unit, grid_unit_name}

  • grid_unit : Estimated unit of x in cm.

  • grid_unit_name : Name of new unit.

    Defined possibilities are:
    • 'au'
    • 'pc'
    • 'kpc'
fluxcompensator.utils.tools.get_slices(wav, val, wav_1, wav_2)

Tool to extract slices of the val cube in SyntheticCube.

Parameters:

wav : numpy.ndarray

The wavelengths of val array in microns.

val : numpy.ndarray

The val array of the FluxCompensator object.

wav_1 : float

Wavelength boundary in microns.

wav_2 : float

Wavelength boundary in microns.

Returns:

slices : dict

Dictionary relevant for the FluxCompensator object.

slices{wav_short, val_short, filter_index}

  • wav_short : Vector like wav but all entries outside
    the filter boundaries are erased.
  • val_short : Shape like wav_short for val.
  • filter_index : Indices of original wav within the filter.
fluxcompensator.utils.tools.average_collapse(val)

Tool to collapse slices of cube or vector averaged into one direction.

Parameters:

val : numpy.ndarray

The val array of FluxCompensator object in 3D or 1D.

Returns:

val : numpy.ndarray

The 2D val array used in SyntheticImage.

val : numpy.ndarray

The 0D val array used in SyntheticFlux.

fluxcompensator.utils.tools.central_wav(wav)

Tool to estimate the central wavelength of an averaged collapsed val.

Parameters:

wav : numpy.ndarray

The wavelength vector of val array in microns.

Returns:

central_wav : float

Central wavelength in microns.

fluxcompensator.utils.tools.where_is_1D(n, o)

Localizes fragment of pixel when grid resolution is changed. See also ConservingZoom. Computes the fraction of the old pixel fragment in the new resolution pixel.

Parameters:

n : tuple

Boundaries of pixels new in arcsec.

n = (x0, x1, y0, y1)

o : tuple

Boundaries of old pixels in arcsec.

o = (x0, x1, y0, y1)

Returns:

frac : float

Fragment of old pixel in new resolution pixel.