OpenW # 1 FullW # 1 AutoRedraw = 1 FontSize = 10 ' GraphMode R2_BLACK, TRANSPARENT Global String zeile, txt, fmt, zahl, fnam(12), lnam(12), yes, a$, rsnam$ Global Int i, ii, j, k, l, m, n, n1, n2, nf, nz, i1, i2, np, ns, nseis, nprint Global Int x0, y0, bpix, hpix, llc, ulc, xl, xr, yo, yu, ndim, xa, ya, xn, yn Global Int nff, nfe, nfi, n3, np1, np2, nn, pixfac, ns1, xm, bb, hh, jx, jy Global Boolean absplot? ndim = 600000 Global Double x(ndim, 1), xx, y, yy, z, zz, dt, fz, breit, hoch, scal, sx, sy, rescal Global Double xymax, xmax, ymax, xfac, yfac, ym, xi, scalfac, avg, wl, ww, wt, wh 'Plotparameter-File einlesen Print If Exist("winplot.par") Open"winplot.par" for Input As # 7 Print " Reading parameter file winplot.par. Parameters:" Else Print " No parameter file winplot.par was found" Stop EndIf ' Input # 7, i1, nseis, breit, hoch, np1, np2, scal ' etwas umständlicher: prüfen ob altes oder neues PLOP-Format Line Input # 7, zeile i1 = Val(zeile) zeile = Mid$(zeile, Val?(zeile) + 2) nseis = Val(zeile) zeile = Mid$(zeile, Val?(zeile) + 2) breit = Val(zeile) zeile = Mid$(zeile, Val?(zeile) + 2) hoch = Val(zeile) zeile = Mid$(zeile, Val?(zeile) + 2) np1 = Val(zeile) zeile = Mid$(zeile, Val?(zeile) + 2) scal = Val(zeile) zeile = Mid$(zeile, Val?(zeile) + 2) If Val?(zeile) > 0 np2 = scal scal = Val(zeile) EndIf If np1 = 0 Then np1 = 1 EndIf If np2 = 0 Then np2 = ndim EndIf If np2 <= np1 Then Print " impossible time window - stop" Stop EndIf If nseis < 2 Print "two seismograms required" Stop EndIf Print " i1="; i1; "(=1: remove avg; =2: use full range for nonnegative data)" Print " nseis="; nseis; " width="; breit; " cm height="; hoch; " cm" ' determine screen size in pixels GetWinRect 1, wl, wt, ww, wh rescal = Min(ww / 1024, wh / 768) breit = breit * rescal hoch = hoch * rescal Print " plot rescaled to width="; Str$(breit, 4, 1); ", height="; Str$(hoch, 4, 1); " at 40 pixels per cm" Print " XYplot will use only the first two seismograms, irrespective of nseis" Print " samples from "; np1 ; " to max. "; np2; " scaling = "; scal; "" Print " Width=25 and height=16 are recommended for typical Laptop screens" Print " Filenames valid to first blank, rest is considered as comment" '##E# Print " A figure caption (one line) may be appended after the file names" Print Print " Files to be plotted:" For i = 1 To 2 Line Input # 7, lnam(i) l = InStr(lnam(i), " ") - 1 If l > 0 Then fnam(i) = Left(lnam(i), l) Else fnam(i) = lnam(i) EndIf If Exist(fnam(i)) Print " Data file "; i; "/"; nseis; ": "; fnam(i), " FOUND" Else Print " Data file "; i; "/"; nseis; ": "; fnam(i), " NOT FOUND" Stop EndIf Next i If Not EOF(# 7) Then Line Input # 7, txt EndIf Close # 7 n = ndim x0 = 20 y0 = 40 Print Print " Type to continue. When finished: type to exit." Input a$ Cls ' Plot vorbereiten bpix = breit * 40 hpix = 2 * Round(hoch * 20) hoch = hpix / 40 hh = hpix / 2 bb = bpix / 2 xl = x0 xr = x0 + bpix xm = (xl + xr) / 2 yu = y0 + hpix yo = yu - hpix ym = (yo + yu) / 2 'Schleife über Seismogramme For ns = 1 To 2 ns1 = ns - 1 Exit If Not Exist(fnam(ns)) 'Daten einlesen Open fnam(ns) for Input As # 7 Line Input # 7, zeile ' Print zeile ' Format entschlüsseln Repeat Line Input # 7, zeile Until Left(zeile) <> "%" ' Print zeile n = Min(n, ValInt(Left$(zeile, 10))) fmt = Mid$(zeile, 11, 20) nff = InStr(fmt, "f") nfe = InStr(fmt, "e") nfi = InStr(fmt, "i") nf = Max(nff, nfe, nfi) np2 = Min(np2, n) If np2 <= np1 Then Print " impossible time window - stop" Stop EndIf If nf > 0 Then n1 = ValInt(Mid$(fmt, nf - 1, 1)) n3 = ValInt(Mid$(fmt, nf - 2, 2)) n1 = Max(1, n1, n3) fz = Val(Mid$(fmt, nf + 1, 18 - nf)) n2 = Trunc(fz) Else Print "format not recognized" Stop EndIf dt = Val(Mid$(zeile, 31, 10)) ' Print "Formatkontrolle: "; n; "("; n1; "f"; n2; ". x "; "), dt="; dt For i = 1 To n x(i, ns1) = 0. Next i n = Min(n, np2) For i = 1 To n Step n1 Exit If EOF(# 7) Line Input # 7, zeile For k = 0 To n1 - 1 Exit If i + k > n zahl = Mid$(zeile, 1 + k * n2, n2) x(i + k, ns1) = Val(zahl) Next k Next i Close # 7 nn = np2 - np1 + 1 avg = 0. For i = 1 To nn x(i, ns1) = x(i + np1 - 1, ns1) avg = avg + x(i, ns1) Next i avg = avg / nn If i1 = 1 Then For i = 1 To nn x(i, ns1) = x(i, ns1) - avg Next i EndIf xymax = 0. For i = 1 To nn xymax = Max(xymax, Abs(x(i, ns1))) Next i xymax = Max(xymax, 1e-30) If scal > 0 Then scalfac = xymax / scal Else scalfac = Abs(scal) EndIf If ns = 1 xfac = bb / scalfac xmax = xymax sx = scalfac Else yfac = hh / scalfac ymax = xymax sy = scalfac EndIf Next ns jx = Max(0, 3 - Trunc(Log10(xmax))) jy = Max(0, 3 - Trunc(Log10(ymax))) Text xl + 8, yu - 24, "> " + lnam(1) + " Xmax=" + Str$(Round(xmax, jx)) + " F.S.=+-" + Str$(Round((sx), jx)) Text xl + 8, yo + 4, "^ " + lnam(2) + " Ymax=" + Str$(Round(ymax, jy)) + " F.S.=+-" + Str$(Round(sy, jy)) Line xl, yu, xr, yu Line xr, yu, xr, yo Line xr, yo, xl, yo Line xl, yo, xl, yu DefLine 2, 1 Line xl, ym, xr, ym Line xm, yo, xm, yu DefLine 0, 1 xa = Round(xm + Max(-bb, Min(bb, x(1, 0) * xfac))) ya = Round(ym - Max(-hh, Min(hh, x(1, 1) * yfac))) For i = 2 To nn xn = Round(xm + Max(-bb, Min(bb, x(i, 0) * xfac))) yn = Round(ym - Max(-hh, Min(hh, x(i, 1) * yfac))) Line xa, ya, xn, yn xa = xn ya = yn Next i Print i = Len(txt) While Right$(txt) = " " Dec i txt = Left$(txt, i) Wend Plot xl, yu + 30 Print " "; txt; Input " type to exit: "; a$ CloseW # 1 $DatFile $ExeName = C:\Dokumente und Einstellungen\Erhard\CALSOFT_08\XYplot.Exe $FileDescription = -<({[]})>- $Comments = Autor: E. Wielandt $CompanyName = Uni Stuttgart $LegalCopyright = © 2000 Uni Stuttgart $LanguageId = 0407 $FileVersion = %d.%d.%d.%d $ProductVersion = %d.%d.%d.%d $DatFile