-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fail Safe on Corrupted Packets, Generate Error Report #71
Comments
Hi @ddasilva, I've enclosed the test file and the code we were using for parsing the packets. |
Hi @nischayn99 and @tloubrieu-jpl, can you review a bit of background on this for the myself and the ticket? When I split this file, it has 47 different APIDs in it, but you're trying to parse every APID with the same definition. Do all these APIDs really have the same definition? A warning is issued that says the file is corrupt, which you mentioned was expected. I think what makes sense to do here is add a keyword argument As far as error reports, you can convert warnings to exceptions using the warnings module (see how here https://stackoverflow.com/a/30368735). It might help if we throw specific subclasses of In general though, the philosophy I think makes sense is to automatically recover with a warning when possible, and throw an exception if not. But we do want to make it easy to collect warnings in a centralize way, so that things are smooth operationally. Let me know any of your thoughts. |
Hi @ddasilva, We tried to apply generic definitions of default packets we found definition in ccsdspy (pkt = VariableLength( Thought it would work for all packets, and defined specific detailed packet definition for one of the APID as a first development step. Regarding the corrupted packet in the middle of the file, can we find a way to retrieve the next packet from a marker? We like the idea of CCSDSPy throwing exceptions and let the user decide if they want to catch the error or not. |
It's generating an exception because it is sometimes using the housekeeping packet definition for a byte stream that doesn't contain packets that match that. When I replace the code to always use the flexible definition, it doesn't raise an exception: for apid, stream in stream_by_apid.items():
pkt = default_pkt
output[apid] = pkt.load(stream)`
I don't think this is deterministically possible given the CCSDS specification. If you and @tloubrieu-jpl have a way of doing this, I would love to hear it.
That sounds good then-- we can make this ticket about that. What I'll do for this issue is two things:
|
Test Data + Code.zip
The text was updated successfully, but these errors were encountered: