Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-29266: Add translator methods to read all relevant HDUs #52

Merged
merged 15 commits into from
Mar 23, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions python/astro_metadata_translator/file_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import sys
import traceback

from astro_metadata_translator import merge_headers, ObservationInfo
from .headers import merge_headers
from .observationInfo import ObservationInfo
from .tests import read_test_file


Expand Down Expand Up @@ -111,7 +112,7 @@ def find_files(files, regex):
return found_files


def read_basic_metadata_from_file(file, hdrnum, errstream=sys.stderr, can_raise=False):
def read_basic_metadata_from_file(file, hdrnum, errstream=sys.stderr, can_raise=True):
timj marked this conversation as resolved.
Show resolved Hide resolved
"""Read a raw header from a file, merging if necessary

Parameters
Expand All @@ -126,7 +127,7 @@ def read_basic_metadata_from_file(file, hdrnum, errstream=sys.stderr, can_raise=
Stream to send messages that would normally be sent to standard
error. Defaults to `sys.stderr`. Only used if exceptions are disabled.
can_raise : `bool`, optional
Indicate whether the function can raise and exception (default)
Indicate whether the function can raise an exception (default)
or should return `None` on error. Can still raise if an unexpected
error is encountered.

Expand Down