Python Code Documentation¶
Briefing Module¶
Base Class¶
NOTAM briefing.source.base Module
Provides “public” method to define a simple and stable object interface and orchestrate “_private” method that every specific source class should override to implement the specific business logic of the source
-
class
briefing.source.base.NotamSource¶ Briefing Source base class implementation
Raises: NotImplementedError– raised if the child class has not implemented the overriding of the method-
_download_area_briefing()¶ Should be overrided to perform the business logic required to download a briefing for the specific source.
Raises: NotImplementedError– exception raised if the method is not implemented in the specific source subclass
-
_login_sequence()¶ Should be overrided to perform the business logic required to login a user for the specific source.
The full sequence required to login a user to a specific source. This could just be a “pass” if no login is required.
Raises: NotImplementedError– raised if the child class has not implemented the overriding of the method
-
_logout()¶ Should be overrided to perform the business logic required to logout from the specific source.
Raises: NotImplementedError– exception raised if the method is not implemented in the specific source subclass
-
_parse_area_briefing()¶ Should be overrided to perform the business logic required to parse the briefing raw data for the specific source.
Raises: NotImplementedError– exception raised if the method is not implemented in the specific source subclass
-
check_active_session()¶ Test is there is a active session with the specific source
Returns: True if there is an active session Return type: Bool
-
download_area_briefing(prefilter)¶ Trigger the download of a briefing
After the execution of this method, the raw briefing has been retrieved.
Parameters: prefilter ([dict]) – a dictionary with key/value supported by the source to filter NOTAM added to the briefing (see the specific source class documentation)
-
login(username, password)¶ Trigger the login operation required by the source.
After the execution of this method, access to the source data should be possible.
Parameters: - username ([string]) – credentials information
- password ([string]) – credentials information
-
logout()¶ Trigger the logout operation required by the source.
After the execution of this method, the user access to the source data should not be possible.
-
parse_area_briefing()¶ Trigger the parsing of the briefing raw data
-
Child Class (NATS)¶
Notam Module¶
NOTAM notam.notam Module
-
exception
notam.notam.DecodingError(notam, msg=None)¶ Exception raised when a NOTAM decoding error is detected
Decoding means building a Notam object based on strings with the expected format and content as provided by the Notam source
Parameters: NotamError (Exception) – NotamError as superclass
-
class
notam.notam.Notam(notam_string_dict)¶ Main Notam class (purpose of the module)
A NOTAM object is constructed from the string representation of all NOTAM fields a), b), c), e), q), Lower, Upper, Schedule, … with the goal to enhance the programatic value of the NOTAM data present in the briefing.
The relevant python types & data structure are used as much as possible for example:
- date/datetime
- Schedule information data (‘b’, ‘c’ & ‘sched’) are expanded as a list of timeslots (i.e. Start/Stop Datetime)
- some ‘q’ line codes are extracted (admin info, geo-localisation, …)
More info on the qline decoded by the following regex will be provided as class attributes documentation.
Regex: r’(?P<icao>[A-Z]{4}) /Q(?P<subject>[A-Z]{2})(?P<status>[A-Z]{2} /(?P<traffic>[I,V]{1,2}) /(?P<relevance>[N,B,O,M,K]{1,3}) /(?P<scope>A{0,1}E{0,1}W{0,1} /(?P<fl_lower>[0-9]{3} /(?P<fl_upper>[0-9]{3} /(?P<coord_radius>.*) -
<icoa> ICAO location indicator in which the facility, airspace or condition reported on is located (Ex: EBBU, LFFF, …)
Type: str
-
<subject> Identify the Subject
- RR: Restricted Area
- RD: Danger Area
- OB: Obstacle
- …
=> The full <subject> requires 2 letters to be fully qualified but the first letter gives already information on a group of subject.
- R: Nav. Warnings Airspace Resrictions
- W: Nav. Warnings
- …
We might decide to maintain the full list of code to help in the NOTAM decode exercise in a separate file (easy to maintain in a versioning system)
Type: str
-
<status> Define the Status or the Condition of the Subject
- CA: Changes “Activated”,
- CD: Changes “Deactivated”,
- CR: Temporarily “Replaced by,
- CN: Canceled
- …
=> The full <status> requires 2 letters to be fully qualified but the first letter gives already information on the category of subjects.
- A: Availability
- C: Changes
- H: Hazard
Type: str
-
<traffic> Define the “type” traffic affected by the NOTAM (up to 2 letters from the list below)
- I: IFR
- V: VFR
As paraglider pilot we are concerned by NOTAM containing a “V” as we flight under the “VFR” rules
Type: str
-
<relevance> Define the “relevance” of the NOTAM (up to 3 letters from the list below)
- N: NOTAM of Immediate attention for flight crew members
- B: NOTAM selected for PIB entry
- M: Misceallenous NOTAM
- K: Checklist NOTAM
- O: FLight Operations NOTAM
We often see the NBO, BO & M combinations
Type: str
-
<scope> Define the “scope” of the NOTAM (up to 2 letters from the list below - note our “simplified” regex)
- A: Aerodrome
- E: En-route
- W: Nav Warning
- K: Notam in checklist (used ?)
Type: str
-
<fl_lower>, <fl_upper> Lower & Upper Limit expressed in Flight Level and rounded down or up to the nearest 100 ft increment
-
<coord_radius> Four digits followed by N or S followed by five digits followed by E or W and three digits radius.
This qualifier allows the geographical association of a NOTAM to a facility, service or area that corresponds to the aerodrome or FIR(s) We will further decode this as a real “GEO” information
-
<sched> a semantic string representation of a notam schedule.
Supported format are visible in the sched_parser module
Parameters: object ([object]) – superclass Raises: DecodingError– exception raised when something wrong happen during the decoding phase of the NOTAM
-
exception
notam.notam.NotamError(notam, msg=None)¶ Exception class building a common message format including NOTAM info
Parameters: Exception (object) – Exception as superclass