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

Convert .ast to any plain text format #192

Open
marius190 opened this issue Jan 31, 2022 · 5 comments
Open

Convert .ast to any plain text format #192

marius190 opened this issue Jan 31, 2022 · 5 comments

Comments

@marius190
Copy link

marius190 commented Jan 31, 2022

Hello Damir Salantić,

I am doing a thesis and I need to work with ASTERIX data. I have ASTERIX data in .ast format from the Spanish AIP. I am wondering how to convert the .ast data into a plain text format, for example, .csv or also .xml. Actually, I have two .ast files from Part04-Cat048-asterix-bds (BDS data) and Part12-Cat021-asterix-ads-b (ADS-B data). The questions are:

  • Is possible to convert the raw .ast data with this library?
  • In that case, what steps should I follow?

The final desirable results would be the following categories:

ADS-B categories:

I021/010 DATA SOURCE
I021/040 TARGET REPORT DESCRIPTOR
I021/161 TRACK NUMBER
I021/015 SERVICE IDENT.
I021/071 TIME APLIC. POSIT.
I021/130 POSITION WGS84 CO-ORDINATES
I021/131 POSITION WGS84 CO-ORDINATES HIGH RES.
I021/072 TIME APLIC. VELOCITY
I021/150 AIR SPEED
I021/151 TRUE AIR SPEED
I021/080 TARGET ADDRESS
I021/073 TIME MESSAGE REC. POSIT.
I021/074 TIME MESSAGE REC. POSIT. HIGH PRES.
I021/075 TIME MESSAGE REC. VELOCITY
I021/076 TIME MESSAGE REC. VELOC. HIGH PRES.
I021/140 GEOMETRIC HEIGHT
I021/090 QUALITY INDICATORS
I021/210 MOPS VERSION
I021/070 MODE 3/A CODE
I021/230 ROLL ANGLE
I021/145 FLIGHT LEVEL
I021/152 MAGNETIC HEADING
I021/200 TARGET STATUS
I021/155 BAROMETRIC VERTICAL RATE
I021/157 GEOMETRIC VERTICAL RATE
I021/160 AIRBORNE GROUND VECTOR
I021/165 TRACK ANGLE RATE
I021/077 TIME ASTERIX REPORT TRANS.
I021/170 TARGET ID.
I021/020 EMITTER CATEGORY
I021/220 MET INFORMATION
I021/146 SELECTED ALTITUDE
I021/148 FINAL STATE SELECTED ALTITUDE
I021/110 TRAJECTORY INTENT
I021/016 SERVICE MANAGEMENT
I021/008 AIRCRAFT OPERATIONAL STATUS
I021/271 SURFACE CAPABILITIES AND CHARACTERISTICS
I021/132 MESSAGE AMPLITUDE
I021/250 MODE S MB DATA
I021/260 ACAS RESOLUTION ADVISORY REPORT
I021/400 RECEIVER ID
I021/295 DATA AGES

BDS categories:

...

@dsalantic
Copy link
Contributor

It depends of the format of your ast files.
If there is only asterix data inside, without any headers, you could just try it with:
asterix.exe -x -f yourfile.ast
and you should get output in XL format.

If you prefer python, you can find the example here for reading "raw" asterix file: https://github.com/CroatiaControlLtd/asterix/blob/master/asterix/examples/read_raw_file.py

I hope it helps.
BR,
Damir

@marius190
Copy link
Author

marius190 commented Jan 31, 2022

As far as I understood asterix is a python library. Is not clear to me where to run the first command indicated above. Should I run the first line in the python terminal?

Thanks for the fast answer and help.

@marius190
Copy link
Author

About the second link, it worked for me in Google Colab. Apparently, it saves the decoded data in list:

image

I will try to subtract from them only the info I need (BDS44, BDS50, BDS60). Then I will try to save the list in a .csv file.

Finally just to mention that version does now work:

print(asterix.__version__)

This is because inside the asterix module ".version" is not imported:

image

@dsalantic
Copy link
Contributor

As far as I understood asterix is a python library. Is not clear to me where to run the first command indicated above. Should I run the first line in the python terminal?

Thanks for the fast answer and help.

Asterix decoder works in two ways:

  1. Standalone executable application. You need to download the source and compile it by yourself (instruction are in README). Then you can call this command from command prompt.
  2. Python library (as you already discovered)

@dsalantic
Copy link
Contributor

It's strange that .version could not be resolved. It works for me.
I just tried in Google colab with following lines and it works OK:

!pip install asterix_decoder 
import asterix
asterix.__version__

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