georinex icon indicating copy to clipboard operation
georinex copied to clipboard

Galileo NAV messages with both I/NAV and F/NAV

Open mvillion opened this issue 3 years ago • 1 comments

Hello,

I am trying to parse a recent Galileo file: ftp://ftp.cddis.eosdis.nasa.gov/pub/gnss/data/daily/2020/182/20l/tlsg1820.20l.Z

As it contains both F/NAV 0x102 (258) and I/NAV 0x205 (517) messages, current nav2.py rejects all messages.

Adding a filter on DataSrc value enables to extract information.

I do not know if this solution makes sense.

Thank you


#_ %% format I2 http://gage.upc.edu/sites/default/files/gLAB/HTML/GPS_Navigation_Rinex_v2.11.html svs.append(f'{svtype}{ln[:2]}'.replace(' ', '0'))

        times.append(time)
        """
        now get the data as one big long string per SV
        """
        raw = ln[22:79]  # NOTE: MUST be 79, not 80 due to some files that put \n a character early!
        for _ in range(Nl[header['systems']]):
            raw += f.readline()[STARTCOL2:79]
        # one line per SV
        # NOTE: Sebastijan added .replace('  ', ' ').replace(' -', '-')
        # here, I would like to see a file that needs this first, to be sure
        # I'm not needlessly slowing down reading or creating new problems.
        raws.append(raw.replace('D', 'E').replace('\n', ''))

#_ %% Galileo specific: filter data source

#_ https://binex.unavco.org/binex_record_01.html #_ data sources:

#_ bit 0: I/NAV E1-B #_ bit 1: F/NAV E5a-I #_ bit 2: I/NAV E5b-I #_ bit 8: af0-af2, ToC are for E5a,E1 #_ bit 9: af0-af2, ToC are for E5b,E1

#_ although only specific combinations are valid, i.e.

#_ 0x102 (258) for F/NAV from E5a #_ 0x201 (513) for I/NAV from E1 #_ 0x204 (516) for I/NAV from E5b #_ 0x205 (517) for I/NAV from E1+E5b data_src_filt = 0x205 if svtype == 'E' and data_src_filt is not None:

    # aggregate all rows in a 2D char matrix
    raw = np.array(raws, dtype="S")
    raw_len = np.vectorize(len)(raw)
    if not (raw_len == raw_len[0]).all():
        raise RuntimeError("Non-uniform rows are unexpected")
    raw_uint8 = raw.view(dtype=np.uint8).reshape(len(raw), -1)

    # extract characters of column DataSrc and convert to uint16
    i_data_src = fields.index("DataSrc")
    col = raw_uint8[:, i_data_src*19:(i_data_src+1)*19].reshape(-1)
    data_src = col.view(dtype="S19").astype(float).astype(np.uint16)

    # filter matching values
    is_in = data_src == data_src_filt
    times = np.array(times)[is_in].tolist()
    raws = [r.decode() for r in raw[is_in]]
    svs = np.array(svs)[is_in].tolist()

#_ %% parse svu = sorted(set(svs))


mvillion avatar Jul 04 '20 11:07 mvillion

Thanks, I will take a look at this when I'm able. I've saved the notification.

scivision avatar Jul 10 '20 03:07 scivision