Notifications
Clear all

Anyone do software for reading, modifying, and writing RINEX?

19 Posts
9 Users
0 Reactions
157 Views
bill93
(@bill93)
Posts: 9873
Member Debater
Topic starter
 

I downloaded the files from here?ÿ?ÿ?ÿ?ÿ?ÿ https://www.ngs.noaa.gov/gps-toolbox/rinex.htm

and made it compile and run as a "DOS" console program.?ÿ My goal is to build on it to do some additional outputs.?ÿ Has anyone else here tried it?

I'm using Visual Studio 6 C++.?ÿ I had to add another "using namespace" line and increase the compiler name memory limit.

It is for Rinex 2.10 but I'm using teqc to get Rinex 2.11 (faked it for now), and need to research whether I'm open to problems from that difference.

It's not as clean as one might hope. The output occasionally turns minutes and 00 seconds into minutees-1 and 60 seconds, or?ÿ -0.00000 seconds.?ÿ Not sure if OPUS will take those, so need to look into it.?ÿ

The compiler says in 2 functions they are returning the address of a local variable, which I would think could give flaky results if something happened to overwrite that location (on the stack?) after it is freed by the function return.

But it may be save me some work if I can figure out the C++ stuff.?ÿ I'm an old (!) programmer who's done a whole bunch of old assembler and high-level languages including C, but my head has trouble with the C++ stuff with zillions of tiny pieces spread all over lots of files.?ÿ I like 20- to 100-line functions that each accomplish some significant part of the processing.

?ÿ

 
Posted : February 25, 2019 9:11 pm
(@paul-in-pa)
Posts: 6044
Member
 

May I ask WHY?

Paul in PA

 
Posted : February 25, 2019 9:27 pm
half-bubble
(@half-bubble)
Posts: 945
Supporter
 

Check out these articles Peter Lazio wrote:

Chapter 9 Editing RINEX Files to Fix a Poor OPUS Run

Editing RINEX Observation Files for OPUS-RS

?ÿ

 
Posted : February 25, 2019 9:42 pm
john-hamilton
(@john-hamilton)
Posts: 3364
Member Debater
 

In the late 90's I wrote software to capture a RT17 stream over serial from Trimble receivers and create both .dat and rinex files. I did this to serve the PA CORS stations, as the Trimble software at the time was terrible. Once Trimble started making better CORS software, I never updated it after about 2001 or so. As I recall it was quite straightforward to write the output to rinex format. I don't remember any issues with anything, and the rinex and dat files processed with no problem in various software. I wrote it all in VB, but I don't remember which version, maybe VB6??ÿ

 
Posted : February 26, 2019 7:31 am
bill93
(@bill93)
Posts: 9873
Member Debater
Topic starter
 
Posted by: half bubble

Check out these articles Peter Lazio wrote:

Those sound very interesting but are expensive to fetch from the site.

 
Posted : February 26, 2019 8:13 am

bill93
(@bill93)
Posts: 9873
Member Debater
Topic starter
 
Posted by: Paul in PA

May I ask WHY?

A) I found the plotting tools at UNAVCO too hard to get running on my first try

B) and was thinking of a custom report to generate

C) and was considering how I might compare files from two receivers.

D) and why not?

?ÿ

 
Posted : February 26, 2019 8:23 am
(@paul-in-pa)
Posts: 6044
Member
 

My post processing software has plotting and report tools. I used them somewhat in the beginning to get a feel for what was going on, but am now very satisfied with standard output and do not even output all the standard available data. So first check with your regular PP software capabilities.

Comparing files? in what sense? I did some file comparisons in the past but it is really only relevant on zero baseline files. A zero baseline file is when you use a single antenna at one location, then use a signal splitter, sending the downloaded observations to two or more different type receivers. You can notice significant differences in recorded data based on the various different internal receiver algorithms. I have done that in the past and would only consider it now if I were actually beta testing a new type receiver, which I highly doubt anyone would pay me to do. Besides a signal splitter itself you may need DC power blockers. Almost every receiver sends out DC power to feed the internal active antenna logic board. You do not want your antenna receiving power from multiple receivers. Even worst is for one receiver to backfeed power to another receiver. Some splitters may have internal DC blockers and the unblocked connections should be marked differently. Not all splitters need power blockers because some antennas are passive requiring no power and?ÿ some receivers expecting a passive antenna send out no power. I have one older antenna that has an on/off switch and requires it's own AA batteries to operate. You have some legwork to get properly set up.

I have found signal splitters and power blockers on ebay and depending on what you find you may need some antenna end gender or size changers or go to a commercial radio store and have them make you some custom antenna cables to the size and style you need. I have a very eclectic collection of antenna cables as I may do a job with one manufacturer's antennas and another's receivers, again check the power requirements. I have N, BNC and TNC, varied male and female ends, as well as some size changers N-TNC, N-BNC, TNC-BNC and sex changers. One of my first cables was a TNC---TNC, made from Radio Shack parts, good luck with that now.

Yes, it is interesting comparing files, if only to prove you do not have to do it. Based on which satellite the receiver fixes on to base the other math on, observations can vary from receiver to receiver. You can exaggerate that change by blocking different satellites in each receiver.?ÿ

Paul in PA

 
Posted : February 26, 2019 9:41 am
leegreen
(@leegreen)
Posts: 2196
Supporter
 
Posted by: Bill93
Posted by: Paul in PA

May I ask WHY?

A) I found the plotting tools at UNAVCO too hard to get running on my first try

B) and was thinking of a custom report to generate

C) and was considering how I might compare files from two receivers.

D) and why not?

?ÿ

Sometimes you have to pay to play.

Without paying for a Static Post Processing application, you will pay for it with the endless hours of trial and error, for minimal results. By writing your own software, you are reinventing the wheel.

You could install Topcon Tools and process up to 5 points in the demo for free. Or find someone who has an old USB toggle for cheap? Which I do have, trouble is I'm not sure if it still works. Haven't used it in 6 years or more.

 
Posted : February 26, 2019 12:16 pm
bill93
(@bill93)
Posts: 9873
Member Debater
Topic starter
 

Since I'm not doing this for pay, but only as a hobby and education, I have more time than money to allocate.

I'll check out the Topcon tools demo.?ÿ That sounds like a great idea that I didn't know about.

Edit: A quick search finds some old links for download, but they take me to Magnet, which has a time limit demo instead of a crippled demo.?ÿ A page on Topcon's site says Tools "formerly available."?ÿ And I doubt a dealer would be interested in helping me knowing there was no potential sale.

 
Posted : February 26, 2019 12:25 pm
(@totalsurv)
Posts: 807
Member Debater
 

I sent a One Drive link with the Topcon Tools file to the email in your profile

 
Posted : February 26, 2019 4:30 pm

bill93
(@bill93)
Posts: 9873
Member Debater
Topic starter
 

Thanks!?ÿ Got it installed on an XP machine and found some guides and manuals.?ÿ Now I've got a LOT of learning to do.

 
Posted : February 26, 2019 7:31 pm
bill93
(@bill93)
Posts: 9873
Member Debater
Topic starter
 

I got Topcon Tools to import two simultaneous GPS sessions and give me much lower sigmas for the vector between them than for the points.?ÿ Some further checking is in order, but that's progress.

I have some questions about the GPS processing that would fit better in the other thread.

I am unable to manually input TS angles and distances, plus starting point coordinates and one backsight azimuth, and get the program to compute coordinates or adjust.?ÿ Not sure what I'm doing wrong there, but that's not my main purpose for using the program.

 
Posted : March 2, 2019 10:29 am
(@squowse)
Posts: 1004
Member
 

Does TEQC do what you need?

 
Posted : March 2, 2019 3:26 pm
bill93
(@bill93)
Posts: 9873
Member Debater
Topic starter
 

I use teqc to convert the receiver files to Rinex and fix the 1024 week rollover, but I dont think it has the ability to do comparing of files.

 
Posted : March 2, 2019 6:44 pm
(@bwpaull)
Posts: 5
Member
 

is theres a reference of some sort explaining how you converted to Rinex and fixed the rollover?  Like a version for newbies?  I have encountered that exact problem.  Thanks.

 
Posted : March 3, 2019 9:54 pm

bill93
(@bill93)
Posts: 9873
Member Debater
Topic starter
 

If I don't already know the GPS week number I run the .dat file through teqc with the +meta option, and it tells me the week and other info.

Then I run tecq again specifying as for instance ?ÿ ?ÿ -week 2042 ?ÿ?ÿ and other options.?ÿ The resulting RINEX works in OPUS.

 
Posted : March 4, 2019 12:38 am
geeoddmike
(@geeoddmike)
Posts: 1556
Member
 

Why do it the easy way ???? ?

I subtract the start of GPS time and subtract it from the current doy and year. Multiply years by 52 divide diff in days by 7 then add one since the first GPS week was one.

But that's just me...

 
Posted : March 4, 2019 3:24 pm
geeoddmike
(@geeoddmike)
Posts: 1556
Member
 

Oh, GPS time started 5 Jan 1980.

?ÿ

?ÿ

 
Posted : March 4, 2019 4:02 pm
geeoddmike
(@geeoddmike)
Posts: 1556
Member
 

Bad info in posting 4 March 2019.

My previous post on an easy way to compute the GPS week was wrong.?ÿ Also, my statement that GPS time started 5 January 1980 is more correctly stated as ƒ??GPS Time is a uniformly counting time scale beginning at the 1/5/1980 to 1/6/1980 midnight. ƒ?? (4)?ÿ

To atone, I provide the following algorithm (adapted from BW Remondiƒ??s code at the NGS site). (3)?ÿ It uses Modified Julian Days (MJD) as one should.(1) Note that my algorithm does not include the computation of the seconds of week in BWRƒ??s code.

The algorithm does NOT include the ƒ??((year - 1901)%4)*365ƒ? as I could not figure out why it was included as I think the leap days issues is already accounted for. Unfortunately my ancient lecture notes on the subject of gps time conversions have ?ÿmouldered into dust (as has my memory). I shall attempt to NOT whip out answers without more thorough review.

Constants:?ÿ

MJD_1Jan1901?ÿ = 15385?ÿ ?ÿ

MJD_6Jan1980 = 44244 (start of GPS time)

?ÿ

Inputs: ?ÿ

Year

DOY

How the algorithm works

It computes the number of days based on the number of four-year intervals between the year of interest and year 1901. Multiply this value by 1461 (number of days in three regular and one leap year ). Add to this the day of year subtract one then add the MJD of 1 Jan 1901. This computes the MJD for the day of interest.

To calculate the GPS week we use the MJD computed above, subtract the MJD for Jan61980 then divide by seven.

MJD = ((year - 1901)/4 * 1461 + DOY -1 + MJD_1Jan1901?ÿ

GPS_week = ( MJD - MJD_6Jan1980 ) / 7

A numeric example follows:

Year: 2019

DOY: 63

MJD = (2019-1901)/4 * 1461 + 063-1 + 15385 = 58546.5

GPS_WK = (58546.5 - 44244)/7 = 2043 (verified against NGS GPS Calendar)(2)

Note that BWRƒ??s code includes another segment in the computation of MJD.?ÿ

References:

  1. https://tycho.usno.navy.mil/mjd.html
  2. https://www.ngs.noaa.gov/CORS/Gpscal.shtml
  3. https://www.ngs.noaa.gov/gps-toolbox/bwr-c.txt ?ÿ
  4. https://www.oc.nps.edu/oc2902w/gps/timsys.html

?ÿ

C code function?ÿfrom reference (3) above.

/*------------------------------------------------------------------------

?ÿ* ydhms_to_gps?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ *

?ÿ* ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ ?ÿ *

?ÿ* Input: year, yday, hour, minute, second ?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