! 26 Sep 05 JMH ! the individual runs/flight legs must be specified in chronological order $LOOP run {Trk_Lst} $INDEX i SysCmd 'echo processing {run} >con:' $IF {i} $EQ 1 $THEN $INCLUDE {CIncPath}Procs\DMY.inc $ENDIF $INCLUDE {CIncPath}Gets\GetNovPosB1.inc proc2\{AC}_{CubeF}_{Date}_{FLT} {GFrom} {GTo} {Nseq} {NPLst} $INCLUDE {CIncPath}Procs\LTtime.inc tag = NPsec $IF {AMGorDIST} $EQ DIST $THEN $IF {i} $EQ 1 $THEN $IF {DISTref} $EQ Start $THEN RefLat = Nlat[1] RefLon = Nlon[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 NPtag Etag SelS1(S2) ENsec Nsec eleind SelS1(S2) ENalt Nalt eleind SelS1(S2) ENlat Nlat eleind SelS1(S2) ENlon Nlon eleind $IF {AMGorDIST} $EQ AMG $THEN Zone = ENlat*0 + {AMGLonNo} LL2AMG Ex Ey Zone ENlat ENlon $ELSE Dist(lon) Ex ENlon RefLat RefLon Dist(lat) Ey ENlat RefLat RefLon $ENDIF Ex = Ex/1000. Ey = Ey/1000. ENalt = ENalt/1000. Report eleind Etag ENlon $IF {run} $EQ 990811_1150 $THEN nele = nele(ENalt) $LOOP ser ENalt ENsec ENlat ENlon Ex Ey Etag Event Select * {ser} 1 nele-1 1 $ENDLOOP $ENDIF $LOOP ser ENalt ENsec ENlat ENlon Ex Ey Etag Event {ser}{i} = {ser} Clear {ser} $ENDLOOP $ENDIF minLat = min(Nlat) maxLat = max(Nlat) minLon = min(Nlon) maxLon = max(Nlon) Report minLat maxLat minLon maxLon $IF {AMGorDIST} $EQ AMG $THEN Zone = Nlat*0 + {AMGLonNo} LL2AMG x y zone Nlat Nlon $ELSE Dist(lon) x Nlon RefLat RefLon Dist(lat) y Nlat RefLat RefLon $ENDIF x = x/1000. y = y/1000. Nalt = Nalt/1000. $IF {i} $EQ 1 $THEN LTdateS = LTdate[1] LTtimeS = LTtime[1] UTCdateS = UTCdate[1] UTCtimeS = UTCtime[1] $ENDIF $LOOP ser Nsec Nlat Nlon Nalt x y tag LTtime LTdate UTCtime UTCdate {ser}{i} = {ser} Clear {ser} $ENDLOOP $ENDLOOP $LOOP run {Trk_Lst} $INDEX i $LOOP ser Nsec Nlat Nlon Nalt x y tag LTtime LTdate UTCtime UTCdate Join * {ser} {ser}{i} $ENDLOOP $IF {PlotEveTrk} $EQ Y $OR {PlotEveAlt} $EQ Y $THEN $LOOP ser ENalt ENsec ENlat ENlon Ex Ey Etag Event Join * {ser} {ser}{i} $ENDLOOP $ENDIF $ENDLOOP $IF {TimeMarkAlt} $EQ Y $OR {TimeMarkTrk} $EQ Y $THEN $LOOP run {Trk_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 = Nalt t = Nsec $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 {PlotOL} $EQ Y $THEN ! $INCLUDE '..\cfg\{OLFile}' lonOL = [139.5159667,139.5243,139.5399667,139.531333,139.5159667] latOL = [-35.8927667,-35.9062,-35.8978833,-35.886033,-35.8927667] Dist(lon) xOL lonOL RefLat RefLon Dist(lat) yOL latOL RefLat RefLon xOL = xOL/1000 yOL = yOL/1000 xminOL = min(xOL) xmaxOL = max(xOL) yminOL = min(yOL) ymaxOL = max(yOL) xmin = min([xmin,xminOL]) xmax = max([xmax,xmaxOL]) ymin = min([ymin,yminOL]) ymax = max([ymax,ymaxOL]) $ENDIF $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}{Trk_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 {Trk_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} Nalt * 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 $IF {PlotOL} $EQ Y $THEN Curve xOL yOL 0.2 Line * green * $ENDIF END IF (xmax-xmin) GT (ymax-ymin) THEN SysCmd 'ps2pdf -g{A4H} {PltBaseNameTrk}{Trk_PltExt}.ps {PltBaseNameTrk}{Trk_PltExt}.pdf >con' ELSE SysCmd 'ps2pdf -g{A4V} {PltBaseNameTrk}{Trk_PltExt}.ps {PltBaseNameTrk}{Trk_PltExt}.pdf >con' ENDIF SysCmd 'del {PltBaseNameTrk}{Trk_PltExt}.ps' $ENDIF $IF {AltPlot} $EQ Y $THEN NaltSm = Nalt FILTER FilterType NOAA Pass Low 0.001 DataInt 1 Select NaltSm END set PSfile {PltBaseNameAlt}{Trk_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 {Trk_Lst} $INDEX i Curve Nsec{i} Nalt{i} * {DotOrLine} * red * $IF {TimeMarkAlt} $EQ Y $USE Marks Numbers Nsec{i} NaltSm indMn{i} left LTtime * +HM * blue $IF {TagMarkAlt} $EQ Y $USE Marks Numbers Nsec{i} NaltSm {each} right tag * +I 2 blue $IF {PlotEveAlt} $EQ Y $USE Marks Numbers ENsec ENalt-{MarginAlt}/2 * centre Event 0 A 4 black $ENDLOOP END $IF {GenOEtrack} $EQ Y $THEN DecDaysSince DecDays UTCdate UTCtime 010100 DecDays = DecDays + 36500 + 8 + 18 $LOOP ser Nlat Nlon Nalt DecDays Slower * {ser} {OEslower} $ENDLOOP null = Nlat*0 PRINT NoPrt ToFile ascii {PltBaseNameTrk}{Trk_PltExt}.plt overwrite ',' Title 'Oziexplorer Track Point File Version 2.1' left Series Nlat F12.7 Nlat 13 Series Nlon F12.7 Nlon 13 Series Nalt*3280.00 F9.2 Nalt 10 Series null F3.0 null 3 Series DecDays F20.7 DecDays 20 END $ENDIF SysCmd 'echo converting ps to pdf >con' SysCmd 'ps2pdf -g{A4H} {PltBaseNameAlt}{Trk_PltExt}.ps {PltBaseNameAlt}{Trk_PltExt}.pdf >con' SysCmd 'del {PltBaseNameAlt}{Trk_PltExt}.ps' $ENDIF