@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
PATH=%PATH%;D:\bin;D:\bin\unixutils
set RinVer=3.04
set RinVer2=2.11
set hpath=%CD%
set dfilepath=%CD%\Dfiles
set rinpath=%CD%\Rinex-!RinVer!
set rinpath2=%CD%\Rinex-!RinVer2!
for %%f in (*.tps) do (
for /F %%b in ("%%f") do set tpsfilename=%%b & set sitename=!tpsfilename:~0,4!
for /F %%b in ("%%f") do set tpsfilename=%%b & set doy=!tpsfilename:~4,3!
for /F %%b in ("%%f") do set tpsfilename=%%b & set filename8=!tpsfilename:~0,8!
for /F %%b in ("%%f") do set tpsfilename=%%b & set num8=!tpsfilename:~7,1!
echo Converting !tpsfilename! into RINEX !RinVer!.
echo.
tps2rin -v !RinVer! --sn -N !sitename! -m !sitename! -O -S -~ -p !sitename!.profile.ini -i !tpsfilename!
for %%o in (!sitename!!doy!0.??o) do (
for /F %%b in ("%%o") do set ofilename=%%b & set doy=!ofilename:~4,3!
for /F %%b in ("%%o") do set ofilename=%%b & set yy=!ofilename:~9,2!
move !sitename!!doy!0.!yy!o !sitename!!doy!!num8!.!yy!o >nul 2>nul
move !sitename!!doy!0.!yy!p !sitename!!doy!!num8!.!yy!p >nul 2>nul
set r3dir=%rinpath%\!sitename!\!sitename!R!yy!.!doy!
mkdir !r3dir! >nul 2>nul
echo.
echo MOVE !sitename! !doy! !yy! RINEX !RinVer! files to !r3dir!.
echo.
if !num8!==0 (
move !sitename!!doy!!num8!.!yy!o !r3dir! >nul 2>nul
move !sitename!!doy!!num8!.!yy!p !r3dir! >nul 2>nul
copy !sitename!.profile.ini !r3dir! >nul 2>nul
) ELSE (
if EXIST !r3dir!\!sitename!!doy!0.!yy!o (
echo EXIST !r3dir!\!sitename!!doy!0.!yy!o
echo.
echo MOVE !sitename!!doy!!num8!.!yy!o to !r3dir! in overlay mode.
echo.
move !sitename!!doy!!num8!.!yy!o !r3dir! >nul 2>nul
move !sitename!!doy!!num8!.!yy!p !r3dir! >nul 2>nul
copy !sitename!.profile.ini !r3dir! >nul 2>nul
gfzrnx -vo 3.04 -finp !r3dir!\!sitename!!doy!0.!yy!o !r3dir!\!sitename!!doy!!num8!.!yy!o -fout !sitename!!doy!0.!yy!o >nul 2>nul
gfzrnx -vo 3.04 -finp !r3dir!\!sitename!!doy!0.!yy!p !r3dir!\!sitename!!doy!!num8!.!yy!p -fout !sitename!!doy!0.!yy!p >nul 2>nul
move !sitename!!doy!0.!yy!o !r3dir! >nul 2>nul
move !sitename!!doy!0.!yy!p !r3dir! >nul 2>nul
) ELSE (
copy !sitename!!doy!!num8!.!yy!o !r3dir! >nul 2>nul
copy !sitename!!doy!!num8!.!yy!p !r3dir! >nul 2>nul
move !sitename!!doy!!num8!.!yy!o !r3dir!\!sitename!!doy!0.!yy!o >nul 2>nul
move !sitename!!doy!!num8!.!yy!p !r3dir!\!sitename!!doy!0.!yy!p >nul 2>nul
copy !sitename!.profile.ini !r3dir! >nul 2>nul
)
)
)
echo Converting !tpsfilename! into RINEX !RinVer2!.
echo.
tps2rin -v !RinVer2! --sn -N !sitename! -m !sitename! -O -S -~ -p !sitename!.profile.ini -i !tpsfilename!
for %%o in (!sitename!!doy!0.??o) do (
for /F %%b in ("%%o") do set ofilename=%%b & set doy=!ofilename:~4,3!
for /F %%b in ("%%o") do set ofilename=%%b & set yy=!ofilename:~9,2!
move !sitename!!doy!0.!yy!o !sitename!!doy!!num8!.!yy!o >nul 2>nul
move !sitename!!doy!0.!yy!n !sitename!!doy!!num8!.!yy!n >nul 2>nul
move !sitename!!doy!0.!yy!g !sitename!!doy!!num8!.!yy!g >nul 2>nul
set ddir=%dfilepath%\!sitename!\!sitename!D!yy!.!doy!
mkdir !ddir! >nul 2>nul
echo MOVE !tpsfilename! to !ddir!.
echo.
move !tpsfilename! !ddir! >nul 2>nul
copy !sitename!.profile.ini !ddir! >nul 2>nul
set rdir=%rinpath2%\!sitename!\!sitename!R!yy!.!doy!
mkdir !rdir! >nul 2>nul
if !num8!==0 (
echo.
echo DO TEQC checking for %%o.
echo.
teqc +qc -plot -R -C !sitename!!doy!!num8!.!yy!o 1>!sitename!!doy!!num8!.!yy!o.TEQC.log 2>!sitename!!doy!!num8!.!yy!o.TEQC.ERROR.log
echo MOVE !sitename!!doy!!num8!.!yy!o to !rdir! in overlay mode.
echo.
move !sitename!!doy!!num8!.!yy!o !rdir! >nul 2>nul
move !sitename!!doy!!num8!.!yy!n !rdir! >nul 2>nul
move !sitename!!doy!!num8!.!yy!g !rdir! >nul 2>nul
move !sitename!!doy!!num8!.!yy!S !rdir! >nul 2>nul
copy !sitename!!doy!!num8!.!yy!o.TEQC.log !rdir! >nul 2>nul
copy !sitename!!doy!!num8!.!yy!o.TEQC.ERROR.log !rdir! >nul 2>nul
copy !sitename!.profile.ini !rdir! >nul 2>nul
) ELSE (
echo.
echo DO TEQC checking for %%o.
echo.
teqc +qc -plot -R -C !sitename!!doy!!num8!.!yy!o 1>!sitename!!doy!!num8!.!yy!o.TEQC.log 2>!sitename!!doy!!num8!.!yy!o.TEQC.ERROR.log
for /F %%b in ("%%o") do set ofilename=%%b & set yy=!ofilename:~9,2!
echo MOVE !sitename! !doy! !yy! RINEX !RinVer2! files to !rdir!.
echo.
if EXIST !rdir!\!sitename!!doy!0.!yy!o (
echo EXIST !rdir!\!sitename!!doy!0.!yy!o
echo.
echo MOVE !sitename!!doy!!num8!.!yy!o to !rdir! in overlay mode.
echo.
move !sitename!!doy!!num8!.!yy!o !rdir! >nul 2>nul
move !sitename!!doy!!num8!.!yy!n !rdir! >nul 2>nul
move !sitename!!doy!!num8!.!yy!g !rdir! >nul 2>nul
move !sitename!!doy!!num8!.!yy!S !rdir! >nul 2>nul
copy !sitename!!doy!!num8!.!yy!o.TEQC.log !rdir! >nul 2>nul
copy !sitename!!doy!!num8!.!yy!o.TEQC.ERROR.log !rdir! >nul 2>nul
copy !sitename!.profile.ini !rdir! >nul 2>nul
echo Merge !sitename!!doy!!num8!.!yy!o with !sitename!!doy!0.!yy!o.
echo.
teqc !rdir!\!sitename!!doy!0.!yy!o !rdir!\!sitename!!doy!!num8!.!yy!o > !sitename!!doy!0.!yy!o 2>nul
teqc !rdir!\!sitename!!doy!0.!yy!n !rdir!\!sitename!!doy!!num8!.!yy!n > !sitename!!doy!0.!yy!n 2>nul
teqc !rdir!\!sitename!!doy!0.!yy!g !rdir!\!sitename!!doy!!num8!.!yy!g > !sitename!!doy!0.!yy!g 2>nul
teqc +qc -plot -R -C !sitename!!doy!0.!yy!o 1>!sitename!!doy!0.!yy!o.TEQC.log 2>!sitename!!doy!0.!yy!o.TEQC.ERROR.log
echo MOVE !sitename!!doy!0.!yy!o to !rdir! in overlay mode.
echo.
move !sitename!!doy!0.!yy!o !rdir! >nul 2>nul
move !sitename!!doy!0.!yy!n !rdir! >nul 2>nul
move !sitename!!doy!0.!yy!g !rdir! >nul 2>nul
move !sitename!!doy!0.!yy!S !rdir! >nul 2>nul
copy !sitename!!doy!0.!yy!o.TEQC.log !rdir! >nul 2>nul
copy !sitename!!doy!0.!yy!o.TEQC.ERROR.log !rdir! >nul 2>nul
) ELSE (
echo MOVE !sitename!!doy!!num8!.!yy!o to !rdir! in overlay mode.
echo.
copy !sitename!!doy!!num8!.!yy!o !rdir! >nul 2>nul
copy !sitename!!doy!!num8!.!yy!n !rdir! >nul 2>nul
copy !sitename!!doy!!num8!.!yy!g !rdir! >nul 2>nul
copy !sitename!!doy!!num8!.!yy!S !rdir! >nul 2>nul
copy !sitename!!doy!!num8!.!yy!o.TEQC.log !rdir! >nul 2>nul
copy !sitename!!doy!!num8!.!yy!o.TEQC.ERROR.log !rdir! >nul 2>nul
move !sitename!!doy!!num8!.!yy!o !rdir!\!sitename!!doy!0.!yy!o >nul 2>nul
move !sitename!!doy!!num8!.!yy!n !rdir!\!sitename!!doy!0.!yy!n >nul 2>nul
move !sitename!!doy!!num8!.!yy!g !rdir!\!sitename!!doy!0.!yy!g >nul 2>nul
move !sitename!!doy!!num8!.!yy!S !rdir!\!sitename!!doy!0.!yy!S >nul 2>nul
copy !sitename!.profile.ini !rdir! >nul 2>nul
)
)
)
)
PAUSE
相关文章
- 11-04tps2rinex4c.bat