3
$\begingroup$

I want to compare the position calculated with Pyephem and TLE files, with RINEX files and GPSTK library in a specific date and time, but I have not the certainly if the name of the satellite "PRN ##" are the same in both files (TLE and RINEX)?

e.g. in Celestrak (TLE file) for a GPS constellation, the ID or name of satellite is:

GPS BIIF-1 (PRN 25)
1 26690C 01004A 17096.69312500 -.00000000 00000-0 00000-0 0 966 2 26690 53.0252 160.8176 0181123 256.0966 20.3287 2.00554091 10

but in the RINEX files only have a letter joined to a number, like this:

17 01 12 00 00 0.0000000 0 21G05G16G20G21G25G26G27G29G31R01R02R09 R15R16R17R18R19E01E26S20S36

where the letter is the contellation G for GPS constellation, and R for GLONASS constallation, S is for SBAS, etc. Next to the letter is a number, e.g. G25, the number of that satellite is 25 for the RINEX file.

I'm worked with GPS constellation. I'm testing with some code in python, but i'm not sure if the PRN 25 is the same to G25?, because calculating the elevation of satellite with ID 25 in a hole day, is different in the time that RINEX file shows comparating with TLE files... or may be is something wrong in my code.

obsHeader, obsData = gpstk.readRinex3Obs(obsfile)
navHeader, navData = gpstk.readRinex3Nav(navfile)
# setup ephemeris store to look for satellite positions
bcestore = gpstk.GPSEphemerisStore()
for navDataObj in navData:
    ephem = navDataObj.toGPSEphemeris()
    bcestore.addEphemeris(ephem)
bcestore.SearchNear()
navData.close()
#look each satellite
for obsObject in obsData: #round the data
    for satID, datumList in obsObject.obs.iteritems():
        if satID.systemGPS == satID.system and satID.id == NumSatellite:
            time=obsObject.time #satellite time from the observation
            CivilTime = gpstk.CivilTime(obsObject.time)
            #break
            eph   = bcestore.findEphemeris(satID, obsObject.time)
            svXvt = eph.svXvt(obsObject.time)
            elev = obsHeader.antennaPosition.elvAngle(svXvt.getPos())
            azim    = obsHeader.antennaPosition.azAngle(svXvt.getPos())
            
            SecondsTime.append(obsObject.time.getSecondOfDay())
            TimesSatRin.append(CivilTime)
            AziSatRin.append(azim)
            ElevSatRin.append(elev)
#for each observation day.
DateTimeRinex = CivilTime2datetime(TimesSatRin)
for t in DateTimeRinex:
    #for each Time of the rinex (for the specific Satellite)
    print 'next time: ', t

    names,elevs,azs,types = GetPositionELAZ(t,Longitude_obs,Latitude_obs,1) #just GPS with TLE files
    print names
    for i in range (0,len(names)):
        number = int(filter(str.isdigit, names[i]))
        #print number,' number sat of the TLE'
        if number == NumSatellite:
            print 'GOT',number,' number sat of the TLE'
            TimeTLE.append(t)
            ElevTLE.append(elevs)
            AzimTLE.append(azs)

The position (lon,Lat) is the same of the ground station of the RINEX file repository. Thanks.

UPDATE 1:
I'm testing with my code, one vehicle by one, and I can see the comparison of elevations of each satellite, across the day. For RINEX files I try with 4 days, day of year 101, 100, 80 and 10. and for these day always the TLS PRN 10 it results are similar to RINEX PRN 12; I said similar, because it's not the same results. I'm still checking.

20th April

20 april

19th April

19th April

21th March

21th March

10th January

10th January

Apparently exists a PRN ID for RINEX by each PRN ID for TLE, in this case RINEX PRN 12 = TLE PRN 10. But this is not the precise answer, so I'll let open the question

UPDATE 2:

The calculate of position with TLE it's very accurate. but I got an error, I got a position in Longitude/Latitude, but was a wrong position, for be sure, you must to take the position for compare, by the RINEX file (the observation file), in the Header; the file have the position in X,Y,Z, so is necessary convert to position longitude-latitude.enter image description here

for get the Longitude-Latitude:

def Get_latitude(x, y, z):
    #radius earth
    r = 6371000.
    return np.arcsin(z/r)*(180/np.pi)

def Get_longitude(x, y, z):
    #radius earth
    r = 6371000.
    if (x > 0):
        return np.arctan(y/x)*(180./np.pi)
    elif y > 0:
        return np.arctan(y/x)*(180./np.pi) + 180.
    else:
        return np.arctan(y/x)*(180./np.pi) - 180.
$\endgroup$
6
  • 1
    $\begingroup$ I'm not sure if I understood the problem correctly but PRN number is dedicated to a gps satellite, so it should not change between different sources. What is the difference you are talking about? $\endgroup$ Commented Mar 30, 2017 at 21:15
  • $\begingroup$ The TLS file ID for each satellite is e.g. GPS BIIRM-3 (PRN 12) and in RINEX file is e.g. G12, I'm trying to compare the same satellite, at e.g. _12/03/2017 - 12:34 p.m. _ according to the test, are not the same satellite (PRN12 and G12) so, what is the same satellite in TLE files and RINEX files? (or may be my test is wrong) $\endgroup$ Commented Mar 31, 2017 at 0:26
  • 1
    $\begingroup$ side comment, Skyfield is another python package which has some functions overlapping with pyephem. Both are maintained by the same person, but going forward Skyfield may become more useful for satellite and solar system spaceflight, as it is built directly on the JPL ephemerides while pyephem does a lot of specialized calculations but does not draw from the JPL ephemerides. $\endgroup$
    – uhoh
    Commented Mar 31, 2017 at 1:51
  • $\begingroup$ Thank you @uhoh, I'm testing Skyfield I did not knew it, and is so interesting. For now I'm comparing the position of the satellite in Azimuth and Elevation, so, both libraries works for me, but I see Skyfield use TLE too. is wrong to compare the RINEX files with the TLE files in a specific date? $\endgroup$ Commented Apr 4, 2017 at 16:29
  • 1
    $\begingroup$ There are a lot of objects in orbit and very few people keep all of their names in their head. To improve your chances of getting an answer, post specific examples of what you are talking about. I looked in a satcat download from CelesTrak and I don't see "BIIRM" anywhere. What is a "TLS File ID"? Please modify your question and add clear, specific examples of what you are talking about. Don't expect people to go hunting for an answer for you. What have you looked at so far to try to get the answer? I think this is the kind of thing @VolkanOzcan may have been referring to. $\endgroup$
    – uhoh
    Commented Apr 4, 2017 at 21:57

1 Answer 1

1
$\begingroup$

I think what's going on here is basically the same thing discussed in this question, where the two answers are "they use different coordinate systems" and "they mean different things by the same element names". Even if the OP got the frame rotation correct, differences at this scale do not surprise me at all. For one reason, the specs for GPS and for TLE define different equations for modeling the short-time, non-elliptical behavior of orbits, so when comparing the results in detail over a range of times, the shapes of the curves are just going to be a bit different.

What's unique about this question is how satellite ID (well, pseudorandom noise sequence ID) enters the picture. Here I'm just guessing about the OP's code, but what I think may be happening is because there are a lot of GPS satellites, and they all maintain very similar orbits. This probably means that if you aren't handling the frame rotation correctly, and you look at enough data, you will by luck find a few examples in which you looked in systematically the wrong place for the satellite you wanted to find, but when you looked there, you actually found a different satellite of the same constellation in pretty much the place you looked.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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