def merge(ds, measurement, cardinality)

      m = ds.select {|k,v| k != :measurements and k != :errors and k != :warn }
      m = m.merge(measurement)
      m = m.merge ({ technology: "argos",
        type: type,
        cardinality: cardinality
        #file: "file://"+filename,
        #source: sha1
      })

      # if not ds[:errors].nil? and ds[:errors].any?
      #   m[:errors] = ds[:errors].clone
      # end
      #
      # if not ds[:warn].nil? and ds[:warn].any?
      #   m[:warn] = ds[:warn].clone
      # end
      #
      # if not m[:sensor_data].nil? and m[:sensor_data].size != ds[:sensors]
      #   if m[:warn].nil?
      #     m[:warn] = []
      #   end
      #   m[:warn] << "sensors-count-mismatch"
      # end

      # Create id as SHA1 hash of measurement minus stuff that may vary (like filename)
      #
      # Possible improvement for is to base id on a static list of keys
      # :program,
      # :platform,
      # :lines,
      # :sensors,
      # :satellite,
      # :lc,
      # :positioned,
      # :latitude,
      # :longitude,
      # :altitude,
      # :headers,
      # :measured,
      # :identical,
      # :sensor_data,
      # :technology,
      # :type,
      # :source

      idbase = m.clone
      idbase.delete :errors
      idbase.delete :file
      idbase.delete :warn

      id = Digest::SHA1.hexdigest(idbase.to_json)

      #m[:parser] = Argos.library_version
      m[:id] = id

      #m[:bundle] = bundle
      m
    end
def merge(ds, measurement, cardinality)

      m = ds.select {|k,v| k != :measurements and k != :errors and k != :warn }
      m = m.merge(measurement)
      m = m.merge ({ technology: "argos",
        type: type,
        cardinality: cardinality
        #file: "file://"+filename,
        #source: sha1
      })

      # if not ds[:errors].nil? and ds[:errors].any?
      #   m[:errors] = ds[:errors].clone
      # end
      #
      # if not ds[:warn].nil? and ds[:warn].any?
      #   m[:warn] = ds[:warn].clone
      # end
      #
      # if not m[:sensor_data].nil? and m[:sensor_data].size != ds[:sensors]
      #   if m[:warn].nil?
      #     m[:warn] = []
      #   end
      #   m[:warn] << "sensors-count-mismatch"
      # end

      # Create id as SHA1 hash of measurement minus stuff that may vary (like filename)
      #
      # Possible improvement for is to base id on a static list of keys
      # :program,
      # :platform,
      # :lines,
      # :sensors,
      # :satellite,
      # :lc,
      # :positioned,
      # :latitude,
      # :longitude,
      # :altitude,
      # :headers,
      # :measured,
      # :identical,
      # :sensor_data,
      # :technology,
      # :type,
      # :source

      idbase = m.clone
      idbase.delete :errors
      idbase.delete :file
      idbase.delete :warn

      id = Digest::SHA1.hexdigest(idbase.to_json)

      #m[:parser] = Argos.library_version
      m[:id] = id

      #m[:bundle] = bundle
      m
    end
Merges a DS header hash into each measurement
 @return [Array] Measurements with header and static metadata merged in