# --------------------------------------------------------------------- # This software is in the public domain, furnished "as is", without # technical support, and with no warranty, express or implied, as to # its usefulness for any purpose. # # Hazard_HLS_OKX_Overrides.TextUtility # # This file is used for WFO specific overrides of the Hazard_HLS # formatter. # # # Methods: # Overrides: # # Additions: # # --------------------------------------------------------------------- import string, time, re, os, types, copy, AFPS import TextRules, SampleAnalysis import GenericHazards import string, time, re, os, glob, types, copy, AFPS, LogStream, siteConfig import ModuleAccessor, SampleAnalysis from math import * #********************************************************************** # MAKE NO CHANGES HERE # The minimum contents of this file are the following class definition # and the __init__ method with only "pass" line in it. class Hazard_HLS_OKX_Overrides: def __init__(self): pass # End MAKE NO CHANGES HERE #********************************************************************** # Make sure to indent methods inside the class statement. #----- WFO OKX Hazard_HLS Overrides ----- # It is helpful to put a debug statement at the beginning of each # method to help with trouble-shooting. #def _method(self): #self.debug_print("Debug: _method in Hazard_HLS_ER_Overrides") # Example of Overriding a dictionary from TextRules #def phrase_descriptor_dict(self, tree, node): #dict = TextRules.TextRules.phrase_descriptor_dict(self, tree, node) #dict["PoP"] = "chance of" #return dict def _inlandAreas(self): return [ "NYZ067", "NYZ068", "NYZ069", "NYZ070", "NJZ002", "NJZ003", "NJZ004", "NJZ005", "NJZ011", "CTZ005", "CTZ006", "CTZ007", "CTZ008", ] ## def _coastalAreas(self): ## return [ ## "CTZ012", "CTZ011", "CTZ010", "CTZ009", "NYZ071", "NYZ072", "NYZ073", "NYZ074", ## "NYZ075", "NYZ076", "NYZ077", "NYZ078", "NYZ079", "NYZ080", "NYZ081", "NJZ006", ## ] ## def _marineAreas(self): ## return [ ## "ANZ335", "ANZ330", "ANZ340", "ANZ350", "ANZ353", "ANZ355", "ANZ345", ## "ANZ338", "ANZ370", ## ] def _cwa(self): return "OKX" def _cwa_descriptor(self): return "TRI-STATE AREA" ## def _maor_descriptor(self): ## return "LONG ISLAND SOUND AND ATLANTIC COASTAL WATERS" ## ## ## def _cwa_maor_descriptor(self): ## return "TRI-STATE AREA AND ADJACENT COASTAL WATERS" def _localReferencePoints(self): # Give the name and lat/lon for each local reference point return [ ("New York City, NY", (40.77, -73.96)), ("Montauk Pt., NY", (41.07, -71.96)), # ("Charleston, SC", (32.78, -79.94)), # ("Savannah, GA", (32.05, -81.08)), ] def _localReferencePoints_defaults(self): # Give a list of the local reference point names to be # turned on by default return ["New York City, NY", "Montauk Pt., NY"] def _overviewFormat(self): # For overview headlines specify "listAreas" if you want specific # locations listed. # Otherwise, specify "generic" for a general "ALL" or "PORTIONS OF" # the CWA return "listAreas" ## def _areaDisplayType_marine(self): ## # You can set this to any key within the AreaDictionary. ## # e.g. 'ugcName', 'altName', ' ## # Also include the width of the display window ## return ('locationName', 15) def _overview_list(self): return [ { "name": "OverviewEditMode", "label":"Step 1. Choose Overview Edit Mode", "options": [ ("Use This GUI to Create Overview Text", "CreateFromGUI"), ("Use Previous Overview Text", "UsePrev"), ("Format Overview for Free Text", "FormatFree"), ], }, { "name": "StormInfo", "label": "Step 2. Obtain Storm Type/Name/Info", "options": [ "TCPAT1", "TCPAT2", "TCPAT3", "TCPAT4", "TCPAT5", "N/A (unnamed) -- Enter Storm Name below:", "N/A (downgraded) -- Enter Storm Name below:", ], "entryField": " ", }, { "name": "Uncertainty", "label": "Step 3. Declare Degree of Uncertainty", "options": [ ("Smaller Degree", "Low"), ("Average Degree", "Average"), ("Larger Degree", "High"), ("N/A", "N/A"), ], "default": "N/A", }, { "name":"LocalReferencePoints", "label": "Step 4. Locate Storm Relative to Local Reference Points (choose at most "\ +self._referencePointLimit()[1]+")", "optionType": "check", "options": self._localReferencePoints(), "default": self._localReferencePoints_defaults(), }, { "name": "MainHeadline", "label": "Step 5. Input Main Headline (required) ", "options": [ ("Enter Unique Headline (below)", "Enter"), ("Use Previous HLS Headline", "UsePrev"), ("Use Latest TCP Headline", "UseTCP"), ], "entryField": "", }, { "name":"EventContext", "label": "Step 6. Establish Event Context for CWA/MAOR (related to TC WWAs only)", "options": [ ("Non-Event (WWA Not Expected)", "NonEvent"), ("Pre-Event (WWA Possible Soon; Early Evacuations)", "PreEvent"), ("Abbreviated Issuance (WWA First Issuances)", "Abbreviated"), ("Watches Continue (No Warnings)", "Watch"), ("Warnings Continue (With/Without Watches)", "Warning"), ("Conditions Occurring (With Warnings)", "Conditions"), ("Post-Event (WWA Ended)", "PostEvent"), ("Extra-Tropical Transition", "ExtraTropical"), ], }, { "name": "NextUpdate", "label": "Step 7. Indicate Next Update Time", "options": [ ("Shortly (for Abbreviated Issuances)", "Shortly"), ("As Conditions Warrant", "Conditions"), ("Last Issuance", "LastIssuance"), ("Enter Approximate Time (below)", "Enter"), ], "entryField": " e.g. 6 AM EDT", "default": "Enter Approximate Time (below)", }, ] # added by SW for new Coastal Hazard section def _segmentSections(self): return [ { "name": "NewInformation", "label": "New Information", "inSegments": "always", "title": "...New Information...\n", }, { "name": "PrecautionaryPreparednessActions", "label": "Precautionary/Preparedness Actions", "defaultOn": True, "includeFor": self._allAreas(), "usePrev": True, "inSegments": "optional", "importMethod": None, "importPIL": "WBCWRKSEW", "title": "...Precautionary/Preparedness Actions...\nPrecautionary/Preparedness Actions...\n\n", "endStr":"\n&&", }, { "name": "Probability", "label": "Probability of Tropical Storm/Hurricane Conditions", "defaultOn": True, "includeFor": self._allAreas(), "inSegments": "optional", "excludeFromSituations": ["Conditions", "PostEvent", "ExtraTropical"], "importMethod": None, "importPIL": None, "title": "...PROBABILITY OF TROPICAL STORM/HURRICANE CONDITIONS...\n", }, { "name": "Wind", "label": "Winds", "defaultOn": True, "includeFor": self._allAreas(), "orderBox": True, "usePrev": True, "inSegments": "optional", "importMethod": None, "importPIL": None, "title": "...WINDS...\n", }, # Modified Surge to only be coastal and defaulted on ## { ## "name": "StormSurgeTide", ## "label": "Storm Surge and Storm Tide", ## "defaultOn": True, ## "includeFor": self._coastalAreas(), ## "orderBox": True, ## "usePrev": True, ## "inSegments": "optional", ## "importMethod": None, ## "importPIL": "WBCWRKSEW", ## "title":"...Storm Surge and Storm Tide...\n" , ## }, ## { ## "name": "InlandFlooding", ## "label": "Inland Flooding", ## "defaultOn": True, ## "includeFor": self._inlandAreas()+self._coastalAreas(), ## "orderBox": True, ## "usePrev": True, ## "inSegments": "optional", ## "importMethod": None, ## "importPIL": "WBCWRKSEW", ## "title": "...Inland Flooding...\n", ## }, { "name": "Tornadoes", "label": "Tornadoes", "defaultOn": True, "includeFor": self._allAreas(), "orderBox": True, "usePrev": True, "inSegments": "optional", "importMethod": None, "importPIL": None, "title": "...Tornadoes...\n", }, ## { ## "name": "Marine", ## "label": "Marine", ## "defaultOn": True, ## "includeFor": self._marineAreas(), ## "orderBox": True, ## "usePrev": True, ## "inSegments": "optional", ## "importMethod": None, ## "importPIL": None, ## "title":"...Marine...\n" , ## }, ## #### Added to help format Coastal Hazards section ## { ## "name": "CoastalHazards", ## "label": "Coastal Hazards", ## "defaultOn": True, ## "includeFor": self._coastalAreas(), ## "orderBox": True, ## "usePrev": True, ## "inSegments": "optional", ## "importMethod": None, ## "importPIL": "WBCWRKSEW", ## "title": "...Coastal Hazards...\n", ## }, ## ## ] ## ### Added to format Coastal Hazards - moved hazards from StormSurgeTide ## def CoastalHazards(self, title, argDict, segment, section, info): ## hazards = [("SU","W"),("SU","Y"),("CF","W"),("CF","A"),("CF","Y")] ## listenList = [] ## t=self._optionalSection_template(argDict, segment, info, hazards, listenList) ## return title + t ## ### Removed Hazards and placed in new Coastal Hazards Section ## def StormSurgeTide(self, title, argDict, segment, section, info): ## hazards = [] ## listenList = [] ## t=self._optionalSection_template(argDict, segment, info, hazards, listenList) ## return title + t ## ### If Coastal Hazards section is not used use this StormSurgeTide so CF.Y, CF.W and CF.W show up ## def StormSurgeTide(self, title, argDict, segment, section, info): ## hazards = [("SU","W"),("SU","Y"),("CF","W"),("CF","A"),("CF","Y")] ## listenList = [] ## t=self._optionalSection_template(argDict, segment, info, hazards, listenList) ## return title + t { "name": "InlandFlooding", "label": "Inland Flooding", "defaultOn": True, "includeFor": self._inlandAreas(), "orderBox": True, "usePrev": True, "inSegments": "optional", "importMethod": None, "importPIL": "WBCWRKSEW", "title": "...Inland Flooding...\n", }, ]