Organization#

vampires_dpp.organization.check_file(filename)#

Checks if file can be loaded and if there are empty slices

Parameters:

filename (PathLike)

Returns:

Returns True if file can be loaded and no empty frames

Return type:

bool

vampires_dpp.organization.dict_from_header(header, excluded=('COMMENT', 'HISTORY'), fix=True)#

Parse a FITS header and extract the keys and values as an ordered dictionary. Multi-line keys like COMMENTS and HISTORY will be combined with commas. The resolved path will be inserted with the path key.

Parameters:

header (Header) – FITS header to parse

Return type:

OrderedDict

vampires_dpp.organization.dict_from_header_file(filename, ext=0, **kwargs)#

Parse a FITS header from a file and extract the keys and values as an ordered dictionary. Multi-line keys like COMMENTS and HISTORY will be combined with commas. The resolved path will be inserted with the path key.

Parameters:
  • filename (str) – FITS file to parse

  • **kwargs – All keyword arguments will be passed to load_fits_header

Return type:

OrderedDict

vampires_dpp.organization.header_table(filenames, num_proc=None, quiet=False, **kwargs)#

Generate a pandas dataframe from the FITS headers parsed from the given files.

Parameters:
  • filenames (list[pathlike])

  • num_proc (int, optional) – Number of processes to use in multiprocessing, by default mp.cpu_count()

  • quiet (bool, optional) – Silence the progress bar, by default False

Return type:

pandas.DataFrame

vampires_dpp.headers.get_instrument_from(header)#

Get the instrument info from a FITS header

Return type:

InstrumentInfo

Parameters:

header (Header)

vampires_dpp.headers.parallactic_angle_altaz(alt, az, lat=np.float64(19.825504000000002))#

Calculate parallactic angle using the altitude/elevation and azimuth directly

Parameters:
  • alt (float) – altitude or elevation, in degrees

  • az (float) – azimuth, in degrees CCW from North

  • lat (float, optional) – latitude of observation in degrees, by default 19.823806

Returns:

parallactic angle, in degrees East of North

Return type:

float

vampires_dpp.headers.parallactic_angle_hadec(ha, dec, lat=np.float64(19.825504000000002))#

Calculate parallactic angle using the hour-angle and declination directly

\[\theta_\mathrm{PA} = \arctan2{\frac{\sin\theta_\mathrm{HA}}{\tan\theta_\mathrm{lat}\cos\delta - \sin\delta \cos\theta_\mathrm{HA}}}\]
Parameters:
  • ha (float) – hour-angle, in hour angles

  • dec (float) – declination in degrees

  • lat (float, optional) – latitude of observation in degrees, by default 19.823806

Returns:

parallactic angle, in degrees East of North

Return type:

float

vampires_dpp.headers.sort_header(header)#

Sort all non-structural FITS header keys

Return type:

Header

Parameters:

header (Header)

vampires_dpp.headers.update_header_iso(header)#

Return the middle point of the exposure for ISO-based timestamps

Parameters:

header (FITSHeader)

Return type:

Header

vampires_dpp.headers.update_header_mjd(header)#

Return the middle point of the exposure for MJD timestamps

Parameters:

header (FITSHeader)

Returns:

The MJD timestamp for the middle point of the exposure

Return type:

str