pytroll / mipp

This is a Meteorological Ingest-Processing Package (MIPP)
https://mipp.readthedocs.org/
GNU Lesser General Public License v3.0
20 stars 17 forks source link

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

Open nino-rasic opened 6 years ago

nino-rasic commented 6 years ago

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 ? ) https://github.com/pytroll/mipp/blob/856e347e8e92dc019a6f269b266f8fc461ec2138/mipp/xrit/loader.py#L387-L395

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

https://github.com/pytroll/mipp/blob/f8589dfbb3d403ff89ddab563f492ecec75440f1/mipp/xrit/MSG.py#L857-L860

Does this makes sense ?

Thank you for your help

mraspaud commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

I understand ! It would be great with a PR then :+1: