calculate_index#

astro_metadata_translator.indexing.calculate_index(headers, content_mode)#

Calculate an index data structure from the supplied headers.

Parameters:
  • headers (dict of [str, dict]) – The headers indexed by filename.

  • content_mode (str) – The mode associated with these headers. Not used other than to store the information in the data structure for later use on deserialization.

Returns:

index_ – The headers in form suitable for writing to an index.

Return type:

dict of [str, dict]