Homework 4: GPS Data Files
Due: 10 a.m. October 10, 2003.
This homework prepares you to read GPS data files - which will be used
extensively in the next three Friday labs.
Given:
Section 1
Answer these questions about the attached TMGO RINEX file by reading it:
- How many observables are on the file? What are
they called? What are the units of each observable?
- What is P2 for PRN 4?
- What is L2 for PRN 2? Convert to meters.
- Should you use the P1 data for this site?
If you need a refresher on RINEX formats, please read this file.
Section 2
Fortunately, we won't be reading RINEX files by eye. Please write software that
reads the TMGO RINEX header and the first data record.
Steps to follow in your code (which can be stand-alone):
- Define GPS constants, such as the fundamental frequency fo,
the L1 and L2 frequencies (154*fo and 120fo) ,
the speed of light, and the L1 and L2 wavelengths. You are required
to define the units of each of these quantities. Use reasonable variable
names (e.g. don't call the speed of light W) for these quantities.
A refresher course on GPS constants.
- You need to define the name of your RINEX file.
- Assign a file ID (fid) to this RINEX file by using fopen, i.e. fid = fopen(filename)
The file ID is analogous to a FORTRAN unit. It allows you to open multiple files at the
same time. You use the file ID to keep track of which one you are writing to or reading from.
- Check to see if your file ID is negative. If it is, this is an error and you
should send an error message to the screen.
- Read the RINEX header of the given file using ReadObsHeader.m. This function
requires that you send the file ID to it.
- Convert the Cartesian coordinates of the receiver
into latitude, longitude, and height. Print to screen using a printf command
or disp with an appropriate number of decimals.
- Calculate the number of observables returned by ReadObsHeader. Print them to the screen as well
so you know if the program is working correctly (i.e. by comparing with what you read from
the file in the first section.)
- Figure out the order in which the observations are listed in the file, i.e. are they
in the order of C1, L1, L2, P1, P2 or L1, L2, C1, P1, P2, etc. I urge you to use the Matlab
function strmatch.
- Now use ReadObsRecord.m to read the first data record.
The documentation for this software is at the top.
Another issue, which is not relevant
this week, is that ReadObsRecord.m returns NaN if the data are zero.
This generally occurs on the L2 data (both the phase and pseudorange) - not the L1 data.
- Use the data from the first record to answer the questions about PRN 4 and PRN 2. Make sure you
print the answers with mm level precision.
- Calculate the GPS week and
GPS seconds of the week for the first
time (and only) epoch in the file. Print this information to the screen.
- Close your RINEX file by using fclose.
Turn in: answers to questions, your code, and the output to the screen.