Rinex observation and navigation

16 views (last 30 days)
I have tried everything I could get my hands on and nothing is working. What am I missing here that is not allowing me to transform my .o and .n files into something readable? Could someone download and run to see if I am forgetting to implement something?

Accepted Answer

William Rose
William Rose on 29 Mar 2021
Please, if you want assistance, respond to the questions asked ealrier. What happens when you run your code?
I tried running your code, using the .n file you provided. First I had to delete '.txt' from the name of the file you posted, so that it would match the expected file name in your code. Here is the result I get, when I run your code:
>> Main_Lab3
Undefined function or variable 'YYMMDDHHMMSS_2GPSSec'.
Error in Nav_Reader (line 49)
[Time Weeks Seconds] = YYMMDDHHMMSS_2GPSSec( time );
Error in Main_Lab3 (line 9)
[ Nav_Out, IonAlpha, IonBeta, Delta_UTC, LS ] = Nav_Reader( filename );
>>
The error messages tell us (working from the bottom up) that Main_Lab3 had an error in line 9, because it called NavReader(), which had an error in line 49, because line 49 called function YYMMDDHHMMSS_2GPSSec(), which has not been defined.
So define that function and try again.
By the way, if I had gotten past line 9 of Main_Lab3, I would have gotten an error on line 20, because you have not posted the .o file which line 20 tries to open.
  2 Comments
William Rose
William Rose on 29 Mar 2021
You can find function YYMMDDHHMMSS_2GPSSec.m on Github, thanks to Keith Menezes:
When I download it, I no longer get the error message at line 49 of NavReader(). The new error is at line 86 of NavReader. Here is the console output, now that I have YYMMDDHHMMSS_2GPSSec.m.
>> Main_Lab3
Index exceeds the number of array elements (22).
Error in Nav_Reader (line 86)
FitInterval = str2double(line8(23:37)) * 10^(str2double(line8(39:41)));
Error in Main_Lab3 (line 9)
[ Nav_Out, IonAlpha, IonBeta, Delta_UTC, LS ] = Nav_Reader( filename );
>>
This error happens because NavReader() expects more characters on 'line8'. Further inspection of the code shows that NavReader reads 8 lines at a time from the .n file, after skipping a bunch of header lines. It has no problems with the first three sets of eight lines, but on the fourth set of 8 lines, 'line8' (which is line 59 of the .n file you posted) is shorter than expected. Compare line 59 to lines 35, 43, and 51, which are the previous "line8"s of the .n file. You will see the difference. Lines 67 and 99 are future "line8"s in the .n file which are also shorter than expected.
You will have to use your understanding of navigation files, and your understanding of the goals of the main program, to decide how to modify NavReader.m, so that it does not generate errors when it encounters shorter-than-expected lines.
I downloaded a .n file and a .o file from here. I modified Main_Lab3 so that it would use the new files. The modified Main_Lab3wcr.m is attached. Download the .n and .o files as a zip file from here, since the .o file is too big to attach. With the new .n file, there is no longer an error at line 9 of Main. In other words, the program is able to process the new .n file without an error. There is an error at line 22 of Main_Lab3wcr.m (attached), while processing the .o file. The console output is below.
>> Main_Lab3wcr
Navigation File Processed
Undefined function or variable 'StandLength'.
Error in ObsReader (line 47)
[ line ] = StandLength( line );
Error in Main_Lab3wcr (line 22)
[ Obs_Out, ApproxXYZ, obs_types ] = ObsReader( filename );
>>
The error happens because ObsReader.m calls StandLength(), which does not exist. You need to find or create StandLength.m.
University Student
University Student on 29 Mar 2021
Thanks I will get to work fixing this then, thanks so much for your help!

Sign in to comment.

More Answers (2)

William Rose
William Rose on 29 Mar 2021
I suggest you post the .o and .n files whose names appear in Main_Lab3.m so people can run the program. Please tell the audience how navigation information is represented in these files and what exactly you mean by "transform the files into something readable". When you run your program, what happens? It looks like you expect the files to contain text (you are using fgetl(), which expects text). Why would a text file need to be transformed into something readable?
Could your .o and .n files be corrupted? Have you tested the files with other navigation programs?
  2 Comments
University Student
University Student on 29 Mar 2021
Sure I can add those files. Yes this are in a text file format. I need SV and position, time, etc. the variables in the code.
University Student
University Student on 29 Mar 2021
It would only let me load the navigation file for now

Sign in to comment.


Ryan Salvo
Ryan Salvo on 19 Jun 2024
The rinexread command will let you load a RINEX OBS and NAV file into MATLAB. You can then visualize the NAV data by following this example.

Categories

Find more on Downloads in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!