| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Pure::Text::NASA_Ames::FFI2160; |
|
2
|
1
|
|
|
1
|
|
80459
|
use base (Text::NASA_Ames); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
697
|
|
|
3
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(xScal1 xMiss1)); |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Text::NASA_Ames::FFI2160; |
|
6
|
1
|
|
|
1
|
|
15
|
use base qw(Pure::Text::NASA_Ames::FFI2160); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
662
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
90
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
31
|
use 5.00600; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
49
|
|
|
10
|
1
|
|
|
1
|
|
6
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
1056
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = do { my @r = (q$Revision: 1.2 $ =~ /\d+/g); sprintf " %d." . "%02d" x $#r, @r }; |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Text::NASA_Ames::FFI2160 - Implementation of FFI2160 NASA_Ames format |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
This class should normally not be called directly but through the |
|
25
|
|
|
|
|
|
|
L class indirectly. |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 PUBLIC METHODS |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=over 4 |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=item new (Text::NASA_Ames-object || options for new NASA_Ames) |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
parses the (rest of the) header (body and comments) |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub new { |
|
38
|
2
|
|
|
2
|
1
|
5
|
my ($class, $fileObj) = @_; |
|
39
|
2
|
|
33
|
|
|
9
|
$class = ref $class || $class; |
|
40
|
2
|
50
|
33
|
|
|
14
|
if (! (ref $fileObj && (ref($fileObj) eq 'Text::NASA_Ames'))) { |
|
41
|
0
|
|
|
|
|
0
|
return new Text::NASA_Ames($fileObj); |
|
42
|
|
|
|
|
|
|
} |
|
43
|
2
|
|
|
|
|
3
|
my $self = $fileObj; |
|
44
|
2
|
|
|
|
|
5
|
bless $self, $class; |
|
45
|
|
|
|
|
|
|
|
|
46
|
2
|
|
|
|
|
13
|
$self->_parseList('dX', 1); |
|
47
|
2
|
|
|
|
|
23
|
push @{ $self->dX }, undef; # undef for string X2 |
|
|
2
|
|
|
|
|
6
|
|
|
48
|
2
|
|
|
|
|
28
|
$self->_parseList('lenX', 1); |
|
49
|
2
|
|
|
|
|
22
|
unshift @{ $self->lenX }, undef; # undef for numeric X1 |
|
|
2
|
|
|
|
|
9
|
|
|
50
|
2
|
|
|
|
|
27
|
$self->_parseLines('xName', $self->nIV); |
|
51
|
2
|
|
|
|
|
29
|
$self->_parseVDeclaration; |
|
52
|
2
|
|
|
|
|
26
|
$self->_parseAuxDeclaration; |
|
53
|
2
|
|
|
|
|
28
|
$self->_parseTailHeader; |
|
54
|
|
|
|
|
|
|
|
|
55
|
2
|
|
|
|
|
36
|
return $self; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub _parseAuxDeclaration { |
|
59
|
2
|
|
|
2
|
|
4
|
my $self = shift; |
|
60
|
2
|
|
|
|
|
5
|
$self->nAuxV($self->nextLine); # includes NX1 on first pos! |
|
61
|
2
|
|
|
|
|
23
|
$self->nAuxC($self->nextLine); |
|
62
|
2
|
|
|
|
|
22
|
foreach my $type (qw(aScal aMiss)) { |
|
63
|
4
|
|
|
|
|
31
|
$self->_parseList($type, ($self->nAuxV - $self->nAuxC)); |
|
64
|
|
|
|
|
|
|
} |
|
65
|
2
|
|
|
|
|
31
|
$self->_parseList('lenA', $self->nAuxC); |
|
66
|
2
|
|
|
|
|
23
|
my @stringMissA; |
|
67
|
2
|
|
|
|
|
8
|
for (my $i = 0; $i < $self->nAuxC; $i++) { |
|
68
|
4
|
|
|
|
|
48
|
push @stringMissA, $self->nextLine; |
|
69
|
|
|
|
|
|
|
} |
|
70
|
2
|
|
|
|
|
23
|
push @{ $self->aMiss }, @stringMissA; |
|
|
2
|
|
|
|
|
7
|
|
|
71
|
2
|
|
|
|
|
52
|
push @{ $self->aScal }, map { undef } @stringMissA; |
|
|
2
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
23
|
|
|
72
|
2
|
|
|
|
|
6
|
$self->_parseLines('aName', $self->nAuxV); |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# move first aux value to NX1 |
|
75
|
2
|
|
|
|
|
25
|
$self->nAuxV($self->nAuxV - 1); |
|
76
|
2
|
|
|
|
|
32
|
my @aScal = @{ $self->aScal }; |
|
|
2
|
|
|
|
|
7
|
|
|
77
|
2
|
|
|
|
|
26
|
$self->xScal1(shift @aScal); |
|
78
|
2
|
|
|
|
|
22
|
$self->aScal(\@aScal); |
|
79
|
2
|
|
|
|
|
18
|
my @aMiss = @{ $self->aMiss }; |
|
|
2
|
|
|
|
|
7
|
|
|
80
|
2
|
|
|
|
|
26
|
$self->xMiss1(shift @aMiss); |
|
81
|
2
|
|
|
|
|
22
|
$self->aMiss(\@aMiss); |
|
82
|
2
|
|
|
|
|
16
|
my @aName = @{ $self->aName }; |
|
|
2
|
|
|
|
|
15
|
|
|
83
|
2
|
|
|
|
|
19
|
shift @aName; |
|
84
|
2
|
|
|
|
|
7
|
$self->aName(\@aName); |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub _refillBuffer { |
|
88
|
4
|
|
|
4
|
|
6
|
my $self = shift; |
|
89
|
|
|
|
|
|
|
|
|
90
|
4
|
|
|
|
|
12
|
my $x2 = $self->nextLine; |
|
91
|
4
|
100
|
|
|
|
14
|
return unless defined $x2; |
|
92
|
|
|
|
|
|
|
|
|
93
|
3
|
|
|
|
|
9
|
my $line = $self->nextLine; |
|
94
|
3
|
50
|
|
|
|
10
|
return unless defined $line; |
|
95
|
|
|
|
|
|
|
|
|
96
|
3
|
|
|
|
|
12
|
my ($nX1, @a) = split ' ', $line; |
|
97
|
3
|
|
|
|
|
11
|
while (@a < ($self->nAuxV - $self->nAuxC)) { |
|
98
|
0
|
|
|
|
|
0
|
push @a, split ' ', $self->nextLine; |
|
99
|
|
|
|
|
|
|
} |
|
100
|
3
|
50
|
|
|
|
55
|
if (@a > ($self->nAuxV - $self->nAuxC)) { |
|
101
|
0
|
|
|
|
|
0
|
$self->_carp("to much elements for numeric Aux, expected ". |
|
102
|
|
|
|
|
|
|
($self->nAuxV() - $self->nAuxC). ", got ". scalar @a); |
|
103
|
0
|
|
|
|
|
0
|
return; |
|
104
|
|
|
|
|
|
|
} |
|
105
|
3
|
|
|
|
|
63
|
push @a, map {$self->nextLine} (1..$self->nAuxC); |
|
|
6
|
|
|
|
|
42
|
|
|
106
|
3
|
50
|
|
|
|
11
|
$self->_cleanAndScaleVals($self->aMiss, $self->aScal, \@a) |
|
107
|
|
|
|
|
|
|
if $self->nAuxV > 0; |
|
108
|
|
|
|
|
|
|
|
|
109
|
3
|
|
|
|
|
15
|
for (my $i = 0; $i < $nX1; $i++) { |
|
110
|
21
|
|
|
|
|
57
|
$line = $self->nextLine; |
|
111
|
21
|
50
|
|
|
|
47
|
unless ($line) { |
|
112
|
0
|
|
|
|
|
0
|
$self->_carp("not enough elements for V". |
|
113
|
|
|
|
|
|
|
" in row ". $self->currentLine); |
|
114
|
0
|
|
|
|
|
0
|
return; |
|
115
|
|
|
|
|
|
|
} |
|
116
|
|
|
|
|
|
|
|
|
117
|
21
|
|
|
|
|
72
|
my ($x1, @v) = split ' ', $line; |
|
118
|
21
|
50
|
|
|
|
64
|
if (@v != $self->nV) { |
|
119
|
0
|
|
|
|
|
0
|
$self->_carp("not enough elements for v, expected ". |
|
120
|
|
|
|
|
|
|
$self->nV . ", got ". scalar @v . |
|
121
|
|
|
|
|
|
|
" in row ". $self->currentLine); |
|
122
|
0
|
|
|
|
|
0
|
return; |
|
123
|
|
|
|
|
|
|
} |
|
124
|
21
|
50
|
|
|
|
247
|
if ($x1 == $self->xMiss1) { |
|
125
|
0
|
|
|
|
|
0
|
$x1 = undef; |
|
126
|
|
|
|
|
|
|
} else { |
|
127
|
21
|
|
|
|
|
215
|
$x1 *= $self->xScal1; |
|
128
|
|
|
|
|
|
|
} |
|
129
|
21
|
50
|
|
|
|
206
|
$self->_cleanAndScaleVals($self->vMiss, $self->vScal, \@v) |
|
130
|
|
|
|
|
|
|
if $self->nV > 0; |
|
131
|
21
|
|
|
|
|
43
|
push @{ $self->dataBuffer }, |
|
|
21
|
|
|
|
|
53
|
|
|
132
|
|
|
|
|
|
|
new Text::NASA_Ames::DataEntry({X => [ $x1, $x2 ], |
|
133
|
|
|
|
|
|
|
V => \@v, |
|
134
|
|
|
|
|
|
|
A => \@a}); |
|
135
|
|
|
|
|
|
|
} |
|
136
|
|
|
|
|
|
|
} |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
1; |
|
139
|
|
|
|
|
|
|
__END__ |