+
Skip to content

Missing image segment - throw an error (optional) #14

Open
@nino-rasic

Description

@nino-rasic

Currently mipp loader is logging if one of the image segments is missing and throwing an error if there are no segments at all.

That kinda makes sense because we can create the image with missing segments but in my case, I would like to know if the image is created with all segments or not.

I'm not that familiar with this library so I don't know if there is an easy way to do it, but one of these two places would be probably nice to implement this change ( if this change makes sense at all? )

here we could throw an error (but that would break the functionality to create the image with missing segments , maybe optional error ? )

mipp/mipp/xrit/loader.py

Lines 387 to 395 in 856e347

seg_file = segments.get(seg_no, None)
if not seg_file:
#
# No data for this segment.
#
logger.warning("Segment number %d not found" % seg_no)
# all image lines are already set to no-data count.
line_in_segment = init_line_in_segment

here we also have everything we need to check if we have all segments or not:

  • len(image_files)
  • im.segment.planned_start_seg_no
  • im.segment.planned_end_seg_no

mipp/mipp/xrit/MSG.py

Lines 857 to 860 in f8589df

try:
im = _xrit.read_imagedata(image_files[0])
except IndexError:
raise ReaderError("No image segments available")

Does this makes sense ?

Thank you for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载