-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadGPSobs.pl
More file actions
executable file
·34 lines (29 loc) · 893 Bytes
/
readGPSobs.pl
File metadata and controls
executable file
·34 lines (29 loc) · 893 Bytes
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
#! /usr/bin/env perl
#
# readGPSobs.pl -by Mark
# reads a RINEX GPS observation file and prints out certain info
# Usage: readGPSobs.pl filename.txt
$infile = $ARGV[0];
print "Reading file: $infile...\n\n";
open(FILEIN, "<$infile") or die "Can't open $infile: $!";
HEADER: while(<FILEIN>) { last HEADER if m/END OF HEADER/;
SWITCH: {
if (m/REC # \/ TYPE \/ VERS/) {
$recType = substr($_,20,20);
print "Receiver Type: $recType\n";
last SWITCH;}
if (m/APPROX POSITION XYZ/) {
@approxPosXYZ = split(' ',$_);
print "Approximate Position: @approxPosXYZ[0..2]\n";
last SWITCH;}
if (m/# \/ TYPES OF OBSERV/) {
@typeObs = split(' ',$_);
print "Observations: $typeObs[0] \nType: @typeObs[1..$typeObs[0]]\n";
last SWITCH;}
} #SWITCH
} #HEADER
$numOfTags = 0;
GPSDATA: while(<FILEIN>) {
$numOfTags++ if m/G/;
} #GPSDATA
print "Number of time tags: $numOfTags\n\n";