line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GPS::OID; |
2
|
1
|
|
|
1
|
|
23142
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
742
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.07'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
GPS::OID - Package for GPS PRN - Object ID conversions. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use GPS::OID; |
14
|
|
|
|
|
|
|
my $obj = GPS::OID->new(); |
15
|
|
|
|
|
|
|
print "PRN: ", $obj->prn_oid(22231), "\n"; |
16
|
|
|
|
|
|
|
print "OID: ", $obj->oid_prn(1), "\n"; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
This module maps GPS PRN number to Satellite OID and vice versa. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head2 Object Identification Number (OID) |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
The catalog number assigned to the object by the US Air Force. The numbers are assigned sequentially as objects are cataloged. This is the most common way to search for TLE data on this site. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Object numbers less then 10000 are always aligned to the right, and padded with zeros or spaces to the left. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 Pseudo Random Numbers (PRNs) |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
GPS satellites are identified by the receiver by means of PRN-numbers. Real GPS satellites are numbered from 1 - 32. WAAS/EGNOS satellites and other pseudolites are assigned higher numbers. The PRN-numbers of the satellites appear on the satellite view screens of many GPS receivers. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 CONVENTIONS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Function naming convention is "format of the return" underscore "format of the parameters." |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 new |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
The new() constructor |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $obj = GPS::OID->new(); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub new { |
47
|
1
|
|
|
1
|
1
|
11
|
my $this = shift(); |
48
|
1
|
|
33
|
|
|
9
|
my $class = ref($this) || $this; |
49
|
1
|
|
|
|
|
2
|
my $self = {}; |
50
|
1
|
|
|
|
|
3
|
bless $self, $class; |
51
|
1
|
|
|
|
|
4
|
$self->initialize(@_); |
52
|
1
|
|
|
|
|
3
|
return $self; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 METHODS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 initialize |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub initialize { |
62
|
1
|
|
|
1
|
1
|
2
|
my $self=shift; |
63
|
1
|
|
|
|
|
7
|
%$self=@_; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 prn_oid |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
PRN given Object ID. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
my $prn=prn_oid(22231); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub prn_oid { |
75
|
7
|
|
|
7
|
1
|
434
|
my $self=shift(); |
76
|
7
|
|
|
|
|
10
|
my $param=int(shift()); |
77
|
7
|
|
|
|
|
14
|
my $data=$self->data; |
78
|
7
|
|
|
|
|
31
|
return $data->{$param}; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 oid_prn |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Object ID given PRN. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
my $oid=oid_prn(1); |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub oid_prn { |
90
|
7
|
|
|
7
|
1
|
8
|
my $self=shift(); |
91
|
7
|
|
|
|
|
21
|
my $param=int(shift()); |
92
|
7
|
|
|
|
|
15
|
my $data=$self->data; |
93
|
7
|
|
|
|
|
46
|
$data={map {int($data->{$_}), $_} keys %$data}; |
|
289
|
|
|
|
|
1083
|
|
94
|
7
|
|
|
|
|
155
|
return $data->{$param}; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 listprn |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
List all known PRNs. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
my @prn=$obj->listprn; |
102
|
|
|
|
|
|
|
my $prn=$obj->listprn; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=cut |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub listprn { |
107
|
2
|
|
|
2
|
1
|
292
|
my $self=shift(); |
108
|
2
|
|
|
|
|
5
|
my %list=$self->data; |
109
|
2
|
|
|
|
|
21
|
my @list=sort {$a <=> $b} values %list; |
|
342
|
|
|
|
|
316
|
|
110
|
2
|
100
|
|
|
|
24
|
return wantarray ? @list : \@list; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 listoid |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
List all known OIDs. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
my @oid=$obj->listoid; |
118
|
|
|
|
|
|
|
my $oid=$obj->listoid; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub listoid { |
123
|
2
|
|
|
2
|
1
|
364
|
my $self=shift(); |
124
|
2
|
|
|
|
|
4
|
my %list=$self->data; |
125
|
2
|
|
|
|
|
21
|
my @list=sort {$a <=> $b} keys %list; |
|
347
|
|
|
|
|
304
|
|
126
|
2
|
100
|
|
|
|
26
|
return wantarray ? @list : \@list; |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head2 data |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
OID to PRN hash reference |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
my $data=$self->data; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=cut |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
sub data { |
138
|
20
|
|
|
20
|
1
|
21
|
my $self=shift(); |
139
|
20
|
100
|
|
|
|
70
|
unless (defined($self->{'data'})) { |
140
|
2
|
|
|
|
|
60
|
my %data=( |
141
|
|
|
|
|
|
|
22231 => q{01}, |
142
|
|
|
|
|
|
|
28474 => q{02}, |
143
|
|
|
|
|
|
|
23833 => q{03}, |
144
|
|
|
|
|
|
|
22877 => q{04}, |
145
|
|
|
|
|
|
|
22779 => q{05}, |
146
|
|
|
|
|
|
|
23027 => q{06}, |
147
|
|
|
|
|
|
|
22657 => q{07}, |
148
|
|
|
|
|
|
|
25030 => q{08}, |
149
|
|
|
|
|
|
|
22700 => q{09}, |
150
|
|
|
|
|
|
|
23953 => q{10}, |
151
|
|
|
|
|
|
|
25933 => q{11}, |
152
|
|
|
|
|
|
|
29601 => q{12}, |
153
|
|
|
|
|
|
|
24876 => q{13}, |
154
|
|
|
|
|
|
|
26605 => q{14}, |
155
|
|
|
|
|
|
|
20830 => q{15}, |
156
|
|
|
|
|
|
|
27663 => q{16}, |
157
|
|
|
|
|
|
|
28874 => q{17}, |
158
|
|
|
|
|
|
|
26690 => q{18}, |
159
|
|
|
|
|
|
|
28190 => q{19}, |
160
|
|
|
|
|
|
|
26360 => q{20}, |
161
|
|
|
|
|
|
|
27704 => q{21}, |
162
|
|
|
|
|
|
|
28129 => q{22}, |
163
|
|
|
|
|
|
|
28361 => q{23}, |
164
|
|
|
|
|
|
|
21552 => q{24}, |
165
|
|
|
|
|
|
|
21890 => q{25}, |
166
|
|
|
|
|
|
|
22014 => q{26}, |
167
|
|
|
|
|
|
|
22108 => q{27}, |
168
|
|
|
|
|
|
|
26407 => q{28}, |
169
|
|
|
|
|
|
|
22275 => q{29}, |
170
|
|
|
|
|
|
|
24320 => q{30}, |
171
|
|
|
|
|
|
|
29486 => q{31}, |
172
|
|
|
|
|
|
|
24307 => q{120}, #EGNOS Inmarsat 3F2 AOR-E 15.5°W Garmin 33 |
173
|
|
|
|
|
|
|
28899 => q{121}, # Inmarsat 4F2 AOR-E 53.0°W Garmin 34 |
174
|
|
|
|
|
|
|
24819 => q{122}, #WAAS Inmarsat 3F4 AOR-W 142.0°W Garmin 35 |
175
|
|
|
|
|
|
|
26863 => q{124}, #EGNOS ARTEMIS 21.5°E Garmin 37 |
176
|
|
|
|
|
|
|
#23839 => q{126}, # Inmarsat 3F1 IOR-W 64.0°E Garmin 39 |
177
|
|
|
|
|
|
|
25153 => q{126}, #EGNOS Inmarsat 3F5 IOR-W 25.0°E Garmin 39 |
178
|
|
|
|
|
|
|
28622 => q{129}, #MSAS MTSAT-1 140.0°E Garmin 42 |
179
|
|
|
|
|
|
|
#00000 => q{131}, #ESTB Inmarsat-III IOR-E 65.5°E Garmin 44 |
180
|
|
|
|
|
|
|
24674 => q{134}, #WAAS Inmarsat 3F3 POR 178.0°E Garmin 47 |
181
|
|
|
|
|
|
|
28884 => q{135}, #WAAS Galaxy 15 (PanAm) 133.0°W Garmin 48 |
182
|
|
|
|
|
|
|
28937 => q{137}, #MSAS MTSAT-2 Garmin 50 |
183
|
|
|
|
|
|
|
28868 => q{138}, #WAAS Anik F1R (Telsat) 107.3°W Garmin 51 |
184
|
|
|
|
|
|
|
); |
185
|
2
|
|
|
|
|
4
|
$self->{'data'}=\%data; |
186
|
|
|
|
|
|
|
} |
187
|
20
|
100
|
|
|
|
51
|
return wantarray ? %{$self->{'data'}} : $self->{'data'}; |
|
4
|
|
|
|
|
78
|
|
188
|
|
|
|
|
|
|
} |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=head2 overload |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
Adds or overloads new OID/PRN pairs. |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
$obj->overload($oid=>$prn); |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=cut |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
sub overload { |
199
|
2
|
|
|
2
|
1
|
4
|
my $self=shift(); |
200
|
2
|
|
|
|
|
4
|
my $oid=shift(); |
201
|
2
|
|
|
|
|
3
|
my $prn=shift(); |
202
|
2
|
|
|
|
|
5
|
my $data=$self->data; |
203
|
2
|
|
|
|
|
3
|
my $return=q{added}; |
204
|
2
|
100
|
|
|
|
7
|
if (exists($data->{$oid})) { |
205
|
1
|
|
|
|
|
3
|
$return='overloaded'; |
206
|
|
|
|
|
|
|
} |
207
|
2
|
|
|
|
|
3
|
$data->{$oid}=$prn; |
208
|
2
|
50
|
|
|
|
11
|
return defined($data->{$oid}) ? $return : undef(); |
209
|
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=head2 reset |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
Resets overloaded OID/PRN pairs to package defaults. |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
$obj->reset; |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=cut |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
sub reset { |
220
|
1
|
|
|
1
|
1
|
2
|
my $self=shift(); |
221
|
1
|
|
|
|
|
3
|
undef($self->{'data'}); |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
1; |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
__END__ |