notam 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: af3eeb358f7926b26df44bbc63fad3609d67b624c26007418bfd1d534e88fb13
4
- data.tar.gz: de019922c1df754396cec3707d0306bdd820053c1fc28b095ccbed3dfcb8f5f0
3
+ metadata.gz: 92a3fd49f8ffbc96bcb45d19f890837af01c255d69d4c083a883c8f446e1758d
4
+ data.tar.gz: 5fa45d97e28d3bed19a20ec3e841e815b93cb94f3b686172fb9abc5c50cc7118
5
5
  SHA512:
6
- metadata.gz: 29466f5ea8d2ccb99d2ee9e970940e4a629c60dc8b761b20a5d0ecdb42088a196228ad6830119e2acbb58c97d673fbeb4b5058355430c82459aadc25870220f4
7
- data.tar.gz: 8d74558a051b08e1161c0765eda985c9067c40cf74ce2487a9f98b54315fd1b657daf99042a9f8a1218d9e9d2784a905dfd0c78d776273c400ec1ce06e9b47fe
6
+ metadata.gz: 42503973261da835cab991b6272b1b12ac17adac8f8a670de29d7b55f5650b35cb4e38d5eddc145c78ba03f81f4247f398cb0aec82d2366205b90a6fb6c96842
7
+ data.tar.gz: 9f84f55bc3b42c40e7670e72683c05b32d71a8d401a197b38481eeaa56b173d16e62e3279a40134bf48cadb0e227fb30ba68ff5766a9c96ece9d66fe8e1f3a71
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Nothing so far
4
4
 
5
+ ## 0.1.2
6
+
7
+ #### Changes
8
+ * The five day schedules are calculated starting today if `effective_at` is
9
+ in the past.
10
+
5
11
  ## 0.1.1
6
12
 
7
13
  #### Changes
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![Version](https://img.shields.io/gem/v/notam.svg?style=flat)](https://rubygems.org/gems/notam)
2
2
  [![Tests](https://img.shields.io/github/workflow/status/svoop/notam/Test.svg?style=flat&label=tests)](https://github.com/svoop/notam/actions?workflow=Test)
3
- [![Code Climate](https://img.shields.io/codeclimate/maintainability/notam/notam.svg?style=flat)](https://codeclimate.com/github/svoop/notam/)
3
+ [![Code Climate](https://img.shields.io/codeclimate/maintainability/svoop/notam.svg?style=flat)](https://codeclimate.com/github/svoop/notam/)
4
4
  [![Donorbox](https://img.shields.io/badge/donate-on_donorbox-yellow.svg)](https://donorbox.org/bitcetera)
5
5
 
6
6
  # NOTAM
@@ -26,7 +26,7 @@ gem cert --add <(curl -Ls https://raw.github.com/svoop/notam/main/certs/svoop.pe
26
26
  Add the following to the `Gemfile` or `gems.rb` of your [Bundler](https://bundler.io) powered Ruby project:
27
27
 
28
28
  ```ruby
29
- gem notam
29
+ gem 'notam'
30
30
  ```
31
31
 
32
32
  And then install the bundle:
@@ -112,6 +112,19 @@ See the [API documentation](https://www.rubydoc.info/gems/notam) for more.
112
112
 
113
113
  ⚠️ Only NOTAM compatible with the ICAO annex 15 are supported for now. Most notably in the USA other NOTAM formats exist which cannot be parsed using this gem.
114
114
 
115
+ ### Anatomy of a NOTAM message
116
+
117
+ A NOTAM message consists of a header followed by the following items:
118
+
119
+ * [Q item](https://www.rubydoc.info/gems/notam/NOTAM/Q): Essential information such as purpose or center point and radius
120
+ * [A item](https://www.rubydoc.info/gems/notam/NOTAM/A): Affected locations
121
+ * [B item](https://www.rubydoc.info/gems/notam/NOTAM/B): When the NOTAM becomes effective
122
+ * [C item](https://www.rubydoc.info/gems/notam/NOTAM/C): When the NOTAM expires
123
+ * [D item](https://www.rubydoc.info/gems/notam/NOTAM/D): Activity schedules (optional)
124
+ * [E item](https://www.rubydoc.info/gems/notam/NOTAM/E): Free text description
125
+ * [F item](https://www.rubydoc.info/gems/notam/NOTAM/F): Upper limit (optional)
126
+ * [G item](https://www.rubydoc.info/gems/notam/NOTAM/G): Lower limit (optional)
127
+
115
128
  ### FIR
116
129
 
117
130
  Four letter FIR codes assigned by the ICAO follow some logic, albeit there exist exceptions and inconsistencies e.g. for historical reasons. Let's take an easy example:
@@ -119,14 +132,14 @@ Four letter FIR codes assigned by the ICAO follow some logic, albeit there exist
119
132
  ```
120
133
  L F M M
121
134
  ┬ ┬ ─┬─
122
- │ │ └─ global area: L => lower Europe
135
+ │ │ └─ subsection: MM => Marseille
123
136
  │ └──── geopolitical unit: F => France
124
- └────── subsection: MM => Marseille
137
+ └────── global area: L => lower Europe
125
138
  ```
126
139
 
127
140
  The informal use of only the first two letters often stands for a combination of all subsections contained therein. Example: `LF` is a combination of `LFBB`, `LFEE`, `LFFF`, `LFMM` and `LFRR`.
128
141
 
129
- FIR codes ending with `XX` specify more than one subsection. Example: `LFXX` is a combination of two subsections with in `LF`. In NOTAM, this notation may be used on the Q item if (and only if) the affected subsections are listed on the A item.
142
+ FIR codes ending with `XX` specify more than one subsection. Example: `LFXX` can be any combination of at least two subsections within `LF`. In NOTAM, this notation may be used on the Q item if (and only if) the affected subsections are listed on the A item.
130
143
 
131
144
  ### Series
132
145
 
@@ -151,18 +164,20 @@ AIS are free to define series as they please, however, a few conventions have em
151
164
 
152
165
  #### Checklist
153
166
 
154
- Checklist NOTAM are periodically issued lists of all currently effective NOTAM. They are used for cross checking and can usually be ignored for flight planning. Their Q item contain `Q..KK` which is decoded as "condition: :checklist", here's an example:
167
+ Checklist NOTAM are periodically issued lists of all currently effective NOTAM. They are used for cross checking and can usually be ignored for flight planning. Their Q item contain `QKKKK` which is decoded as `condition: :checklist`, here's an example:
155
168
 
156
169
  ```
157
170
  Q) EDXX/QKKKK/K /K /K /000/999/5123N01018E999
171
+ ^^^^^
158
172
  ```
159
173
 
160
174
  #### Trigger
161
175
 
162
- Trigger NOTAM are referring to another source of information such as AIP SUP (AIP supplement). Their Q item contain `Q..TT` which is decoded as "condition: :trigger", here's an example:
176
+ Trigger NOTAM are referring to another source of information such as AIP SUP (AIP supplement). Their Q item contain `Q..TT` which is decoded as `condition: :trigger`, here's an example:
163
177
 
164
178
  ```
165
179
  Q) LFXX/QRTTT/IV/BO /W /000/035/4708N00029E010
180
+ ^ ^^
166
181
  ```
167
182
 
168
183
  Note: Trigger NOTAM are never published as series `T`.
data/lib/notam/item/d.rb CHANGED
@@ -28,11 +28,17 @@ module NOTAM
28
28
  schedules.any? { _1.active?(at: at, xy: data[:center_point]) }
29
29
  end
30
30
 
31
+ # Calculate the relevant, consolidated schedules for five days.
32
+ #
33
+ # The beginning of the five day window is either today (if +effective_at+
34
+ # is in the past) or +effective_at+ (otherwise).
35
+ #
36
+ # @return [Array<NOTAM::Schedule>]
31
37
  def five_day_schedules
32
38
  schedules.map do |schedule|
33
39
  schedule
34
- .slice(AIXM.date(data[:effective_at]), AIXM.date(data[:effective_at] + 4 * 86_400))
35
- .resolve(on: data[:effective_at], xy: data[:center_point])
40
+ .slice(AIXM.date(five_day_base), AIXM.date(five_day_base + 4 * 86_400))
41
+ .resolve(on: AIXM.date(five_day_base), xy: data[:center_point])
36
42
  end.map { _1 unless _1.empty? }.compact
37
43
  end
38
44
 
@@ -43,6 +49,12 @@ module NOTAM
43
49
 
44
50
  private
45
51
 
52
+ # @return [Time]
53
+ def five_day_base
54
+ @five_day_base ||= [data[:effective_at], Time.now.utc.round].max
55
+ end
56
+
57
+ # @params string [String] string to clean up
46
58
  # @return [String]
47
59
  def cleanup(string)
48
60
  string
data/lib/notam/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NOTAM
4
- VERSION = "0.1.1".freeze
4
+ VERSION = "0.1.2".freeze
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn
@@ -30,7 +30,7 @@ cert_chain:
30
30
  1+2Y1+i+4jd1B7qxIgOLxQTNIJiwE0sqU1itFfuesfgUACS7M0IV9u9Bp4hBGNEw
31
31
  5JcY2h7owdMxXIvgk1oakgldFJc=
32
32
  -----END CERTIFICATE-----
33
- date: 2022-04-23 00:00:00.000000000 Z
33
+ date: 2022-05-19 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: aixm
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
258
  - !ruby/object:Gem::Version
259
259
  version: '0'
260
260
  requirements: []
261
- rubygems_version: 3.3.12
261
+ rubygems_version: 3.3.14
262
262
  signing_key:
263
263
  specification_version: 4
264
264
  summary: Parser for NOTAM (Notice to Airmen) messages
metadata.gz.sig CHANGED
Binary file