Hi everyone ! I am new to Orekit in Python and I need to read GNSS - Differential Code Biases files. SinexLoader documentation says that it can read DCB files but I haven’t succeeded to read any .bia or .bsx . It is worth mentioning that I can read .snx files with no problem (but they usually contain station/receivers informations and I am interested in satellite data (which are rarely in sinex 2.0)). Here is an example :
Traceback (most recent call last):
Cell In[107], line 1
sinFile = org.orekit.files.sinex.SinexLoader(DS)
JavaError: <super: <class 'JavaError'>, <JavaError object>>
Java stacktrace:
java.lang.IllegalArgumentException: No enum constant org.orekit.gnss.ObservationType.
at java.lang.Enum.valueOf(Enum.java:238)
at org.orekit.gnss.ObservationType.valueOf(ObservationType.java:30)
at org.orekit.files.sinex.Dcb.addDcbLine(Dcb.java:99)
at org.orekit.files.sinex.SinexLoader$Parser.loadData(SinexLoader.java:706)
at org.orekit.files.sinex.SinexLoader.<init>(SinexLoader.java:253)
at org.orekit.files.sinex.SinexLoader.<init>(SinexLoader.java:222)
I am wondering if the SinexLoader is actually really made to read DCBs…
Note that in version 13.0, it will be possible to use custom observation types in addition to the predefined ones. This is already available in the develop-13 branch for Rinex obs files, it could be easily added to Sinex DCB files.
Thank you for your answer ! I can at least tell you that I succeeded to extract DCBs from the .BSX file in the example you mentioned .
It seems that the issue is in the first line, here is a non-working example :
%=BIA 1.00 CAS 24:126:07127 CAS 2024:123:00000 2024:124:00000 R 00005991
against the working one
%=BIA 1.00 DLR 2022:011:58414 DLR 2021:274:00000 2022:001:00000 R 00246696
(if I replace this line with the one from your example it works perfectly, with both .bsx and .bia files from the CDDIS).
The error in this case :
JavaError: <super: <class 'JavaError'>, <JavaError object>>
Java stacktrace:
org.orekit.errors.OrekitException: impossible d'analyser la ligne 1 du fichier C:/Users/hlabriji/Downloads/CAS0OPSRAP_20241230000_01D_01D_DCB.BIA/CAS0OPSRAP_20241230000_01D_01D_DCB.BIA :
%=BIA 1.00 CAS 2024:126:07127 CAS 2024:123:00000 2024:124:00000 R 00005991
at org.orekit.files.sinex.SinexLoader$Parser.loadData(SinexLoader.java:425)
at org.orekit.files.sinex.SinexLoader.<init>(SinexLoader.java:253)
at org.orekit.files.sinex.SinexLoader.<init>(SinexLoader.java:222)
BUT it works when I manually remove the extra space before the second “CAS” (the name of the center) ! maybe there is an issue with the parsing of this first line ?
I still don’t understand why it is not working for my DCB file from CNES …
This is indeed the problem. This file is not compliant with SINEX format (see sinex bias 1.00 section 4.1). Nothe that the other file you put in your next message is different, it is still not compliant with Sinex 1.0 format (last fields are ‘P’, ‘00000’ and ‘0’), but this second file can be parsed as we ignore these fields.
Anyway, I would suggest first to ask CNES to produce conformant files (I am in fact more concerned about the last fields than the extra space), but before they change anything, you can apply the following patch to Orekit and recompile it if you can so it is able to load these non-conformant files. SinexLoader.patch (1.1 KB)
I will apply this patch in the upcoming 13.0 version.
Coming back to this thread.
I think your last file could not be parsed by Orekit yet because it contains OSB data (i.e. absolute, with one observable only), not DSB data (i.e. differential, with two observables). The parser fails to check the key in the first column (DSB, OSB, ISB) and I guess it will fail to load the values as the second observable is blank in OSB case.
Here is an update about this discussion.
The Sinex parsers (both regular sinex files and sinex-bias files) have been completely revamped in the develop-13 branch, in order to solve issue 1538.
In the new implementation, the SinexLoader class has been removed and replaced by two parsers (SinexParser and SinexBiasParser), both with a parse method that takes several DataSource instances as argument and return a Sinex or a SinexBias container.
The SinexBiasParser should load properly both DSB and OSB biases. It still does not support ISB.