Whitespace characters in headers with CPFWriter

The CPF V1 I write using Orekit do not pass the quality checks of the ILRS Operation Center online checker: CPF-Check | Tools | EUROLAS Data Center (EDC) (requires free registration). Only for CPF V1 and not V2 though.

For instance I get the following errors:

H1 CPF 1 DLR 2021 11 10 15 8141 tubin
→ EH1001 in line 1: The pattern in record H1 is wrong.
H2 2105922 6208 48900 2021 11 10 13 1 0 2021 11 17 13 1 0 60 1 1 0 0 0
→ EH2001 in line 2: The pattern in record H2 is wrong.

The error messages are explained in Consolidated Prediction Format (CPF) - Version 1.0 | Operation Center (OC) | EUROLAS Data Center (EDC)

I narrowed down the issue to whitespaces. It seems that in version 1 of the CPF format, the header fields have fixed widths, see:

  • Comment 5 at page 23 of the CPF V1 format document: https://ilrs.gsfc.nasa.gov/docs/2006/cpf_1.01.pdf
  • The online documentation mentions the column number of all fields for the V1 format only.
  • This is not the case anymore for the V2 format which seems to tolerate any position and length, as long as the fields are separated by one whitespace

This would involve the following changes for the H1 header:

  • Leaving one additional whitespace between Format Version and Ephemeris Source (jumps from column 9 to column 12)
  • Leaving one additional whitespace between Hour of ephemeris production and Ephemeris sequence number (jumps from column 28 to column 31)
  • Writing 10 whitespaces at the end of H1 to make up for the missing notes field.

For H2, this requires not writing a whitespace at the end of the line, which the Orekit CPFWriter seems to do for every line.

Attached is a sample CPF V1 file.tubin_cpf_211110_8141_wrong_h1_h2.dlr (817.2 KB)

I opened issue Whitespace characters in headers with CPFWriter (#868) · Issues · Orekit / Orekit · GitLab in Gitlab.

Fixed in develop branch! The fix will be available in 11.1 version.


Perfect, that was fast, thanks for the fix!