GempakSurface#

class metpy.io.GempakSurface(file, *args, **kwargs)#

Subclass of GempakFile specific to GEMPAK surface data.

Instantiate GempakFile object from file.

Attributes Summary

data_management_fmt

grid_anl_fmt1

grid_anl_fmt2

grid_nav_fmt

prod_desc_fmt

Methods Summary

__init__(file, *args, **kwargs)

Instantiate GempakFile object from file.

nearest_time(date_time[, station_id, ...])

Get nearest observation to given time for selected stations.

sfinfo()

Return station information.

sfjson([station_id, station_number, ...])

Select surface stations and output as list of JSON objects.

Attributes Documentation

data_management_fmt = [('next_free_word', 'i'), ('max_free_pairs', 'i'), ('actual_free_pairs', 'i'), ('last_word', 'i'), ('free_word1', 'i'), ('free_word2', 'i'), ('free_word3', 'i'), ('free_word4', 'i'), ('free_word5', 'i'), ('free_word6', 'i'), ('free_word7', 'i'), ('free_word8', 'i'), ('free_word9', 'i'), ('free_word10', 'i'), ('free_word11', 'i'), ('free_word12', 'i'), ('free_word13', 'i'), ('free_word14', 'i'), ('free_word15', 'i'), ('free_word16', 'i'), ('free_word17', 'i'), ('free_word18', 'i'), ('free_word19', 'i'), ('free_word20', 'i'), ('free_word21', 'i'), ('free_word22', 'i'), ('free_word23', 'i'), ('free_word24', 'i'), ('free_word25', 'i'), ('free_word26', 'i'), ('free_word27', 'i'), ('free_word28', 'i')]#
grid_anl_fmt1 = [('analysis_type', 'f'), ('delta_n', 'f'), ('delta_x', 'f'), ('delta_y', 'f'), (None, '4x'), ('garea_llcr_lat', 'f'), ('garea_llcr_lon', 'f'), ('garea_urcr_lat', 'f'), ('garea_urcr_lon', 'f'), ('extarea_llcr_lat', 'f'), ('extarea_llcr_lon', 'f'), ('extarea_urcr_lat', 'f'), ('extarea_urcr_lon', 'f'), ('datarea_llcr_lat', 'f'), ('datarea_llcr_lon', 'f'), ('datarea_urcr_lat', 'f'), ('datarea_urcrn_lon', 'f'), (None, '444x')]#
grid_anl_fmt2 = [('analysis_type', 'f'), ('delta_n', 'f'), ('grid_ext_left', 'f'), ('grid_ext_down', 'f'), ('grid_ext_right', 'f'), ('grid_ext_up', 'f'), ('garea_llcr_lat', 'f'), ('garea_llcr_lon', 'f'), ('garea_urcr_lat', 'f'), ('garea_urcr_lon', 'f'), ('extarea_llcr_lat', 'f'), ('extarea_llcr_lon', 'f'), ('extarea_urcr_lat', 'f'), ('extarea_urcr_lon', 'f'), ('datarea_llcr_lat', 'f'), ('datarea_llcr_lon', 'f'), ('datarea_urcr_lat', 'f'), ('datarea_urcrn_lon', 'f'), (None, '440x')]#
grid_nav_fmt = [('grid_definition_type', 'f'), ('projection', '3sx', <method 'decode' of 'bytes' objects>), ('left_grid_number', 'f'), ('bottom_grid_number', 'f'), ('right_grid_number', 'f'), ('top_grid_number', 'f'), ('lower_left_lat', 'f'), ('lower_left_lon', 'f'), ('upper_right_lat', 'f'), ('upper_right_lon', 'f'), ('proj_angle1', 'f'), ('proj_angle2', 'f'), ('proj_angle3', 'f'), (None, '972x')]#
prod_desc_fmt = [('version', 'i'), ('file_headers', 'i'), ('file_keys_ptr', 'i'), ('rows', 'i'), ('row_keys', 'i'), ('row_keys_ptr', 'i'), ('row_headers_ptr', 'i'), ('columns', 'i'), ('column_keys', 'i'), ('column_keys_ptr', 'i'), ('column_headers_ptr', 'i'), ('parts', 'i'), ('parts_ptr', 'i'), ('data_mgmt_ptr', 'i'), ('data_mgmt_length', 'i'), ('data_block_ptr', 'i'), ('file_type', 'i', <enum 'FileTypes'>), ('data_source', 'i', <function _data_source>), ('machine_type', 'i'), ('missing_int', 'i'), (None, '12x'), ('missing_float', 'f')]#

Methods Documentation

__init__(file, *args, **kwargs)[source]#

Instantiate GempakFile object from file.

nearest_time(date_time, station_id=None, station_number=None)[source]#

Get nearest observation to given time for selected stations.

Parameters
  • date_time (datetime or array-like of datetime) – Valid/observed datetime of the surface station. Alternatively object or a string with the format YYYYmmddHHMM.

  • station_id (str or array-like of str) – Station ID of the surface station.

  • station_number (int or array-like of int) – Station number of the surface station.

Returns

list – List of dicts/JSONs for each surface station.

Notes

One of either station_id or station_number must be used. If both are present, station_id will take precedence.

sfinfo()[source]#

Return station information.

sfjson(station_id=None, station_number=None, date_time=None, state=None, country=None)[source]#

Select surface stations and output as list of JSON objects.

Subset the data by parameter values. The default is to not subset and return the entire dataset.

Parameters
  • station_id (str or array-like of str) – Station ID of the surface station.

  • station_number (int or array-like of int) – Station number of the surface station.

  • date_time (datetime or array-like of datetime) – Valid datetime of the grid. Alternatively can be a string with the format YYYYmmddHHMM.

  • state (str or array-like of str) – State where surface station is located.

  • country (str or array-like of str) – Country where surface station is located.

Returns

list – List of dicts/JSONs for each surface station.