<div dir="ltr"><div>Hi</div><div><br></div><div>I have been playing with epochs today. Maybe I am understanding something wrongly, but the outputs are very strange.</div><div><br></div><div>My deductions are:</div><div>- the 4th dimension (v_4) from the input is just copied into the output of cs2cs. Independently of epoch flags.</div><div>- if --s_epoch or --t_epoch are set, the input v_4 is ignored (but still printed in the output)</div><div>- if only --s_epoch or --t_epoch is set, v_4 is set before and after the transformation to that value</div><div>- if both are set, v_4 is set to s_epoch before transforming, and to t_epoch after. So in this case t_epoch only works to tag the output time,... but it is not displayed in cs2cs (it is in the C function)</div><div><br></div><div>Is that correct? Why is t_epoch overwriting the input time/epoch? Why is s_epoch setting the output time/epoch?</div><div>In addition, cs2cs is apparently not printing the modified output epoch. This is not what C function does.</div><div><br></div><div>Here are some transformations using the input epoch in the coordinates and the --s_epoch and --t_epoch</div><div><br></div><div><span style="font-family:monospace">echo 40 0 0 | ./cs2cs ITRF90 ITRF2014  -d 9<br>40.000000788       -0.000000207 0.009684166</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">echo 40 0 0 foo bar | ./cs2cs ITRF90 ITRF2014  -d 9 <br>40.000000788   -0.000000207 0.009684166 foo bar</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">echo 40 0 0 2010 | ./cs2cs ITRF90 ITRF2014  -d 9<br>40.000000788       -0.000000207 0.009684166 2010<br><br></span></div><div><span style="font-family:monospace">echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014  -d 9<br>40.000000087        -0.000000216 -0.028724159 1980<br><br></span></div><div><span style="font-family:monospace">echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014  -d 9 --s_epoch 2000<br>40.000000555        -0.000000210 -0.003118609 1980<br><br></span></div><div><span style="font-family:monospace">echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014  -d 9 --s_epoch 2010<br>40.000000788        -0.000000207 0.009684166 1980<br><br></span></div><div><span style="font-family:monospace">echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014  -d 9 --s_epoch 2010 --t_epoch 2030<br>40.000000788  -0.000000207 0.009684166 1980<br><br></span></div><div><span style="font-family:monospace">echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014  -d 9 --s_epoch 2000 --t_epoch 2030<br>40.000000555  -0.000000210 -0.003118609 1980</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014  -d 9 --t_epoch 2010<br>40.000000788  -0.000000207 0.009684166 1980<br><br></span></div><div><span style="font-family:monospace">echo 40 0 0 1980 | ./cs2cs ITRF90 ITRF2014  -d 9 --t_epoch 2030<br>40.000001256 -0.000000201 0.035289716 1980</span></div><div><br></div><div>The pipelines for some cases are</div><div><br></div><div>without setting --s_epoch or --t_epoch</div><div><span style="font-family:monospace">+proj=pipeline<br>  +step +proj=axisswap +order=2,1<br>  +step +proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m<br>  +step +proj=cart +ellps=GRS80<br>  +step +proj=helmert +x=-0.0254 +y=-0.0115 +z=0.0928 +rx=0 +ry=0 +rz=-0.00026<br>        +s=-0.00479 +dx=-0.0001 +dy=0.0005 +dz=0.0033 +drx=0 +dry=0 +drz=-2e-05<br>        +ds=-0.00012 +t_epoch=2010 +convention=position_vector<br>  +step +inv +proj=cart +ellps=GRS80<br>  +step +proj=unitconvert +xy_in=rad +z_in=m +xy_out=deg +z_out=m<br>  +step +proj=axisswap +order=2,1</span></div><div><br></div><div>setting --s_epoch to 2000</div><div><span style="font-family:monospace">+proj=pipeline<br>  +step +proj=set +v_4=2000<br>  +step +proj=axisswap +order=2,1<br>  +step +proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m<br>  +step +proj=cart +ellps=GRS80<br>  +step +proj=helmert +x=-0.0254 +y=-0.0115 +z=0.0928 +rx=0 +ry=0 +rz=-0.00026<br>        +s=-0.00479 +dx=-0.0001 +dy=0.0005 +dz=0.0033 +drx=0 +dry=0 +drz=-2e-05<br>        +ds=-0.00012 +t_epoch=2010 +convention=position_vector<br>  +step +inv +proj=cart +ellps=GRS80<br>  +step +proj=unitconvert +xy_in=rad +z_in=m +xy_out=deg +z_out=m<br>  +step +proj=axisswap +order=2,1<br>  +step +proj=set +v_4=2000</span></div><div><br></div><div>setting --t_epoch to 2030</div><div><span style="font-family:monospace">+proj=pipeline<br>  +step +proj=set +v_4=2030<br>  +step +proj=axisswap +order=2,1<br>  +step +proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m<br>  +step +proj=cart +ellps=GRS80<br>  +step +proj=helmert +x=-0.0254 +y=-0.0115 +z=0.0928 +rx=0 +ry=0 +rz=-0.00026<br>        +s=-0.00479 +dx=-0.0001 +dy=0.0005 +dz=0.0033 +drx=0 +dry=0 +drz=-2e-05<br>        +ds=-0.00012 +t_epoch=2010 +convention=position_vector<br>  +step +inv +proj=cart +ellps=GRS80<br>  +step +proj=unitconvert +xy_in=rad +z_in=m +xy_out=deg +z_out=m<br>  +step +proj=axisswap +order=2,1<br>  +step +proj=set +v_4=2030</span></div><div><br></div><div>setting --s_epoch to 2000 and --t_epoch to 2030</div><div><span style="font-family:monospace">+proj=pipeline<br>  +step +proj=set +v_4=2000<br>  +step +proj=axisswap +order=2,1<br>  +step +proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m<br>  +step +proj=cart +ellps=GRS80<br>  +step +proj=helmert +x=-0.0254 +y=-0.0115 +z=0.0928 +rx=0 +ry=0 +rz=-0.00026<br>        +s=-0.00479 +dx=-0.0001 +dy=0.0005 +dz=0.0033 +drx=0 +dry=0 +drz=-2e-05<br>        +ds=-0.00012 +t_epoch=2010 +convention=position_vector<br>  +step +inv +proj=cart +ellps=GRS80<br>  +step +proj=unitconvert +xy_in=rad +z_in=m +xy_out=deg +z_out=m<br>  +step +proj=axisswap +order=2,1<br>  +step +proj=set +v_4=2030</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:arial,sans-serif">PS </span><a href="https://jjimenezshaw.github.io/wasm-proj/transform.html">https://jjimenezshaw.github.io/wasm-proj/transform.html</a> is in this case probably showing better the output of the C function.</div></div>