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

DEV: _get_images can take header or list of headers as input #61

Merged
merged 3 commits into from
Apr 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion csxtools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ def get_images_to_3D(images, dtype=None):

def _get_images(header, tag, roi=None):
t = ttime.time()
images = header.db.get_images(header, tag)
if isinstance(header, (list, tuple)):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this to use header.data instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for suggestion on new api. updated

images = [img for h in header for img in h.data(tag)]
else:
images = header.data(tag)
t = ttime.time() - t
logger.info("Took %.3f seconds to read data using get_images", t)

Expand Down