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

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

Open
nino-rasic opened this issue May 1, 2018 · 3 comments
Open

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

nino-rasic opened this issue May 1, 2018 · 3 comments

Comments

@nino-rasic
Copy link

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

@mraspaud
Copy link
Member

@nino-rasic Interesting feature you want to have :) My suggestion would be to embed the number of missing segments or scanlines in the metadata, so that the calling program can act on it.

As a side note, mipp isn't developed actively anymore, I would suggest you take a look at satpy as a replacement.

@nino-rasic
Copy link
Author

@mraspaud thank you for your response.

That would probably be a good solution. I can try to make a pull request with that.

Yeah, I figured that out...but currently we have this running on a production so it would take us some time to change it...but maybe we'll try soon (but probably I would have the same problem there ? :) )

@mraspaud
Copy link
Member

I understand ! It would be great with a PR then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants