Decoding SHEF-Encoded Data


Hydro-meteorolgical data is often exchanged in SHEF-encoded format. The data is provided in text files with the format well documented in many locations, including at https://repository.library.noaa.gov/view/noaa/14450

Decoding SHEF-Encoded data is very straightforward and DataWise® provides numerous tools to do that. Acquiring SHEF-encoded data can be done in several ways.

  • Via FTP / SFTP / FTPS
  • Through a TCP/IP Socket
  • Through a Shared Network Drive

  • No matter the mechanism of receiving the SHEF-encoded files is, they must be placed in a directory accessible by the DataWise® software suite. To decode SHEF-encoded files, the file shef_sensors.cfg located in the sub-directory SHEF must contain decoding information regarding sensors to be decoded. The format of the file should be as follows:

    Sensor_ID     SHEF_ID         Physical_Element
    
    Where:
    
      Sensor_ID is the DataWise®  sensor ID
      SHEF_ID is the SHEF Identifier
      Physical_Element is the parameter being measured (i.e., HG, PC, etc.)
    
    Note that a SHEF_ID is a 5-character tag assigned by the NWS.

    To process incoming SHEF-encoded data, add the following line to the dwtask.cfg file:

    \DataWise\Config\shef_decoder_nh.exe [+d] d=directory [p=period] [c=copy] [o=offset] [z=TZ] [+noDelete]

    Where:
        directory is the directory in which SHEF-encoded files are being stored in.
        period is the frequency (in seconds) to check the directory for new files.
            (default is 5)
        copy is the instance of shef_decoder_nh.exe.
            (default is 1)
        offset is the number of minutes to adjust readings most likely for hosted computer in a different timezone.
            (default is 0)
        TZ is the timezone that the computer running DataWise®  is in.
            (default is taken from the system's TZ environment variable)