pypeit.core.framematch module

Routines for matching frames to certain types or each other.

class pypeit.core.framematch.FrameTypeBitMask[source]

Bases: BitMask

Define a bitmask to set the frame types.

Frame types can be arc, bias, dark, pinhole, pixelflat, science, standard, or trace.

type_names(type_bits, join=True)[source]

Use the type bits to get the type names for each frame.

Todo

Parameters:
  • type_bits (int, list, numpy.ndarray) – The bit mask for each frame.

  • bitmask (pypeit.bitmask.BitMask, optional) – The bit mask used to pull out the bit names. Uses FrameTypeBitMask by default.

  • join (bool, optional) – Instead of providing a list of type names for items with multiple bits tripped, joint the list into a single, comma-separated string.

Returns:

List of the frame types for each frame. Each frame can have multiple types, meaning the 2nd axis is not necessarily the same length for all frames.

Return type:

list

pypeit.core.framematch.check_frame_exptime(exptime, exprng)[source]

Check that the exposure time is within the provided range.

Parameters:
  • exptime (numpy.ndarray) – Exposure times to check; allowed to be None.

  • exprng (array-like) – An array with the minimum and maximum exposure. The limits are exclusive and a limit of None means there is no limit.

Returns:

A boolean array that is True for all times within the provided range. The value is False for any exposure time that is None or outside the provided range.

Return type:

numpy.ndarray

Raises:

ValueError – Raised if the length of exprng is not 2.

pypeit.core.framematch.valid_frametype(frametype, quiet=False, raise_error=False)[source]

Confirm the provided frame type is known to PypeIt.

Parameters:
  • frametype (str) – The frame type name.

  • quiet (bool, optional) – Suppress output

  • raise_error (bool, optional) – Instead of issuing a warning, raise an exception.

Returns:

Flag that the frametype name is valid.

Return type:

bool