! 3 Dec 05 JMH ! the individual runs/flight legs must be specified in chronological order $LOOP run {TrkTP_Lst} $INDEX i SysCmd 'echo processing {run} >con:' $IF {i} $EQ 1 $THEN $INCLUDE {CIncPath}Procs\DMY.inc $ENDIF $INCLUDE {CIncPath}Gets\GetTriPos.inc dams\{LFDate}\{AC}{LFDate}_{LFTime} {TFrom} {TTo} 0 {TPLstC} $INCLUDE {CIncPath}Procs\LTtime.inc tag = TPtag $IF {AMGorDIST} $EQ DIST $THEN $IF {i} $EQ 1 $THEN $IF {DISTRef} $EQ Start $THEN RefLat = Tlat[1] RefLon = Tlon[1] $ELSE RefLat = {RefLat} RefLon = {RefLon} $ENDIF $ENDIF $ENDIF $IF {PlotEveTrk} $EQ Y $OR {PlotEveAlt} $EQ Y $THEN ReadFile V60 E {DataPath}dams\{LFDate}\{AC}{LFDate}_{LFTime}.e Etag Event End Etag=Etag/1000 MatchEle eleind TPtag Etag SelS1(S2) ETPsec TPsec eleind SelS1(S2) ETalt Talt eleind SelS1(S2) ETlat Tlat eleind SelS1(S2) ETlon Tlon eleind $IF {AMGorDIST} $EQ AMG $THEN Zone = ETlat*0 + {AMGLonNo} LL2AMG Ex Ey Zone ETlat ETlon $ELSE Dist(lon) Ex ETlon RefLat RefLon Dist(lat) Ey ETlat RefLat RefLon $ENDIF Ex = Ex/1000. Ey = Ey/1000. ETalt = ETalt/1000. Report eleind Etag ETlon $LOOP ser ETalt ETPsec ETlat ETlon Ex Ey Etag Event {ser}{i} = {ser} Clear {ser} $ENDLOOP $ENDIF minLat = min(Tlat) maxLat = max(Tlat) minLon = min(Tlon) maxLon = max(Tlon) Report minLat maxLat minLon maxLon $IF {AMGorDIST} $EQ AMG $THEN Zone = Tlat*0 + {AMGLonNo} LL2AMG x y zone Tlat Tlon $ELSE Dist(lon) x Tlon RefLat RefLon Dist(lat) y Tlat RefLat RefLon $ENDIF x = x/1000. y = y/1000. Talt = Talt/1000. $IF {i} $EQ 1 $THEN LTdateS = LTdate[1] LTtimeS = LTtime[1] $ENDIF $LOOP ser TPsec Tlat Tlon Talt x y tag LTtime {ser}{i} = {ser} ! Clear {ser} $ENDLOOP $ENDLOOP $LOOP run {TrkTP_Lst} $INDEX i $IF {i} $NE 1 $THEN $LOOP ser TPsec Tlat Tlon Talt x y tag LTtime Join * {ser} {ser}{i} $ENDLOOP $IF {PlotEveTrk} $EQ Y $OR {PlotEveAlt} $EQ Y $THEN $LOOP ser ETalt ETPsec ETlat ETlon Ex Ey Etag Event Join * {ser} {ser}{i} $ENDLOOP $ENDIF $ENDIF $ENDLOOP $IF {TimeMarkAlt} $EQ Y $OR {TimeMarkTrk} $EQ Y $THEN $LOOP run {TrkTP_Lst} !--- join series $INDEX i t = LTtime{i} sec(hhmmsshh) * t hhmmsshh(sec) hhmmsshh t 0 ! *** find samples for plotting of time strings ! *** find exact minutes tmin = int(min(t)) tmax = int(max(t)) CreateLd mins {MarkSeq} tmin tmax MatchEle indMn{i} t mins ! mint = hhmmsshh/100 Clear mins ! *** find samples for plotting of time ticks ! *** find exact seconds ! sec{i} = t tmin = int(min(t)) tmax = int(max(t)) CreateLd secs {MarkSeq} tmin tmax MatchEle indTk{i} t secs Clear secs HMS{i} = hhmmsshh/100 Clear hhmmsshh $ENDLOOP $ENDIF ! *** scaling for track plot z = Talt t = TPsec $LOOP n x y z t {n}min = min({n}) {n}max = max({n}) $IF {n} $IN xy $THEN {n}min = {n}min - {MarginTrk} {n}max = {n}max + {MarginTrk} $ENDIF $IF {n} $EQ z $THEN {n}min = {n}min - {MarginAlt} {n}max = {n}max + {MarginAlt} $ENDIF $IF {n} $EQ t $THEN {n}min = {n}min - {MarginSec} {n}max = {n}max + {MarginSec} $ENDIF Report {n}min {n}max $ENDLOOP $IF {Coast} $EQ Y $THEN ReadFile B1 {MapFile} clat * * * 8 Series lon clon End $IF {AMGorDIST} $EQ AMG $THEN zone = clat*0 + {AMGLonNo} LL2AMG xcoast ycoast zone clat clon $ELSE Dist(lon) xcoast clon RefLat RefLon Dist(lat) ycoast clat RefLat RefLon $ENDIF xcoast = xcoast/1000. ycoast = ycoast/1000. $ENDIF xratio = 1 yratio = (ymax-ymin)/(xmax-xmin) LTdateE = LTdate[] LTtimeE = LTtime[] $IF {TrkPlot} $EQ Y $THEN set PSfile {PltBaseNameTrk}{TrkTP_PltExt}.ps PLOT IF (xmax-xmin) GT (ymax-ymin) THEN Size A4H ELSE Size A4V ENDIF NewRow 1 Logo off $IF {AMGorDIST} $EQ AMG $USE ... Graph * * 'Easting in km' 'Northing in km' 3 * * ... $ELSE Graph * * 'km' 'km' 3 * * Title left ' {PltTitle} VH-{AC} {LongDate{MMDD}} ~LTtimeS:HMS~-~LTtimeE:HMS~LT' 4.0 * * Grid 1 Big * * * Grid 2 Big * * * AxisRange 1 xmin xmax AxisRange 2 ymin ymax AxisNumbers 1 Big * * 3.0 * * * * AxisNumbers 2 Big * Rot90 3.0 * * * * AspectRatio xratio yratio $LOOP run {TrkTP_Lst} $INDEX i Curve x{i} y{i} 0.2 {DotOrLine} * red * $IF {TimeMarkTrk} $EQ Y $USE Marks Numbers x{i} y{i} indMn{i} {SideTime} LTtime * HM * blue $IF {TagMarkTrk} $EQ Y $USE Marks Numbers x{i} y{i} {each} {SideTag} tag * I 2 blue $IF {AltMarkTrk} $EQ Y $USE Marks Numbers x{i} y{i} indMn{i} {SideAlt} Talt * F6.3 * green $IF {PlotEveTrk} $EQ Y $USE Marks Numbers Ex Ey * centre Event 0 A 3 black $ENDLOOP $IF {Coast} $EQ Y $THEN Curve xcoast ycoast LineStyle Lines 0.2 {CoastCol} * $ENDIF $IF {PlotLM} $EQ Y $THEN $INCLUDE '..\cfg\{LMFile}' $ENDIF END IF (xmax-xmin) GT (ymax-ymin) THEN SysCmd 'ps2pdf -g{A4H} {PltBaseNameTrk}{TrkTP_PltExt}.ps {PltBaseNameTrk}{TrkTP_PltExt}.pdf >con' ELSE SysCmd 'ps2pdf -g{A4V} {PltBaseNameTrk}{TrkTP_PltExt}.ps {PltBaseNameTrk}{TrkTP_PltExt}.pdf >con' ENDIF SysCmd 'del {PltBaseNameTrk}{TrkTP_PltExt}.ps' $ENDIF $IF {AltPlot} $EQ Y $THEN TaltSm = Talt FILTER FilterType NOAA Pass Low 0.001 DataInt 1 Select TaltSm END set PSfile {PltBaseNameAlt}{TrkTP_PltExt}.ps PLOT Size A4H NewRow 1 Logo off Graph * * 'GPS time in sec' 'GPS altitude in km' 3 * * Title left ' {PltTitle} VH-{AC} {LongDate{MMDD}} ~LTtimeS:HMS~-~LTtimeE:HMS~LT' 4.0 * * AxisRange 1 tmin tmax AxisRange 2 zmin zmax Grid 1 Big * * * Grid 2 Big * * * AxisNumbers 1 Big * * 3.0 * * I AxisNumbers 2 Big * Rot90 3.0 * * @:F7.3 AxisNumbers 3 big left * * * * @:SHMS AxisLabel 3 * * 'UTC' AxisNumbers 4 big right rot90 3.0 * * @/0.3048:F7.3 AxisLabel 4 right * 'GPS altitude in kft' $LOOP run {TrkTP_Lst} $INDEX i Curve TPsec{i} Talt{i} * {DotOrLine} * red * $IF {TimeMarkAlt} $EQ Y $USE Marks Numbers TPsec{i} TaltSm{i} indMn{i} left LTtime * +HM * blue $IF {TagMarkAlt} $EQ Y $USE Marks Numbers TPsec{i} TaltSm{i} {each} right tag * +I 2 blue $IF {PlotEveAlt} $EQ Y $USE Marks Numbers ETPsec ETalt-{MarginAlt}/2 * centre Event 0 A 4 black $ENDLOOP END $IF {GenOEtrack} $EQ Y $THEN $LOOP ser Tlat Tlon Talt Slower * {ser} {OEslower} $ENDLOOP PRINT NoPrt ToFile ascii {PltBaseNameTrk}{TrkTP_PltExt}.plt overwrite ',' Title 'Oziexplorer Track Point File Version 2.1' left Series Tlat F12.7 Tlat 13 Series Tlon F12.7 Tlon 13 Series Talt*3280.00 F9.2 Talt 10 END $ENDIF SysCmd 'echo converting ps to pdf >con' SysCmd 'ps2pdf -g{A4H} {PltBaseNameAlt}{TrkTP_PltExt}.ps {PltBaseNameAlt}{TrkTP_PltExt}.pdf >con' SysCmd 'del {PltBaseNameAlt}{TrkTP_PltExt}.ps' $ENDIF