geoips.plugins.modules.sector_metadata_generators package#

Submodules#

geoips.plugins.modules.sector_metadata_generators.bdeck_parser module#

TC trackfile parser for B-Deck formatted TC deck files.

Each B-Deck file contains the full history of storm BEST tracks, on storm per location per line (split between 3 lines each in comments for readability):

AL, 20, 2020091318,   , BEST,   0, 126N,  374W,  30, 1006, TD,   0,    ,    0,
    0,    0,    0, 1011,  240, 100,  40,   0,   L,   0,    ,   0,   0,
         TWENTY, M, 12, NEQ,   60,    0,    0,   60, genesis-num, 039,
AL, 20, 2020091400,   , BEST,   0, 130N,  386W,  30, 1006, TD,   0,    ,    0,
        0,    0,    0, 1011,  240, 100,  40,   0,   L,   0,    ,   0,   0,
         TWENTY, M, 12, NEQ,   60,   60,    0,    0, genesis-num, 039,
AL, 20, 2020091406,   , BEST,   0, 130N,  404W,  35, 1004, TS,  34, NEQ,    0,
        0,   40,   40, 1011,  240,  40,   0,   0,   L,   0,    ,   0,   0,
          TEDDY, M,  0,    ,    0,    0,    0,    0, genesis-num, 039,
AL, 20, 2020091412,   , BEST,   0, 128N,  422W,  35, 1004, TS,  34, NEQ,   50,
       30,    0,   50, 1011,  240,  40,  45,   0,   L,   0,    ,   0,   0,
          TEDDY, M,  0,    ,    0,    0,    0,    0, genesis-num, 039,
AL, 20, 2020091418,   , BEST,   0, 129N,  434W,  40, 1003, TS,  34, NEQ,   80,
       40,    0,   70, 1012,  210,  50,  55,   0,   L,   0,    ,   0,   0,
          TEDDY, M, 12, NEQ,   90,   30,    0,   30, genesis-num, 039,
AL, 20, 2020091500,   , BEST,   0, 130N,  445W,  45, 1002, TS,  34, NEQ,  100,
       50,    0,   80, 1012,  210,  40,  55,   0,   L,   0,    ,   0,   0,
          TEDDY, M, 12, NEQ,   90,   30,    0,   30, genesis-num, 039,
AL, 20, 2020091506,   , BEST,   0, 134N,  455W,  50, 1001, TS,  34, NEQ,  100,
       50,   20,   80, 1012,  210,  20,  60,   0,   L,   0,    ,   0,   0,
          TEDDY, M, 12, NEQ,  300,  210,   30,    0, genesis-num, 039,
AL, 20, 2020091506,   , BEST,   0, 134N,  455W,  50, 1001, TS,  50, NEQ,   20,
        0,    0,    0, 1012,  210,  20,  60,   0,   L,   0,    ,   0,   0,
          TEDDY, M, 12, NEQ,  300,  210,   30,    0, genesis-num, 039,
AL, 20, 2020091512,   , BEST,   0, 138N,  466W,  55,  999, TS,  34, NEQ,  140,
   60,   40,  160, 1011,  250,  20,  65,   0,   L,   0,    ,   0,   0,
      TEDDY, D, 12, NEQ,  300,  210,   30,   30, genesis-num, 039,
AL, 20, 2020091512,   , BEST,   0, 138N,  466W,  55,  999, TS,  50, NEQ,   30,
    0,    0,   30, 1011,  250,  20,  65,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  300,  210,   30,   30, genesis-num, 039,
AL, 20, 2020091518,   , BEST,   0, 142N,  475W,  55,  997, TS,  34, NEQ,  140,
   80,   40,  160, 1011,  250,  20,  65,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  300,  240,   60,   60, genesis-num, 039,
AL, 20, 2020091518,   , BEST,   0, 142N,  475W,  55,  997, TS,  50, NEQ,   30,
    0,    0,   30, 1011,  250,  20,  65,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  300,  240,   60,   60, genesis-num, 039,
AL, 20, 2020091600,   , BEST,   0, 147N,  480W,  65,  987, HU,  34, NEQ,  140,
   80,   40,  150, 1010,  180,  20,  75,   0,   L,   0,    ,   0,   0,
          TEDDY, D,  0,    ,    0,    0,    0,    0, genesis-num, 039,
AL, 20, 2020091600,   , BEST,   0, 147N,  480W,  65,  987, HU,  50, NEQ,   40,
   30,    0,   30, 1010,  180,  20,  75,   0,   L,   0,    ,   0,   0,
          TEDDY, D,  0,    ,    0,    0,    0,    0, genesis-num, 039,
AL, 20, 2020091600,   , BEST,   0, 147N,  480W,  65,  987, HU,  64, NEQ,   20,
    0,    0,    0, 1010,  180,  20,  75,   0,   L,   0,    ,   0,   0,
          TEDDY, D,  0,    ,    0,    0,    0,    0, genesis-num, 039,
AL, 20, 2020091606,   , BEST,   0, 154N,  486W,  80,  978, HU,  34, NEQ,  140,
   80,   40,  150, 1010,  180,  20, 100,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  300,  240,  120,  150, genesis-num, 039,
AL, 20, 2020091606,   , BEST,   0, 154N,  486W,  80,  978, HU,  50, NEQ,   40,
   30,   20,   30, 1010,  180,  20, 100,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  300,  240,  120,  150, genesis-num, 039,
AL, 20, 2020091606,   , BEST,   0, 154N,  486W,  80,  978, HU,  64, NEQ,   20,
   10,   10,   20, 1010,  180,  20, 100,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  300,  240,  120,  150, genesis-num, 039,
AL, 20, 2020091612,   , BEST,   0, 161N,  493W,  85,  973, HU,  34, NEQ,  170,
  170,   40,  150, 1010,  180,  20, 100,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  270,  270,  240,  270, genesis-num, 039,
AL, 20, 2020091612,   , BEST,   0, 161N,  493W,  85,  973, HU,  50, NEQ,   50,
   50,   20,   30, 1010,  180,  20, 100,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  270,  270,  240,  270, genesis-num, 039,
AL, 20, 2020091612,   , BEST,   0, 161N,  493W,  85,  973, HU,  64, NEQ,   25,
   25,   10,   20, 1010,  180,  20, 100,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  270,  270,  240,  270, genesis-num, 039,
AL, 20, 2020091618,   , BEST,   0, 168N,  502W,  85,  973, HU,  34, NEQ,  190,
  100,   70,  170, 1010,  180,  20, 105,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  300,  300,  240,  300, genesis-num, 039,
AL, 20, 2020091618,   , BEST,   0, 168N,  502W,  85,  973, HU,  50, NEQ,   80,
   50,   30,   90, 1010,  180,  20, 105,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  300,  300,  240,  300, genesis-num, 039,
AL, 20, 2020091618,   , BEST,   0, 168N,  502W,  85,  973, HU,  64, NEQ,   30,
   25,    0,   30, 1010,  180,  20, 105,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  300,  300,  240,  300, genesis-num, 039,
AL, 20, 2020091700,   , BEST,   0, 174N,  511W,  85,  973, HU,  34, NEQ,  220,
  100,   80,  170, 1009,  210,  20, 100,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  330,  300,  270,  300, genesis-num, 039,
AL, 20, 2020091700,   , BEST,   0, 174N,  511W,  85,  973, HU,  50, NEQ,   60,
   50,   50,   70, 1009,  210,  20, 100,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  330,  300,  270,  300, genesis-num, 039,
AL, 20, 2020091700,   , BEST,   0, 174N,  511W,  85,  973, HU,  64, NEQ,   30,
   25,   20,   30, 1009,  210,  20, 100,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  330,  300,  270,  300, genesis-num, 039,
AL, 20, 2020091706,   , BEST,   0, 180N,  520W,  85,  973, HU,  34, NEQ,  220,
  100,   80,  170, 1009,  210,  20, 105,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  330,  360,  300,  300, genesis-num, 039,
AL, 20, 2020091706,   , BEST,   0, 180N,  520W,  85,  973, HU,  50, NEQ,   60,
   50,   50,   70, 1009,  210,  20, 105,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  330,  360,  300,  300, genesis-num, 039,
AL, 20, 2020091706,   , BEST,   0, 180N,  520W,  85,  973, HU,  64, NEQ,   30,
   25,   20,   30, 1009,  210,  20, 105,   0,   L,   0,    ,   0,   0,
          TEDDY, D, 12, NEQ,  330,  360,  300,  300, genesis-num, 039,
geoips.plugins.modules.sector_metadata_generators.bdeck_parser.call(trackfile_name)[source]#

TC deckfile parser for B-Deck files.

Each B-Deck file contains the full history of storm BEST tracks, one storm location per line. Example b-deck files are available in the GeoIPS repo.

Parameters:

trackfile_name (str) – Path to bdeck file, with full 6 hourly storm track history, formatted as follows:

Returns:

List of Dictionaries of storm metadata fields from each storm location

Return type:

list

See also

API Reference

Valid fields can be found in geoips.sector_utils.utils.SECTOR_INFO_ATTRS

geoips.plugins.modules.sector_metadata_generators.bdeck_parser.get_final_storm_name_bdeck(deck_lines, tcyear)[source]#

Get final storm name from full bdeck file.

geoips.plugins.modules.sector_metadata_generators.bdeck_parser.get_invest_number_bdeck(deck_lines)[source]#

Get invest number from full bdeck file.

geoips.plugins.modules.sector_metadata_generators.bdeck_parser.get_storm_start_datetime_from_bdeck_entry(deck_lines)[source]#

Get storm start datetime from full bdeck file.

geoips.plugins.modules.sector_metadata_generators.bdeck_parser.get_storm_start_datetime_from_bdeck_filename(bdeck_filename)[source]#

Get storm start datetime from bdeck file name.

geoips.plugins.modules.sector_metadata_generators.bdeck_parser.get_stormyear_from_bdeck_filename(bdeck_filename)[source]#

Get the storm year from the B-deck filename.

Parameters:

bdeck_filename (str) –

  • Path to deck file to search for storm year

  • Must be of format: xxxxxYYYY.dat - pulls YYYY from filename based on location

Returns:

Storm year

Return type:

int

geoips.plugins.modules.sector_metadata_generators.bdeck_parser.lat_to_dec(lat_str)[source]#

Return decimal latitude based on N/S specified string.

geoips.plugins.modules.sector_metadata_generators.bdeck_parser.lon_to_dec(lon_str)[source]#

Return decimal longitude based on E/W specified string.

geoips.plugins.modules.sector_metadata_generators.bdeck_parser.parse_bdeck_line(line, source_filename=None, storm_year=None, final_storm_name=None, invest_number=None, storm_start_datetime=None, original_storm_start_datetime=None, parser_name='bdeck_parser')[source]#

Retrieve the storm information from the current line from the deck file.

Parameters:

line (str) –

Current line from the deck file including all storm information

  • AL, 20, 2020091618, , BEST, 0, 168N, 502W, 85, 973, HU, 64, NEQ, 30, 25, 0, 30, 1010, 180, 20, 105, 0, L, 0, , 0, 0, TEDDY, D, 12, NEQ, 300, 300, 240, 300, genesis-num, 039,

  • AL, 20, 2020091700, , BEST, 0, 174N, 511W, 85, 973, HU, 34, NEQ, 220, 100, 80, 170, 1009, 210, 20, 100, 0, L, 0, , 0, 0, TEDDY, D, 12, NEQ, 330, 300, 270, 300, genesis-num, 039,

  • AL, 20, 2020091700, , BEST, 0, 174N, 511W, 85, 973, HU, 50, NEQ, 60, 50, 50, 70, 1009, 210, 20, 100, 0, L, 0, , 0, 0, TEDDY, D, 12, NEQ, 330, 300, 270, 300, genesis-num, 039,

Returns:

Dictionary of the fields from the current storm location from the deck file

Return type:

dict

See also

API Reference

Valid fields can be found in geoips.sector_utils.utils.SECTOR_INFO_ATTRS

geoips.plugins.modules.sector_metadata_generators.tc_sector_file_parser module#

TC trackfile parser for flat text sectorfiles containing current active storms.

These files contain no storm history, only the currently active storm locations. Potentially useful for real-time processing.

10S JOSHUA 210120 1200 21.8S 78.1E SHEM 20 1007 12S ELOISE 210120 1800 15.6S 44.9E SHEM 35 1001 92S INVEST 210120 1800 14.9S 120.8E SHEM 30 1002 93S INVEST 210120 1800 12.6S 98.5E SHEM 30 1003

geoips.plugins.modules.sector_metadata_generators.tc_sector_file_parser.NSEW_to_float(lat_lon_val)[source]#

Convert lat/lon values with NSEW identifiers to positive or negative floats.

Parameters:

lat_lon_val (str) – Latitude or longitude value as a string, with hemisphere specified by NSEW identifiers

Returns:

Latitude or Longitude value as a float.

Return type:

float

geoips.plugins.modules.sector_metadata_generators.tc_sector_file_parser.call(trackfile_name)[source]#

TC trackfile parser for flat text sectorfiles containing current active storms.

These files contain no storm history, only the currently active storm locations. Potentially useful for real-time processing.

Parameters:

trackfile_name (str) – Flat text sector file name containing all currently active storm locations, formatted as follows: * 10S JOSHUA 210120 1200 21.8S 78.1E SHEM 20 1007 * 12S ELOISE 210120 1800 15.6S 44.9E SHEM 35 1001 * 92S INVEST 210120 1800 14.9S 120.8E SHEM 30 1002 * 93S INVEST 210120 1800 12.6S 98.5E SHEM 30 1003

Returns:

List of Dictionaries of storm metadata fields from each storm location in the flat text sector file

Return type:

list

See also

API Reference

Valid fields can be found in geoips.sector_utils.utils.SECTOR_INFO_ATTRS

geoips.plugins.modules.sector_metadata_generators.tc_sector_file_parser.get_storm_year(storm_basin, current_month, current_year)[source]#

Ensure correct storm_year is applied.

For Southern Hemisphere storms that initiate late in the year, the storm year identifier is for the following year.

Parameters:
  • storm_basin (str) – basin of current storm, one of SH, AL, EP, CP, WP, IO

  • current_month (int) – Current month of storm location

  • current_year (int) – Current year of storm location

Returns:

Storm year identifier. current year, unless SH storm later than June, then current year + 1

Return type:

int

geoips.plugins.modules.sector_metadata_generators.tc_sector_file_parser.parse_flat_sectorfile_line(line, source_filename, parser_name='flat_sectorfile_parser')[source]#

Retrieve the storm information from the current line from the deck file.

Parameters:

line (str) – Current line from the deck file including all storm information * 10S JOSHUA 210120 1200 21.8S 78.1E SHEM 20 1007

Returns:

Dictionary of the fields from the current storm location from the deck file

Return type:

dict

See also

API Reference

Valid fields can be found in geoips.sector_utils.utils.SECTOR_INFO_ATTRS

Module contents#

GeoIPS trackfile parsers init file.