Thread Mehrere Messungen zu einem Zeitpunkt erkennen und mitteln (12 answers)
Opened by Emilie at 2010-04-12 13:47

Emilie
 2010-04-12 15:16
#135898 #135898
User since
2010-04-12
4 Artikel
BenutzerIn
[default_avatar]
Hey,
also so den totalen Durchbruch hatte ich leider noch nicht. Habe zur Vereinfachung erstmal nur einen Messwert genommen, ist übersichtlicher und den Hinweis von pq angefügt. Er rechnet allerdings genauso wie vorher, alles einzeln, doppelte Zeiten...vielleicht habe ich auch totalen Schrott gemacht mit pq Vorschlag, verstehe ihn momentan noch nicht so ganz, gebe ich zu. Hier mal mein komplettes Programm, wie gesagt, vor der Mittelung funktioniert alles super, die #s nur. weil ich ein wenig redutieren wollte...

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@lines=<INFO>;

for($i=0;$i<=$#lines;++$i)

{

# Block Aircraft Registration
      #$aircraftregistration=substr($lines[$i],7,5);

# Block Departure Airport
#      $departureairport=$zeile1[4];
     # $departureairport=substr($lines[$i],23,4);

# Block Destination Airport
    # $destinationairport=substr($lines[$i],28,4);

# Block Datum
     $day1=substr($lines[$i],33,2);
     $month1=substr($lines[$i],35,3);
     $year1=substr($lines[$i],38,4);

     if ($month1 eq "SEP"){ $month="09" 
      }

# Block Zeit der Messung
     $hr=substr($lines[$i],42,2);
     $min=substr($lines[$i],44,2);
     $sec=substr($lines[$i],46,2);

# Block Zeit Empfang der Messung
     $hr1=substr($lines[$i],49,2);
     $min1=substr($lines[$i],51,2);
     $sec1=substr($lines[$i],53,2);


# Block Koordinaten
    # $lat=substr($lines[$i],57,7);
     #$long=substr($lines[$i],64,7);

# Block Höhe in Zehntel
    # $fl=substr($lines[$i],71,4);

# Block Temperatur
    # $sign=substr($lines[$i],75,1);
    # $temp=substr($lines[$i],76,3);

#if ($sign eq "P"){ $sig=" " 
      #}
#if ($sign eq "M"){ $sig="-" 
     # }

# Block Wind
     $dir=substr($lines[$i],79,3);
   #  $vel=substr($lines[$i],82,3);


# Bestimme UNIX Zeitstempel
     $TIME = timelocal($sec, $min, $hr, $day1, $month-1, $year1-1900);


for my $line (@lines) {
    chomp $line;
    my ($TIME, $dir) = split ' ', $line;
    $values{$TIME}->{count}++;
    $values{$TIME}->{value1_sum} += $value1;

}

for my $TIME (keys %values) {
    my $value1_sum = delete $values{$TIME}->{value1_sum};
    $values{$TIME}->{value1} = $value1_sum / $values{$TIME}->{count};

}

print   $TIME," ",$dir,"\n";


mod-edit pq: perl-tags hinzugefügt
Last edited: 2010-04-12 15:18:19 +0200 (CEST)

View full thread Mehrere Messungen zu einem Zeitpunkt erkennen und mitteln