process_index_data#

astro_metadata_translator.indexing.process_index_data(content, *, force_metadata=False, force_dict=False)#

Process the content read from a JSON index file.

Parameters:
  • content (dict) – Data structure stored in JSON index file converted to simple python form.

  • force_metadata (bool, optional) – By default the content returned will match the original form that was used for the index. If this parameter is True an index of ObservationInfo will be returned as if it was simple dict content.

  • force_dict (bool, optional) – If True the structure returned will always be a dict keyed by filename.

Returns:

index – If the index file referred to ObservationInfo this will return an ObservationGroup, otherwise a dict will be returned with the keys being paths to files and the values being the keys and values stored in the index (with common information merged in). This can be overridden using the force_metadata parameter. If force_dict is True a dict will be returned with filename keys even if the index file refers to ObservationInfo (the values will be ObservationInfo unless force_metadata is True).

Return type:

ObservationGroup or dict of [str, dict]

Notes

File keys will be relative to the location of the index file.