def combine_header_with_transmission(measurements, header)
      unless header.is_a? Array
        header = header.split(" ")
      end
      latitude = longitude = positioned = nil
      warn = []
      errors = []

      lc = header[5]

      if not header[6].nil? and not header[7].nil?
        positioned = convert_datetime(header[6]+" "+header[7])
      end

      if header[8] != nil && valid_float?(header[8])
        latitude = header[8].to_f
      end

      if header[9] != nil && valid_float?(header[9])
        longitude = header[9].to_f
        if (180..360).include? longitude
          longitude = (longitude - 360)
        end
      end

      altitude = header[10]
      if not altitude.nil?
         altitude = altitude.to_f*1000
      end

      if positioned.nil? and measurements.nil?
        warn << "missing-time"
      end

      if latitude.nil? or longitude.nil?
        #warn << "missing-position"
      else

        unless latitude.between?(-90, 90) and longitude.between?(-180, 180)
          errors << "invalid-position"
        end
      end

      unless LOCATION_CLASS.include? lc
        errors << "invalid-lc"
      end

      # Satellites
      #  ["A", "B", "K", "L", "M", "N", "P", "R"]

      document = { program:  header[0].to_i,
        platform: header[1].to_i,
        lines: header[2].to_i,
        sensors: header[3].to_i,
        satellite: header[4],
        lc: lc,
        positioned: positioned,
        latitude: latitude,
        longitude: longitude,
        altitude: altitude,
        measurements: measurements,
        headers: header.size
      }
      if warn.any?
        document[:warn]=warn
      end
      if errors.any?
        document[:errors]=errors
      end

      document
    end
def combine_header_with_transmission(measurements, header)
      unless header.is_a? Array
        header = header.split(" ")
      end
      latitude = longitude = positioned = nil
      warn = []
      errors = []

      lc = header[5]

      if not header[6].nil? and not header[7].nil?
        positioned = convert_datetime(header[6]+" "+header[7])
      end

      if header[8] != nil && valid_float?(header[8])
        latitude = header[8].to_f
      end

      if header[9] != nil && valid_float?(header[9])
        longitude = header[9].to_f
        if (180..360).include? longitude
          longitude = (longitude - 360)
        end
      end

      altitude = header[10]
      if not altitude.nil?
         altitude = altitude.to_f*1000
      end

      if positioned.nil? and measurements.nil?
        warn << "missing-time"
      end

      if latitude.nil? or longitude.nil?
        #warn << "missing-position"
      else

        unless latitude.between?(-90, 90) and longitude.between?(-180, 180)
          errors << "invalid-position"
        end
      end

      unless LOCATION_CLASS.include? lc
        errors << "invalid-lc"
      end

      # Satellites
      #  ["A", "B", "K", "L", "M", "N", "P", "R"]

      document = { program:  header[0].to_i,
        platform: header[1].to_i,
        lines: header[2].to_i,
        sensors: header[3].to_i,
        satellite: header[4],
        lc: lc,
        positioned: positioned,
        latitude: latitude,
        longitude: longitude,
        altitude: altitude,
        measurements: measurements,
        headers: header.size
      }
      if warn.any?
        document[:warn]=warn
      end
      if errors.any?
        document[:errors]=errors
      end

      document
    end
@param [String] header
 Header is is a space-separated string containing
   [0] Program number
   [1] Platform number
   [2] Number of lines of data per satellite pass
   [3] Number of sensors
   [4] Satellite identifier
   [5] Location class (lc)
   [6] Location date 2007-03-02
   [7] Location UTC time
   [8] Latitude (decimal degrees)
   [9] Longitude, may be > 180 like 255.452°, equivalent to 255.452 - 360 = -104.548 (°E)
  [10] Altitude (km)
  [11] Frequency (calculated)

 The header varies in information elemenet, often either 0..4|5 or 0..11.
 Header examples (plit on " "):
  ["09660", "10788", "4", "3", "D", "0"]
  ["09660", "10788", "5", "3", "H", "2", "1992-04-06", "22:12:16", "78.248", "15.505", "0.000", "401649604"]
  ["09660", "10788", "2", "3", "D"]
 http://www.argos-system.org/files/pmedia/public/r363_9_argos_users_manual-v1.5.pdf page 42

 Warning, the parser does not support this header format from 1989 [AUO89.DAT]
 19890800-19891000: ["09660", "14653", "10", "41", "14", "1", "-.42155E+1", "00", "112", "17DD"]