Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an SBET (Smoothed Best Estimate of Trajectory) file that I would like to read in python. I found these links that discuss options for reading/writing SBET files, but I was wondering if our community could offer some advice for handling SBET files in python?

share|improve this question
up vote 3 down vote accepted

I think your research is consistent with what I saw the one type I needed to read this format in Python. It's relatively simple to parse as a binary file and there are code examples of how to do so, but it's not part of any commonly used library you'll be able to grab with setup tools.

I think stuff like this:

is perhaps a little convoluted in implementation. You might run into J2000GPS time conversion issues which there are good resources online for.

I think opening the file with: with open(filename) as file:

would make the implementation a little more Pythonic. Also, reading the entire file with struct.unpack into a list then writing a filter function to remove bad entries using the builtin filter function:

Would be a good idea to clean up the convoluted if/then/try/except block structure, too. I've mostly worked with proprietary formats that have similar issues, though, rather than this format directly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.