read_file_info#
- astro_metadata_translator.file_helpers.read_file_info(file, hdrnum, print_trace=None, content_mode='translated', content_type='simple', outstream=None)#
Read information from file.
- Parameters:
file (
str) – The file from which the header is to be read.hdrnum (
int) – The HDU number to read. The primary header is always read and merged with the header from this HDU.print_trace (
boolorNone) – If there is an error reading the file and this parameter isTrue, a full traceback of the exception will be reported. IfFalseprints a one line summary of the error condition. IfNonethe exception will be allowed to propagate.content_mode (
str) – Content returned. This can be:metadatato return the unfixed metadata headers;translatedto return the output from metadata translation.content_type (
str, optional) – Form of content to be returned. Can be eitherjsonto return a JSON string,simpleto always return adict, ornativeto return either adict(formetadata) orObservationInfofortranslated.outstream (
io.StringIOorNone, optional) – Output stream to use for standard messages. Defaults toNonewhich uses the default output stream.
- Returns:
simple – The return value of
to_simple. ReturnsNoneif there was a problem andprint_traceis notNone.- Return type:
dictofstrorObservationInfo