def create_diag_hash(contact="")
      platform = contact[/^(\d{5,})/,1]
      location_data = contact[/Date : (\d{2}.\d{2}.\d{2} \d{2}:\d{2}:\d{2})/,1]
      contact_time = convert_date(location_data) unless location_data ==nil
      lc = contact[/LC : (3|2|1|0|A|B|Z)/,1]
      li = contact[/LI : *(\-?\d+)/,1]
      iq= contact[/IQ : *(\d{2})/,1]
      lat1= contact[/Lat1 : +(\d+\.\d{3}[NS]|\?+)/,1]
      lat1 = coordinate_conv(lat1)
      lon1= contact[/Lon1 : +(\d+\.\d{3}[EW]|\?+)/,1]
      lon1 = coordinate_conv(lon1)
      lat2= contact[/Lat2 : +(\d+\.\d{3}[NS]|\?+)/,1]
      lat2 = coordinate_conv(lat2)
      lon2= contact[/Lon2 : +(\d+\.\d{3}[EW]|\?+)/,1]
      lon2 = coordinate_conv(lon2)
      nb= contact[/Nb mes : (\d{3})/,1]
      nb120= contact[/Nb mes>-120(Db|dB) : (\d{3})/,2]
      best_level= contact[/Best level : (-\d{3})/,1]
      pass_duration= contact[/Pass duration : +(\d+|\?)/,1]
      dist_track= contact[/Dist track : +(\d+)/,1]
      nopc= contact[/NOPC : +([0-4]|\?)/,1]
      nopc = nopc =~/\?+/ ? nil : nopc
      nopc.to_i unless nopc == nil
      frequency = contact[/Calcul freq : +(\d{3} \d+\.\d+)/,1]
      if frequency =~ /[ ]/
        frequency = frequency.split(" ").join("").to_f
      end
      altitude= contact[/Altitude : +(\d+)? m/,1]
      altitude = altitude.to_i unless altitude == nil
  
      data_start = contact.index(" m ")
      sensor_data = contact[data_start+2,contact.length].split(" ") unless data_start == nil
     
      diag = { platform: platform.to_i,
        measured: contact_time,
        lc: lc,
        iq: iq,
        li: li,
        latitude: lat1,
        longitude: lon1,
        latitude2: lat2,
        longitude2: lon2,
        messages: nb.to_i,
        messages_120dB: nb120.to_i,
        best_level: best_level.to_i,
        pass_duration: pass_duration.to_i,
        dist_track: dist_track,
        nopc: nopc.to_i,
        frequency: frequency,
        altitude: altitude,
        sensor_data: sensor_data,
        technology: "argos",
        type: type,
        filename: "file://"+filename,
        #source: "#{sha1}",
      }

      idbase = diag.clone
      idbase.delete :filename
      id = Digest::SHA1.hexdigest(idbase.to_json)

      #diag[:parser] = Argos.library_version
      diag[:id] = id
      #diag[:bundle] = bundle
      if @program
        diag[:program] = @program
      end
      
      
      diag
    end
def create_diag_hash(contact="")
      platform = contact[/^(\d{5,})/,1]
      location_data = contact[/Date : (\d{2}.\d{2}.\d{2} \d{2}:\d{2}:\d{2})/,1]
      contact_time = convert_date(location_data) unless location_data ==nil
      lc = contact[/LC : (3|2|1|0|A|B|Z)/,1]
      li = contact[/LI : *(\-?\d+)/,1]
      iq= contact[/IQ : *(\d{2})/,1]
      lat1= contact[/Lat1 : +(\d+\.\d{3}[NS]|\?+)/,1]
      lat1 = coordinate_conv(lat1)
      lon1= contact[/Lon1 : +(\d+\.\d{3}[EW]|\?+)/,1]
      lon1 = coordinate_conv(lon1)
      lat2= contact[/Lat2 : +(\d+\.\d{3}[NS]|\?+)/,1]
      lat2 = coordinate_conv(lat2)
      lon2= contact[/Lon2 : +(\d+\.\d{3}[EW]|\?+)/,1]
      lon2 = coordinate_conv(lon2)
      nb= contact[/Nb mes : (\d{3})/,1]
      nb120= contact[/Nb mes>-120(Db|dB) : (\d{3})/,2]
      best_level= contact[/Best level : (-\d{3})/,1]
      pass_duration= contact[/Pass duration : +(\d+|\?)/,1]
      dist_track= contact[/Dist track : +(\d+)/,1]
      nopc= contact[/NOPC : +([0-4]|\?)/,1]
      nopc = nopc =~/\?+/ ? nil : nopc
      nopc.to_i unless nopc == nil
      frequency = contact[/Calcul freq : +(\d{3} \d+\.\d+)/,1]
      if frequency =~ /[ ]/
        frequency = frequency.split(" ").join("").to_f
      end
      altitude= contact[/Altitude : +(\d+)? m/,1]
      altitude = altitude.to_i unless altitude == nil
  
      data_start = contact.index(" m ")
      sensor_data = contact[data_start+2,contact.length].split(" ") unless data_start == nil
     
      diag = { platform: platform.to_i,
        measured: contact_time,
        lc: lc,
        iq: iq,
        li: li,
        latitude: lat1,
        longitude: lon1,
        latitude2: lat2,
        longitude2: lon2,
        messages: nb.to_i,
        messages_120dB: nb120.to_i,
        best_level: best_level.to_i,
        pass_duration: pass_duration.to_i,
        dist_track: dist_track,
        nopc: nopc.to_i,
        frequency: frequency,
        altitude: altitude,
        sensor_data: sensor_data,
        technology: "argos",
        type: type,
        filename: "file://"+filename,
        #source: "#{sha1}",
      }

      idbase = diag.clone
      idbase.delete :filename
      id = Digest::SHA1.hexdigest(idbase.to_json)

      #diag[:parser] = Argos.library_version
      diag[:id] = id
      #diag[:bundle] = bundle
      if @program
        diag[:program] = @program
      end
      
      
      diag
    end
http://www.argos-system.org/files/pmedia/public/r363_9_argos_users_manual-v1.5.pdf p. 48
Nb mes : 025 Number of messages received
Nb mes>-120 dB: 015 Number of messages received by the satellite at a signal strength greater than -120 decibels
Best level : -113 dB Best signal strength, units are dB
Pass duration : 900s Time elapsed between the first and last message received by the
satellite
NOPC = 4 Number Of Plausibility Checks successful (from 0-4)
Calcul Freq : 401 650000.3 Calculated frequency
Altitude : 213 m Altitude used for location calculation