原来一直用朋友的天宝接收机进行变形监测软件的测试,基准站数据流为RT27,这两天有朋友用了一款过国外板卡进行测试,数据流采用了RTCM32。奇怪的是在Rinex转换过程中始终无法发现星历数据(用的某厂商的数据读取库),然后拿RTKlib进行rinex格式转换,还是不行,但是朋友发过来用RTKlib转换的数据没有问题。
历时一晚,发现我用的rtklib为2.4.2,朋友的rtklib为2.4.3,替换版本搞定,太坑了。
果断将原有数据格式转换库替换为rtklib2.4.3,转换代码给大家贡献一下,欢迎交流!
/// <summary>
/// rtcm32转rinex
/// </summary>
/// <param name="file"></param>
public static void convertRTCM32Rindex(string file)
{
string path = Path.GetDirectoryName(file);
string siteName = Path.GetFileNameWithoutExtension(file);
try
{
MainForm.Default.LogToUIThread(0, "开始转换RTCM3至rinex," + System.IO.Path.GetFileName(file));
Process p = new Process();
p.StartInfo.FileName = "convbin.exe";//需要启动的程序名
p.StartInfo.Arguments = " \"" + file + "\" -tr " + DateTime.UtcNow.ToString("yyyy/MM/dd hh:mm:ss") + " -hm " + siteName + " -od -os -oi -ot -ol -r rtcm3 -d \"" + path+ "\" -v 3.02 -h %r.%yH -o %r.%yO -n %r.%yP -l %r.%yL -q %r.%yQ -g %r.%yG" + " -c " + siteName ;//启动参数
p.StartInfo.UseShellExecute = false;
//p.StartInfo.RedirectStandardInput = true;
//p.StartInfo.RedirectStandardOutput = true;
//p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();//启动
p.WaitForExit();//等待程序执行完退出进程
p.Close();
MainForm.Default.LogToUIThread(0, "转换RTCM3至rinex完成," + System.IO.Path.GetFileName(file));
}
catch (Exception e)
{
MainForm.Default.LogToUIThread(0, "转换RTCM3至rinex失败,未读取到有效观测数据" + System.IO.Path.GetFileName(file) + e.Message);
}
}