You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a resource problem when decoding an .ast file. Since the file contain 4h of ADS-B data when I use parse the computer run out of ram memory:
file="file directory.ast"
data = file.read()
parsed = asterix.parse(data) # No memory
The .ast file has about 52 MB.
If I read let's say, data[0:500] it works fine and decodes the first messages. So I had an idea and is to use parse on pieces of data: piece=data[k:k+500]
The problem I get when doing this is that parse does give incorrect decoding since (I suspect) I can not break data into equally sized pieces, because then I break the first and/or the last message in two pieces, and parse does not interpret correctly when a message starts and finish, giving 0's CRC check.
Questions:
How can I know when a message ends, before using parse (using just data)?
Also, I have another possibility. I have the data in a .txt file where each row is an asterix message. How can I decode one-by-one the messages. For example,
Use the following algorithm to read packet by packet from file:
Read 1 byte from the file (this is an ASTERIX category)
Read next 2 bytes from the file and create unsigned short number from it (take care of byte ordering). This number represents the size (N) of the packet (including first 3 bytes).
Read following N-3 bytes from the file and send those data (including first 3 bytes) to the parser
Repeat from step 1. until the end of file
If you want to send string data directly to parser you need to convert it to byte array like in this example:
`asterix_packet = bytearray(
[0x30, 0x00, 0x30, 0xfd, 0xf7, 0x02, 0x19, 0xc9, 0x35, 0x6d, 0x4d, 0xa0, 0xc5, 0xaf, 0xf1, 0xe0,
0x02, 0x00, 0x05, 0x28, 0x3c, 0x66, 0x0c, 0x10, 0xc2, 0x36, 0xd4, 0x18, 0x20, 0x01, 0xc0, 0x78,
0x00, 0x31, 0xbc, 0x00, 0x00, 0x40, 0x0d, 0xeb, 0x07, 0xb9, 0x58, 0x2e, 0x41, 0x00, 0x20, 0xf5])
Hello everyone,
I have a resource problem when decoding an .ast file. Since the file contain 4h of ADS-B data when I use
parse
the computer run out of ram memory:The .ast file has about 52 MB.
If I read let's say,
data[0:500]
it works fine and decodes the first messages. So I had an idea and is to use parse on pieces of data:piece=data[k:k+500]
The problem I get when doing this is that parse does give incorrect decoding since (I suspect) I can not break data into equally sized pieces, because then I break the first and/or the last message in two pieces, and parse does not interpret correctly when a message starts and finish, giving 0's CRC check.
Questions:
The text was updated successfully, but these errors were encountered: