~ubuntu-branches/ubuntu/trusty/libgeo-metar-perl/trusty

« back to all changes in this revision

Viewing changes to debian/patches/pressure.patch

  • Committer: Bazaar Package Importer
  • Author(s): Martín Ferrari
  • Date: 2008-06-13 02:42:42 UTC
  • mfrom: (0.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080613024242-2be2lbxarhx8sglx
Tags: 1.15-1
* New upstream release, new upstream maintainer.
* debian/docs: removed HACKING.
* debian/copyright: updated CP info, plus new format.
* debian/control: added myself to Uploaders, fixed case in short desc. Fix
  incorrect Build-Depends{,-Indep} distribution.
* debian/patches: finally merged all the patches from #304962 and #262397
  with the new upstream release! Also, sent the patches upstream as
  CPAN#36708. (Closes: #304962).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: libgeo-metar-perl/METAR.pm
 
2
===================================================================
 
3
--- libgeo-metar-perl.orig/METAR.pm
 
4
+++ libgeo-metar-perl/METAR.pm
 
5
@@ -185,9 +185,9 @@
 
6
 
 
7
 # PRESSURE
 
8
 #
 
9
-# The pressure, or altimeter setting, at the reporting site recorded in
 
10
-# inches of mercury (Hg) minus the decimal point. It should always look
 
11
-# like (A\d\d\d\d).
 
12
+# The pressure, or altimeter setting, at the reporting site recorded in whole
 
13
+# hectopascals (starts with a Q) or inches of mercury (Hg) minus the decimal
 
14
+# point (starts with an A). It should always look like ([AQ]\d\d\d\d).
 
15
 #
 
16
 # KNMI: Q\d\d\d\d pressure in hPa calculated for sea level
 
17
 
 
18
@@ -354,7 +354,8 @@ sub new
 
19
     $self->{HOURLY_DEW_F}  = undef;             # hourly dew point, celcius
 
20
     $self->{HOURLY_DEW_C}  = undef;             # hourly dew point, fahrenheit
 
21
     $self->{HOURLY_PRECIP} = undef;             # hourly precipitation
 
22
-    $self->{ALT}           = undef;             # altimeter setting
 
23
+    $self->{ALT}           = undef;             # altimeter setting (Hg)
 
24
+    $self->{ALT_HP}        = undef;             # altimeter setting (hPa)
 
25
     $self->{SLP}           = undef;             # sea level pressure
 
26
     $self->{REMARKS}       = undef;             # remarks
 
27
 
 
28
@@ -891,18 +892,14 @@ sub _process
 
29
         }
 
30
 
 
31
         ##
 
32
-        ## is it an altimeter setting?
 
33
+        ## is it an altimeter setting? (in.Hg)
 
34
         ##
 
35
 
 
36
         elsif (($parsestate >= $expect_modifier) and ($parsestate < $expect_remarks) and ($tok =~ /^A(\d\d)(\d\d)$/i))
 
37
         {
 
38
             $self->{alt} = $tok;
 
39
-            $self->{ALT} = "$1.$2";
 
40
-
 
41
-                       # inches Hg pressure. How imperial can you get
 
42
-                       # conversion using 'units'
 
43
-
 
44
-                       $self->{pressure} = 33.863886 * $self->{ALT};
 
45
+            $self->{ALT} = "$1.$2"+0;
 
46
+            $self->{ALT_HP} = "$1.$2" * 33.863886;
 
47
 
 
48
             print "[$tok] is an altimeter setting.\n" if $self->{debug};
 
49
                        $parsestate = $expect_recentweather;
 
50
@@ -910,14 +907,14 @@ sub _process
 
51
         }
 
52
 
 
53
                ##
 
54
-               ## is it a pressure?
 
55
+               ## is it a pressure? (hPa)
 
56
                ##
 
57
 
 
58
                elsif (($parsestate >= $expect_modifier) and ($parsestate < $expect_remarks) and ($tok =~ /^Q(\d\d\d\d)$/i))
 
59
                {
 
60
                        $self->{pressure} = $1;
 
61
-
 
62
-                       $self->{ALT} = 0.029529983*$self->{pressure};
 
63
+            $self->{ALT_HP} = $1;
 
64
+                       $self->{ALT} = 0.029529983 * $self->{pressure};
 
65
                        print "[$tok] is an air pressure.\n" if $self->{debug};
 
66
                        $parsestate = $expect_recentweather;
 
67
                        next;
 
68
@@ -1378,7 +1375,8 @@ sub dump
 
69
     print "weather: " . join(', ', @{$self->{weather}}) . "\n";
 
70
     print "sky: " . join(', ', @{$self->{sky}}) . "\n";
 
71
     print "temp_dew: $self->{temp_dew}\n";
 
72
-    print "alt: $self->{ALT}\n";
 
73
+    print "alt: $self->{alt}\n";
 
74
+    print "pressure: $self->{pressure}\n";
 
75
     print "slp: $self->{slp}\n";
 
76
     print "remarks: " . join (', ', @{$self->{remarks}}) . "\n";
 
77
     print "\n";
 
78
@@ -1668,6 +1666,10 @@ Hourly dewpoint, celcius
 
79
 
 
80
 Altimeter setting (barometric pressure).
 
81
 
 
82
+=item ALT_HP
 
83
+
 
84
+Altimeter setting in hectopascals.
 
85
+
 
86
 =item REMARKS
 
87
 
 
88
 Any remarks in the report.