NordicFix

This module contains all the functions for fixing some common errors in nordic files before validating the Event. This happens when adding a nordic file into the database with “nordb insert” command using the –fix or -f flag. It wont fix everything, but it’s still better than nothing.

Errors that get fixed

  • When the magnitude of the main header is nAn which is not a possible value in a postgres database, the value will be set to None
  • If the ‘second’ value of the main header is 60.0, it will be turned into 00.00 and the minutes and hours will be adjusted accordingly
  • When the magnitude error of the error header is nAn which is not a possible value in a postgres database, the value will be set to none
  • If the ‘second’ value of the data header is 60.0, it will be turned into 00.00 and time info sign will be corrected if necessary
  • Time_info sign will be added to to the nordic data header if there is need for it
  • Zeros are put into singular dates and months in case they are missing.

Functions and Classes

fixErrorData(header, fixed_depth=None)

Method for fixing some of the common errors in error header.

Parameters:header (NordicError) – error header that need to be fixed
fixMainData(header)

Method for fixing some of the common errors in main header.

Parameters:header (NordicMain) – main header that needs to be fixed
fixPhaseData(data, main_datetime)

Method for fixing some of the common errors in phase data.

Parameters:
  • data (NordicData) – phase data that need to be fixed
  • datetime (main_datetime) – datetime of the first main header