Calibration Files

Calibration files are needed for sounders that can’t be directly calibrated such as SImrad ES70 systems (note that for the case of the Simrad ES70/ES60 a triangular wave correction has to be applied prior to importing the data into Echoview, see ES60 Adjust for more details.

A table for the different calibration settings for the Simrad ES70 can be found here (for other systems refer to this link)

 

Normal application of calibration settings in Echoview through R

  1. Edit the Echoview Calibration File with information gained from the Calibration and save it as MyCalibration.ecs
    # – Ignores the line, just remove it to apply the settings to the fileset
    Add or remove SourceCal Tx paragraphs depending on available frequencies (4 in the example below)

    #========================================================================================#
    #               ECHOVIEW CALIBRATION SUPPLEMENT (.ECS) FILE (SimradEK60Raw)              #
    #                                   7/05/2015 21:13:02                                   #
    #========================================================================================#
    #       +----------+   +-----------+   +----------+   +-----------+   +----------+       #
    #       | Default  |-->| Data File |-->| Fileset  |-->| SourceCal |-->| LocalCal |       #
    #       | Settings |   | Settings  |   | Settings |   | Settings  |   | Settings |       #
    #       +----------+   +-----------+   +----------+   +-----------+   +----------+       #
    # - Settings to the right override those to their left.                                  #
    # - See the Help file page "About calibration".                                          #
    #========================================================================================#
    
    Version 1.00
    
    
    #========================================================================================#
    #                                    FILESET SETTINGS                                    #
    #========================================================================================#
    
      SoundSpeed = 1541.21 # (meters per second) [1400.00..1700.00]
    # TvgRangeCorrection = SimradEx60 # [None, BySamples, SimradEx500, SimradEx60, BioSonics, Kaijo, PulseLength, Ex500Forced]
    # TvgRangeCorrectionOffset = # (samples) [-10000.00..10000.00]
    
    
    #========================================================================================#
    #                                   SOURCECAL SETTINGS                                   #
    #========================================================================================#
    
    SourceCal T1
        # WedgeVolumeBeamAngle = # (degrees) [0.00..359.99]
        # AbsorptionCoefficient = 0.0026547 # (decibels per meter) [0.0000000..100.0000000]
          EK60SaCorrection = -1.5 # (decibels) [-99.9900..99.9900]
          Ek60TransducerGain = 18.8 # (decibels) [1.0000..99.0000]
        # Frequency = 18.00 # (kilohertz) [0.01..10000.00]
        # MajorAxis3dbBeamAngle = 10.80 # (degrees) [0.00..359.99]
        # MajorAxisAngleOffset = 0.00 # (degrees) [-9.99..9.99]
        # MinorAxis3dbBeamAngle = 10.80 # (degrees) [0.00..359.99]
        # MinorAxisAngleOffset = 0.00 # (degrees) [-9.99..9.99]
        # SoundSpeed = 1500.00 # (meters per second) [1400.00..1700.00]
        # TransmittedPower = 2000.00000 # (watts) [1.00000..30000.00000]
        # TransmittedPulseLength = 0.512 # (milliseconds) [0.001..50.000]
        # TvgRangeCorrection = SimradEx60 # [None, BySamples, SimradEx500, SimradEx60, BioSonics, Kaijo, PulseLength, Ex500Forced]
        # TwoWayBeamAngle = -17.000000 # (decibels re 1 steradian) [-99.000000..-1.000000]
    
    SourceCal T2
        # AbsorptionCoefficient = 0.0097472 # (decibels per meter) [0.0000000..100.0000000]
          EK60SaCorrection = -1.0100 # (decibels) [-99.9900..99.9900]
          Ek60TransducerGain = 22.8100 # (decibels) [1.0000..99.0000]
        # Frequency = 38.00 # (kilohertz) [0.01..10000.00]
        # MajorAxis3dbBeamAngle = 9.60 # (degrees) [0.00..359.99]
        # MajorAxisAngleOffset = 0.00 # (degrees) [-9.99..9.99]
        # MajorAxisAngleSensitivity = 18.299999 # [0.100000..100.000000]
        # MinorAxis3dbBeamAngle = 9.60 # (degrees) [0.00..359.99]
        # MinorAxisAngleOffset = 0.00 # (degrees) [-9.99..9.99]
        # MinorAxisAngleSensitivity = 18.299999 # [0.100000..100.000000]
        # SoundSpeed = 1500.00 # (meters per second) [1400.00..1700.00]
        # TransmittedPower = 1500.00000 # (watts) [1.00000..30000.00000]
        # TransmittedPulseLength = 0.256 # (milliseconds) [0.001..50.000]
        # TvgRangeCorrection = SimradEx60 # [None, BySamples, SimradEx500, SimradEx60, BioSonics, Kaijo, PulseLength, Ex500Forced]
        # TwoWayBeamAngle = -18.000000 # (decibels re 1 steradian) [-99.000000..-1.000000]
    
    SourceCal T3
        # AbsorptionCoefficient = 0.0373058 # (decibels per meter) [0.0000000..100.0000000]
          EK60SaCorrection = -0.6500 # (decibels) [-99.9900..99.9900]
          Ek60TransducerGain = 26.8900 # (decibels) [1.0000..99.0000]
        # Frequency = 120.00 # (kilohertz) [0.01..10000.00]
        # MajorAxis3dbBeamAngle = 7.00 # (degrees) [0.00..359.99]
        # MajorAxisAngleOffset = 0.00 # (degrees) [-9.99..9.99]
        # MajorAxisAngleSensitivity = 23.000000 # [0.100000..100.000000]
        # MinorAxis3dbBeamAngle = 7.00 # (degrees) [0.00..359.99]
        # MinorAxisAngleOffset = 0.00 # (degrees) [-9.99..9.99]
        # MinorAxisAngleSensitivity = 23.000000 # [0.100000..100.000000]
        # SoundSpeed = 1500.00 # (meters per second) [1400.00..1700.00]
        # TransmittedPower = 1000.00000 # (watts) [1.00000..30000.00000]
        # TransmittedPulseLength = 0.064 # (milliseconds) [0.001..50.000]
        # TvgRangeCorrection = SimradEx60 # [None, BySamples, SimradEx500, SimradEx60, BioSonics, Kaijo, PulseLength, Ex500Forced]
        # TwoWayBeamAngle = -21.000000 # (decibels re 1 steradian) [-99.000000..-1.000000]
    
    SourceCal T4
        # AbsorptionCoefficient = 0.0525231 # (decibels per meter) [0.0000000..100.0000000]
          EK60SaCorrection = -1.54 # (decibels) [-99.9900..99.9900]
          Ek60TransducerGain = 23.96000 # (decibels) [1.0000..99.0000]
        # Frequency = 200.00 # (kilohertz) [0.01..10000.00]
        # MajorAxis3dbBeamAngle = 7.00 # (degrees) [0.00..359.99]
        # MajorAxisAngleOffset = 0.00 # (degrees) [-9.99..9.99]
        # MinorAxis3dbBeamAngle = 7.00 # (degrees) [0.00..359.99]
        # MinorAxisAngleOffset = 0.00 # (degrees) [-9.99..9.99]
        # SoundSpeed = 1500.00 # (meters per second) [1400.00..1700.00]
        # TransmittedPower = 1000.00000 # (watts) [1.00000..30000.00000]
        # TransmittedPulseLength = 0.064 # (milliseconds) [0.001..50.000]
        # TvgRangeCorrection = SimradEx60 # [None, BySamples, SimradEx500, SimradEx60, BioSonics, Kaijo, PulseLength, Ex500Forced]
        # TwoWayBeamAngle = -20.700001 # (decibels re 1 steradian) [-99.000000..-1.000000]
    
    
    #========================================================================================#
    #                                    LOCALCAL SETTINGS                                   #
    #========================================================================================#
    
  2. Add the calibration file to the fileset using EchoviewR
    
    #load libraries
    library(RDCOMClient)
    
    #Load EchoViewR
    source("D:\\Projects\\Carolina_M Echoview\\R\\EchoviewR.R")
    
    #Always start with opening an Echoview instance through COM interaction
    #Open Echoview - create a COM Connection
    EVAppObj <- COMCreate('EchoviewCom.EvApplication')
    #Create a new EV File
    EVFile <- EVNewFile(EVAppObj)$EVFile
    #Add Raw Data 
    EVAddRawData(EVFile, "Fileset1", "myRawFIle.Raw") 
    #Find a fileset 
    EVFindFilesetByName(EVFile, "Fileset1") 
    #Add Calibration FIle 
    EVAddCalibrationFile(EVFile, "Fileset1", "MyCalibration.ecs") 
    

    Varying transducer order, generate a new calibration file based on the given order

    The above code will work as long as the names and order of the transducers remains the same. It can happen, especially when raw data is collected without supervision that transducer numbers will change. If this happen the wrong calibration settings will be applied to the transducer, therefor it is recommended to build in a check for this matter which adopts the calibration file:

    #Function to generate calibration file based on given settings
    #fileout = the name of the file to be written
    #freqs = the number of available frequencies
    
    cal_config <- function(fileout, nfreqs){
    
      if(exists(fileout)){rm(fileout)}
        file.create(fileout)
      fConn <- file(paste(fileout,sep=""), 'r+')
      header<-(' #========================================================================================# # ECHOVIEW CALIBRATION SUPPLEMENT (.ECS) FILE (SimradEK60Raw) # # 7/05/2015 21:13:02 # #========================================================================================# # +----------+ +-----------+ +----------+ +-----------+ +----------+ # # | Default |-->| Data File |-->| Fileset  |-->| SourceCal |-->| LocalCal |       #
    #       | Settings |   | Settings  |   | Settings |   | Settings  |   | Settings |       #
    #       +----------+   +-----------+   +----------+   +-----------+   +----------+       #
    # - Settings to the right override those to their left.                                  #
    # - See the Help file page \"About calibration\".                                          #
    #========================================================================================#
    
    Version 1.00
    
    
    #========================================================================================#
    #                                    FILESET SETTINGS                                    #
    #========================================================================================#
    
      SoundSpeed = 1541.21 # (meters per second) [1400.00..1700.00]
    # TvgRangeCorrection = SimradEx60 # [None, BySamples, SimradEx500, SimradEx60, BioSonics, Kaijo, PulseLength, Ex500Forced]
    # TvgRangeCorrectionOffset = # (samples) [-10000.00..10000.00]
    
    
    #========================================================================================#
    #                                   SOURCECAL SETTINGS                                   #
    #========================================================================================#
    
    ')
      
      writeLines(header,con=fConn)
      for (a in 1:nfreqs){
        #check if transducer exists
        if(is.null(EVFile[["Variables"]]$FindByName(paste("Fileset1: Sv raw pings T",a,sep="")))==FALSE){
          EVVar<-EVFile[["Variables"]]$FindByName(paste("Fileset1: Sv raw pings T",a,sep=""))
          #get the frequency
          f <-EVVar[["Properties"]][["Calibration"]]$Get("Frequency",0)
          f<-as.numeric(f)
          #read the settings for the given frequency
          cal_tmp <- readLines(paste(f,"kHz.txt",sep=""))
          #write information into the calibration file
          writeLines(paste("\nSourceCal ",a,sep=""),con = fConn)
          writeLines(paste(cal_tmp),con = fConn)
      }}
    foot<-('
    
    #========================================================================================#
    #                                    LOCALCAL SETTINGS                                   #
    #========================================================================================#
           
           ')
    writeLines(foot,con=fConn)
    close(fConn)
    }
    
    #Example
    #Create a file with the calibration settings for each frequency, saved as for example 18kHz.txt, 38kHz.txt, etc.
    #Example file, 18kHz.txt:
    # SourceCal T1
    #  #WedgeVolumeBeamAngle = # (degrees) [0.00..359.99]
    #  #AbsorptionCoefficient = 0.0026547 # (decibels per meter) [0.0000000..100.0000000]
    #  EK60SaCorrection = -1.5 # (decibels) [-99.9900..99.9900]
    #  Ek60TransducerGain = 18.8 # (decibels) [1.0000..99.0000]
    #  #Frequency = 18.00 # (kilohertz) [0.01..10000.00]
    #  #MajorAxis3dbBeamAngle = 10.80 # (degrees) [0.00..359.99]
    #  #MajorAxisAngleOffset = 0.00 # (degrees) [-9.99..9.99]
    #  #MinorAxis3dbBeamAngle = 10.80 # (degrees) [0.00..359.99]
    #  #MinorAxisAngleOffset = 0.00 # (degrees) [-9.99..9.99]
    #  #SoundSpeed = 1500.00 # (meters per second) [1400.00..1700.00]
    #  #TransmittedPower = 2000.00000 # (watts) [1.00000..30000.00000]
    #  #TransmittedPulseLength = 0.512 # (milliseconds) [0.001..50.000]
    #  #TvgRangeCorrection = SimradEx60 # [None, BySamples, SimradEx500, SimradEx60, BioSonics, Kaijo, PulseLength, Ex500Forced]
    #  #TwoWayBeamAngle = -17.000000 # (decibels re 1 steradian) [-99.000000..-1.000000]
    
    
    fileout="D:\\newCal1.ecs"
    setwd("D:\\R\\")
    cal_config("newcal.txt",4)