summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2014-09-24 13:18:51 +0200
committerErich Eckner <git@eckner.net>2014-09-24 13:18:51 +0200
commitb6bfd64c48c34334c58be8db33a0f8a4626a4d27 (patch)
treed956feb2543da820b6b90a007845feb01d8bd213
parent66f368947bcbc2ff8104d382dab78229ca35de13 (diff)
downloadROM-b6bfd64c48c34334c58be8db33a0f8a4626a4d27.tar.xz
reflektierter Puls wird nun korrekt berechnet;
von Kommandozeilenparametern auf Paramterdatei umgestellt
-rw-r--r--.gitignore1
-rw-r--r--Bild.pdfbin39941 -> 212047 bytes
-rw-r--r--ROM.lpr219
-rw-r--r--ROM.lps102
-rw-r--r--input.rom17
-rw-r--r--make.gnu11
-rw-r--r--romunit.pas35
7 files changed, 258 insertions, 127 deletions
diff --git a/.gitignore b/.gitignore
index 92b4f6f..b58c5df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
*.zip
*.tar.gz
*.dat
+*.dat.ori
Ergebnisse
lib
ROM
diff --git a/Bild.pdf b/Bild.pdf
index ae01189..5c1ac05 100644
--- a/Bild.pdf
+++ b/Bild.pdf
Binary files differ
diff --git a/ROM.lpr b/ROM.lpr
index 26aebb3..1249b26 100644
--- a/ROM.lpr
+++ b/ROM.lpr
@@ -12,91 +12,193 @@ uses
{ you can add units after this },
SysUtils,ROMunit, mathunit, Math;
-var inPulsO,inPuls,refPuls,surTraj,cRefPuls: tExtPointArray;
- i,smooth: longint;
- tmax,wmax,absShift: extended;
- force,fourier: boolean;
+var inPulsO,inPuls,refPulsO,refPuls,surTraj,cRefPuls: tExtPointArray;
+ smooth,betaSmooth: longint;
+ tmax,wmax,absShift,betaBound: extended;
+ force,fourier: boolean;
+ f: textfile;
+ s,lpicIn,rohIn,rohRef,outIn,outRef,outRefC,outSur: string;
-const Verwendung='Verwendung: ROM ($Einfallspuls_Datei $Ausfallspuls_Datei)/(- $trace-Datei-Prefix) $output_inPuls $output_refPuls $output_Trajektorie $output_cRefPuls '+
- '[-s/--smooth $n] [-f/--force] [-t/--tmax $t] [-w/--wmax $w] [-F/--FFT] [-d/--dt $dt]';
+//const Verwendung='Verwendung: ROM ($Einfallspuls_Datei $Ausfallspuls_Datei)/(- $trace-Datei-Prefix) $output_inPuls $output_refPuls $output_Trajektorie $output_cRefPuls '+
+// '[-s/--smooth $n] [-f/--force] [-t/--tmax $t] [-w/--wmax $w] [-F/--FFT] [-d/--dt $dt]';
+const Verwendung='Verwendung: ROM $Parameterdatei';
begin
- if paramcount<6 then Fehler(Verwendung);
- i:=7;
+ if (paramcount<>1) or not fileexists(paramstr(1)) then Fehler(Verwendung);
+
force:=false;
smooth:=1;
+ betaSmooth:=1;
tmax:=-1;
wmax:=-1;
- fourier:=false;
absShift:=-1e9;
- while i<=paramcount do begin
- if (paramstr(i)='--force') or (paramstr(i)='-f') then begin
+ betaBound:=0.95;
+ fourier:=false;
+
+ lpicIn:='';
+ rohIn:='';
+ rohRef:='';
+ outIn:='';
+ outRef:='';
+ outRefC:='';
+ outSur:='';
+
+ assignfile(f,paramstr(1));
+ reset(f);
+ while not eof(f) do begin
+ readln(f,s);
+ if pos('#',s)>0 then
+ delete(s,pos('#',s),length(s));
+ s:=trim(s);
+ if s='' then continue;
+ if s='mit Gewalt' then begin
force:=true;
- inc(i);
continue;
end;
- if (paramstr(i)='--smooth') or (paramstr(i)='-s') then begin
- inc(i);
- smooth:=strtoint(paramstr(i));
- inc(i);
+ if s='ohne Gewalt' then begin
+ force:=false;
continue;
end;
- if (paramstr(i)='--tmax') or (paramstr(i)='-t') then begin
- inc(i);
- tmax:=strtofloat(paramstr(i));
- inc(i);
+ if pos('Glätte:',s)=1 then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ smooth:=strtoint(s);
continue;
end;
- if (paramstr(i)='--wmax') or (paramstr(i)='-w') then begin
- inc(i);
- wmax:=strtofloat(paramstr(i));
- fourier:=true;
- inc(i);
+ if pos('Betaglätte:',s)=1 then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ betaSmooth:=strtoint(s);
+ continue;
+ end;
+ if pos('Maximalgeschwindigkeit:',s)=1 then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ betaBound:=strtofloat(s);
+ continue;
+ end;
+ if pos('tmax:',s)=1 then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ tmax:=strtofloat(s);
+ continue;
+ end;
+ if (pos('wmax:',s)=1) or (pos('ωmax:',s)=1) then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ wmax:=strtofloat(s);
continue;
end;
- if (paramstr(i)='--dt') or (paramstr(i)='-d') then begin
- inc(i);
- if paramstr(i)='auto' then begin
+ if (pos('Absolutverschiebung:',s)=1) then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ if s='auto' then begin
absShift:=-1e9;
- inc(i);
continue;
end;
- if paramstr(i)='input' then begin
- if paramstr(1)<>'-' then Fehler('Ich brauche zur Bestimmung der Gesamtverschiebung die Inputdatei vom LPIC!');
+ if s='input' then begin
absShift:=-2e9;
- inc(i);
continue;
end;
- absShift:=strtofloat(paramstr(i));
- inc(i);
+ absShift:=strtofloat(s);
continue;
end;
- if (paramstr(i)='--FFT') or (paramstr(i)='-F') then begin
+ if s='mit FFT' then begin
fourier:=true;
- inc(i);
continue;
end;
- Fehler(Verwendung);
+ if s='ohne FFT' then begin
+ fourier:=false;
+ continue;
+ end;
+ if pos('lpic-Quelle:',s)=1 then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ lpicIn:=s;
+ continue;
+ end;
+ if pos('in-Quelle:',s)=1 then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ rohIn:=s;
+ continue;
+ end;
+ if pos('reflex-Quelle:',s)=1 then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ rohRef:=s;
+ continue;
+ end;
+ if pos('in-Ziel:',s)=1 then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ outIn:=s;
+ continue;
+ end;
+ if pos('reflex-Ziel:',s)=1 then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ outRef:=s;
+ continue;
+ end;
+ if pos('reflex-Approx-Ziel:',s)=1 then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ outRefC:=s;
+ continue;
+ end;
+ if pos('trajektorie-Ziel:',s)=1 then begin
+ delete(s,1,pos(':',s));
+ s:=trim(s);
+ outSur:=s;
+ continue;
+ end;
+ Fehler('Unbekannter Parameter '''+s+''' in Inputdatei '''+paramstr(1)+'''!');
end;
- if paramstr(1)='-' then
- readRawInputs(paramstr(2),inPulsO,refPuls,absShift)
+ closefile(f);
+
+ if (absShift<-1.5e9) and (lpicIn='') then
+ Fehler('Ich brauche zur Bestimmung der Gesamtverschiebung die Inputdatei vom LPIC!');
+
+ if (lpicIn<>'') and
+ ((rohIn<>'') or
+ (rohRef<>'')) then
+ Fehler('lpic-Quelle und rohe Input-/Reflex-Quelle können nicht gleichzeitig angegeben werden!');
+ if ((rohIn<>'') xor
+ (rohRef<>'')) then
+ Fehler('Ich brauche den rohen Input- und Reflex-Puls, oder aber nur die lpic-Quelle!');
+ if (not force) and (outIn<>'') and fileexists(outIn+'.ori') then
+ Fehler('Die Ausgabedatei '''+outIn+'.ori'' existiert bereits!');
+ if (not force) and (outIn<>'') and fileexists(outIn) then
+ Fehler('Die Ausgabedatei '''+outIn+''' existiert bereits!');
+ if (not force) and (outRef<>'') and fileexists(outRef+'.ori') then
+ Fehler('Die Ausgabedatei '''+outRef+'.ori'' existiert bereits!');
+ if (not force) and (outRef<>'') and fileexists(outRef) then
+ Fehler('Die Ausgabedatei '''+outRef+''' existiert bereits!');
+ if (not force) and (outRefC<>'') and fileexists(outRefC) then
+ Fehler('Die Ausgabedatei '''+outRefC+''' existiert bereits!');
+ if (not force) and (outSur<>'') and fileexists(outSur) then
+ Fehler('Die Ausgabedatei '''+outSur+''' existiert bereits!');
+
+ if lpicIn<>'' then
+ readRawInputs(lpicIn,inPulsO,refPulsO,absShift)
else begin
- readTextInput(paramstr(1),inPulsO);
- readTextInput(paramstr(2),refPuls);
+ readTextInput(rohIn,inPulsO);
+ readTextInput(rohRef,refPulsO);
end;
write(stderr,'Input sortieren ...');
sort(inPulsO);
- sort(refPuls);
+ sort(refPulsO);
writeln(stderr,' fertig');
uniq(inPulsO,false);
- uniq(refPuls,false);
+ uniq(refPulsO,false);
write(stderr,'Input interpolieren ...');
interpoliere(inPulsO);
- interpoliere(refPuls);
+ interpoliere(refPulsO);
writeln(stderr,' fertig');
- flip(refPuls);
+ flip(refPulsO);
integrate(inPulsO,inPuls);
- integrate(refPuls);
+ integrate(refPulsO,refPuls);
removeLinearOffset(inPuls);
removeLinearOffset(refPuls);
if smooth>1 then begin
@@ -107,8 +209,6 @@ begin
end;
cut(inPuls,tmax);
cut(refPuls,tmax);
- for i:=3 to 5 do
- if (paramstr(i)<>'-') and fileexists(paramstr(i)) and not force then Fehler('Die Ausgabedatei '''+paramstr(i)+''' existiert bereits!');
gesamtverschiebung(inPuls,refPuls,absShift);
write(stderr,'Trajektorie berechnen ...');
berechneTrajektorie(inPuls,refPuls,surTraj,absShift*byte(not fourier));
@@ -117,6 +217,9 @@ begin
sort(surTraj);
writeln(stderr,' fertig');
uniq(surTraj,false);
+ write(stderr,'Reflektierten Puls berechnen ...');
+ berechneRefPuls(inPulsO,surTraj,betaSmooth,betaBound,cRefPuls);
+ writeln(stderr,' fertig');
if fourier then begin
write(stderr,'Ergebnis interpolieren ...');
interpoliere(surTraj);
@@ -142,16 +245,16 @@ begin
normiere(refPuls);
normiere(surTraj);
writeln(stderr,' fertig');
- end
- else begin
- write(stderr,'Reflektierten Puls berechnen ...');
- berechneRefPuls(inPulsO,surTraj,cRefPuls);
- integrate(cRefPuls);
- writeln(stderr,' fertig');
end;
- if paramstr(3)<>'-' then writeOutput(paramstr(3),inPuls);
- if paramstr(4)<>'-' then writeOutput(paramstr(4),refPuls);
- if paramstr(5)<>'-' then writeOutput(paramstr(5),surTraj);
- if (paramstr(6)<>'-') and not fourier then writeOutput(paramstr(6),cRefPuls);
+ if outIn<>'' then begin
+ writeOutput(outIn+'.ori',inPulsO);
+ writeOutput(outIn,inPuls);
+ end;
+ if outRef<>'' then begin
+ writeOutput(outRef+'.ori',refPulsO);
+ writeOutput(outRef,refPuls);
+ end;
+ if outSur<>'' then writeOutput(outSur,surTraj);
+ if outRefC<>'' then writeOutput(outRefC,cRefPuls);
end.
diff --git a/ROM.lps b/ROM.lps
index 99565a0..089957b 100644
--- a/ROM.lps
+++ b/ROM.lps
@@ -8,24 +8,24 @@
<Filename Value="ROM.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ROM"/>
+ <IsVisibleTab Value="True"/>
<EditorIndex Value="0"/>
<WindowIndex Value="0"/>
- <TopLine Value="114"/>
- <CursorPos X="25" Y="149"/>
- <UsageCount Value="91"/>
+ <TopLine Value="73"/>
+ <CursorPos X="28" Y="77"/>
+ <UsageCount Value="94"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="romunit.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="romunit"/>
- <IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
- <TopLine Value="974"/>
- <CursorPos X="11" Y="1001"/>
+ <TopLine Value="628"/>
+ <CursorPos X="133" Y="1005"/>
<FoldState Value=" T3iC041 pkRkZ0Y2]9clZ093 piXj70G]Rj3jN0w6]9UlG0S[I4Ck10P116k"/>
- <UsageCount Value="91"/>
+ <UsageCount Value="94"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
@@ -36,7 +36,7 @@
<WindowIndex Value="0"/>
<TopLine Value="3"/>
<CursorPos X="1" Y="43"/>
- <UsageCount Value="90"/>
+ <UsageCount Value="93"/>
<Loaded Value="True"/>
</Unit2>
</Units>
@@ -46,123 +46,123 @@
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="romunit.pas"/>
- <Caret Line="26" Column="95" TopLine="1"/>
+ <Caret Line="724" Column="24" TopLine="688"/>
</Position1>
<Position2>
<Filename Value="romunit.pas"/>
- <Caret Line="727" Column="6" TopLine="694"/>
+ <Caret Line="33" Column="1" TopLine="22"/>
</Position2>
<Position3>
<Filename Value="romunit.pas"/>
- <Caret Line="26" Column="1" TopLine="1"/>
+ <Caret Line="1099" Column="1" TopLine="1057"/>
</Position3>
<Position4>
<Filename Value="romunit.pas"/>
- <Caret Line="334" Column="31" TopLine="328"/>
+ <Caret Line="1001" Column="69" TopLine="946"/>
</Position4>
<Position5>
<Filename Value="romunit.pas"/>
- <Caret Line="311" Column="41" TopLine="288"/>
+ <Caret Line="987" Column="11" TopLine="947"/>
</Position5>
<Position6>
<Filename Value="romunit.pas"/>
- <Caret Line="310" Column="3" TopLine="291"/>
+ <Caret Line="32" Column="33" TopLine="22"/>
</Position6>
<Position7>
<Filename Value="romunit.pas"/>
- <Caret Line="22" Column="1" TopLine="16"/>
+ <Caret Line="992" Column="42" TopLine="947"/>
</Position7>
<Position8>
<Filename Value="romunit.pas"/>
- <Caret Line="1018" Column="1" TopLine="891"/>
+ <Caret Line="1003" Column="53" TopLine="973"/>
</Position8>
<Position9>
<Filename Value="romunit.pas"/>
- <Caret Line="669" Column="16" TopLine="625"/>
+ <Caret Line="1001" Column="79" TopLine="719"/>
</Position9>
<Position10>
- <Filename Value="romunit.pas"/>
- <Caret Line="621" Column="38" TopLine="527"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="20" Column="55" TopLine="10"/>
</Position10>
<Position11>
- <Filename Value="romunit.pas"/>
- <Caret Line="312" Column="1" TopLine="295"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="24" Column="52" TopLine="5"/>
</Position11>
<Position12>
- <Filename Value="romunit.pas"/>
- <Caret Line="657" Column="15" TopLine="626"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="20" Column="24" TopLine="12"/>
</Position12>
<Position13>
- <Filename Value="romunit.pas"/>
- <Caret Line="655" Column="16" TopLine="637"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="38" Column="14" TopLine="24"/>
</Position13>
<Position14>
- <Filename Value="romunit.pas"/>
- <Caret Line="285" Column="9" TopLine="254"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="163" Column="40" TopLine="121"/>
</Position14>
<Position15>
- <Filename Value="romunit.pas"/>
- <Caret Line="312" Column="49" TopLine="301"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="206" Column="1" TopLine="191"/>
</Position15>
<Position16>
- <Filename Value="romunit.pas"/>
- <Caret Line="21" Column="69" TopLine="1"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="20" Column="56" TopLine="1"/>
</Position16>
<Position17>
<Filename Value="ROM.lpr"/>
- <Caret Line="84" Column="38" TopLine="15"/>
+ <Caret Line="196" Column="45" TopLine="175"/>
</Position17>
<Position18>
<Filename Value="ROM.lpr"/>
- <Caret Line="98" Column="3" TopLine="23"/>
+ <Caret Line="199" Column="15" TopLine="178"/>
</Position18>
<Position19>
- <Filename Value="romunit.pas"/>
- <Caret Line="25" Column="1" TopLine="6"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="201" Column="15" TopLine="180"/>
</Position19>
<Position20>
- <Filename Value="romunit.pas"/>
- <Caret Line="726" Column="60" TopLine="285"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="203" Column="34" TopLine="182"/>
</Position20>
<Position21>
<Filename Value="ROM.lpr"/>
- <Caret Line="98" Column="3" TopLine="77"/>
+ <Caret Line="208" Column="18" TopLine="187"/>
</Position21>
<Position22>
- <Filename Value="romunit.pas"/>
- <Caret Line="724" Column="24" TopLine="688"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="157" Column="45" TopLine="127"/>
</Position22>
<Position23>
<Filename Value="romunit.pas"/>
- <Caret Line="33" Column="1" TopLine="22"/>
+ <Caret Line="1005" Column="6" TopLine="816"/>
</Position23>
<Position24>
<Filename Value="romunit.pas"/>
- <Caret Line="1099" Column="1" TopLine="1057"/>
+ <Caret Line="990" Column="1" TopLine="974"/>
</Position24>
<Position25>
<Filename Value="romunit.pas"/>
- <Caret Line="1001" Column="69" TopLine="946"/>
+ <Caret Line="994" Column="45" TopLine="973"/>
</Position25>
<Position26>
<Filename Value="romunit.pas"/>
- <Caret Line="987" Column="11" TopLine="947"/>
+ <Caret Line="1003" Column="86" TopLine="974"/>
</Position26>
<Position27>
- <Filename Value="romunit.pas"/>
- <Caret Line="32" Column="33" TopLine="22"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="208" Column="1" TopLine="204"/>
</Position27>
<Position28>
- <Filename Value="romunit.pas"/>
- <Caret Line="992" Column="42" TopLine="947"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="207" Column="47" TopLine="186"/>
</Position28>
<Position29>
- <Filename Value="romunit.pas"/>
- <Caret Line="1003" Column="53" TopLine="973"/>
+ <Filename Value="ROM.lpr"/>
+ <Caret Line="70" Column="7" TopLine="28"/>
</Position29>
<Position30>
<Filename Value="romunit.pas"/>
- <Caret Line="1001" Column="79" TopLine="719"/>
+ <Caret Line="987" Column="101" TopLine="520"/>
</Position30>
</JumpHistory>
</ProjectSession>
diff --git a/input.rom b/input.rom
new file mode 100644
index 0000000..244fe92
--- /dev/null
+++ b/input.rom
@@ -0,0 +1,17 @@
+
+mit Gewalt
+
+Glätte: 10 # über 10 Punkte interpolieren
+#Absolutverschiebung: input # absolute Verschiebung anhand der input.lpi ermitteln
+Absolutverschiebung: 10 # absolute Verschiebung fest vorgeben
+ohne FFT
+lpic-Quelle: /home_raid/erich/Dokumente/Paper/eROM/Daten/lpic_roh/data_eROM_paper_2/output.lpi
+
+Betaglätte: 100 # Breite, über die zur Ermittlung von beta geschaut wird
+Maximalgeschwindigkeit: 0.95
+
+in-Ziel: /home_raid/erich/Dokumente/Prograemmchen/ROM/input.dat
+reflex-Ziel: /home_raid/erich/Dokumente/Prograemmchen/ROM/output.dat
+reflex-Approx-Ziel: /home_raid/erich/Dokumente/Prograemmchen/ROM/outputC.dat
+trajektorie-Ziel: /home_raid/erich/Dokumente/Prograemmchen/ROM/trajektorie.dat
+
diff --git a/make.gnu b/make.gnu
index f3736e2..55671c0 100644
--- a/make.gnu
+++ b/make.gnu
@@ -15,13 +15,20 @@ if (system("echo $logscale")=="1") {
}
else {
set xlabel "t in T"
+ set xrange [10:65]
}
# set ylabel sprintf("$\\left|\\Big(\\mathcal{FT}\\left(%s\\right)\\Big)(\\omega)\\right|$ in $%s$",groesze,einheit)
# set xtics out
# set ytics 10**-2 out
+#plot "~/Dokumente/Prograemmchen/ROM/surface.dat" using 1:2 with lines lt 1 title "surface", \
+# "~/Dokumente/Prograemmchen/ROM/input.dat.ori" using 1:2 with lines lt 2 title "inputO", \
+# "~/Dokumente/Prograemmchen/ROM/input.dat" using 1:2 with lines lt 3 title "input", \
+# "~/Dokumente/Prograemmchen/ROM/output.dat.ori" using 1:2 with lines lt 4 title "outputO", \
+# "~/Dokumente/Prograemmchen/ROM/output.dat" using 1:2 with lines lt 5 title "output", \
+# "~/Dokumente/Prograemmchen/ROM/outputC.dat" using 1:2 with lines lt 6 title "output reconstructed"
plot "~/Dokumente/Prograemmchen/ROM/surface.dat" using 1:2 with lines lt 1 title "surface", \
- "~/Dokumente/Prograemmchen/ROM/input.dat" using 1:2 with lines lt 2 title "input", \
- "~/Dokumente/Prograemmchen/ROM/output.dat" using 1:2 with lines lt 3 title "output", \
+ "~/Dokumente/Prograemmchen/ROM/input.dat.ori" using 1:2 with lines lt 2 title "inputO", \
+ "~/Dokumente/Prograemmchen/ROM/output.dat.ori" using 1:2 with lines lt 3 title "outputO", \
"~/Dokumente/Prograemmchen/ROM/outputC.dat" using 1:2 with lines lt 4 title "output reconstructed"
diff --git a/romunit.pas b/romunit.pas
index 9437006..8d48b62 100644
--- a/romunit.pas
+++ b/romunit.pas
@@ -29,7 +29,7 @@ procedure uniq(var dat: tExtPointArray; streng: boolean);
procedure fft(var dat: tExtPointArray);
procedure interpoliere(var dat: tExtPointArray);
procedure normiere(var dat: tExtPointArray);
-procedure berechneRefPuls(inPuls,surTraj: tExtPointArray; out cRefPuls: tExtPointArray);
+procedure berechneRefPuls(inPuls,surTraj: tExtPointArray; betaGlaette: longint; betaBound: extended; out cRefPuls: tExtPointArray);
type
tSortThread = class(tThread)
@@ -984,30 +984,33 @@ begin
dat[i].y:=dat[i].y/m;
end;
-procedure berechneRefPuls(inPuls,surTraj: tExtPointArray; out cRefPuls: tExtPointArray);
-var i,anz: longint;
- beta: extended;
-const step=107;
+procedure berechneRefPuls(inPuls,surTraj: tExtPointArray; betaGlaette: longint; betaBound: extended; out cRefPuls: tExtPointArray);
+var iSur,iIn,anz: longint;
+ beta,frac: extended;
begin
- i:=0;
+ if betaGlaette<1 then betaGlaette:=1;
setlength(cRefPuls,0);
anz:=0;
- while (i<length(surTraj)-step) and (surTraj[i].x-surTraj[i].y<inPuls[length(inPuls)-1].x) do begin
- while (i<length(surTraj)-step) and (inPuls[0].x>surTraj[i].x-surTraj[i].y) do
- inc(i);
- if i>=length(surTraj)-step then break;
+ iIn:=0;
+ betaBound:=abs(betaBound);
+ for iSur:=0 to length(surTraj)-betaGlaette-1 do begin
+ if inPuls[0].x>surTraj[iSur].x-surTraj[iSur].y then
+ continue;
+ while (iIn<length(inPuls)-1) and (inPuls[iIn+1].x<=surTraj[iSur].x-surTraj[iSur].y) do
+ inc(iIn);
+ if iIn>=length(inPuls)-1 then break;
if anz>=length(cRefPuls) then
setlength(cRefPuls,anz+32768);
- beta:=max((surTraj[i+step].y-surTraj[i].y)/(surTraj[i+step].x-surTraj[i].x),-0.5);
- cRefPuls[anz].x:=surTraj[i].x+surTraj[i].y;
+ beta:=min(max((surTraj[iSur+betaGlaette].y-surTraj[iSur].y)/(surTraj[iSur+betaGlaette].x-surTraj[iSur].x),-betaBound),betaBound);
+ // beta:=0;
+ frac:=(surTraj[iSur].x-surTraj[iSur].y - inPuls[iIn].x)/(inPuls[iIn+1].x - inPuls[iIn].x);
+ cRefPuls[anz].x:=surTraj[iSur].x+surTraj[iSur].y;
cRefPuls[anz].y:=
- (inPuls[anz].y * (inPuls[anz+step].x - surTraj[i].x+surTraj[i].y) +
- inPuls[anz+step].y * (- inPuls[anz].x + surTraj[i].x-surTraj[i].y)) /
- (inPuls[anz+step].x - inPuls[anz].x) *
+ (inPuls[iIn].y * (1-frac) +
+ inPuls[iIn+1].y * frac) *
(1-beta)/(1+beta);
inc(anz);
- inc(i);
end;
setlength(cRefPuls,anz);
end;