public string splashIt(ISpectrum spectrum) { // check spectrum var if (spectrum == null) { throw new ArgumentNullException("The spectrum can't be null"); } StringBuilder hash = new StringBuilder(); //creating first block 'splash<type><version>' hash.Append(getFirstBlock(spectrum.getSpectrumType())); hash.Append('-'); //create prefilter block var filteredSpec = filterSpectrum(spectrum, 10, 0.1); Debug.WriteLine("filtered spectrum: " + filteredSpec.ToString()); var preFilterHistogram = getHistoBlock(filteredSpec, PREFILTER_BASE, PREFILTER_LENGTH, PREFILTER_BIN_SIZE); Debug.WriteLine("prefilter block: " + preFilterHistogram); var translated = translateBase(preFilterHistogram, PREFILTER_BASE, 36, 4); hash.Append(translated); hash.Append('-'); //create similarity block hash.Append(getHistoBlock(spectrum, SIMILARITY_BASE, SIMILARITY_LENGTH, SIMILARITY_BIN_SIZE)); hash.Append('-'); //create the spetrum hash block hash.Append(getSpectrumBlock(spectrum)); return(hash.ToString()); }
public string splashIt(ISpectrum spectrum) { // check spectrum var if (spectrum == null) { throw new ArgumentNullException("The spectrum can't be null"); } StringBuilder hash = new StringBuilder(); //creating first block 'splash<type><version>' hash.Append(getFirstBlock(spectrum.getSpectrumType())); hash.Append('-'); //create prefilter block hash.Append(translateBase(getHistoBlock(spectrum, PREFILTER_BASE, PREFILTER_LENGTH, PREFILTER_BIN_SIZE), PREFILTER_BASE, 36, 4)); hash.Append('-'); //create similarity block hash.Append(getHistoBlock(spectrum, SIMILARITY_BASE, SIMILARITY_LENGTH, SIMILARITY_BIN_SIZE)); hash.Append('-'); //create the spetrum hash block hash.Append(getSpectrumBlock(spectrum)); return hash.ToString(); }
public string splashIt(ISpectrum spectrum) { // check spectrum var if (spectrum == null) { throw new ArgumentNullException("The spectrum can't be null"); } StringBuilder hash = new StringBuilder(); //creating first block 'splash<type><version>' hash.Append(getFirstBlock(spectrum.getSpectrumType())); hash.Append('-'); //create prefilter block var filteredSpec = filterSpectrum(spectrum, 10, 0.1); Debug.WriteLine("filtered spectrum: " + filteredSpec.ToString()); var preFilterHistogram = getHistoBlock(filteredSpec, PREFILTER_BASE, PREFILTER_LENGTH, PREFILTER_BIN_SIZE); Debug.WriteLine("prefilter block: " + preFilterHistogram); var translated = translateBase(preFilterHistogram, PREFILTER_BASE, 36, 4); hash.Append(translated); hash.Append('-'); //create similarity block hash.Append(getHistoBlock(spectrum, SIMILARITY_BASE, SIMILARITY_LENGTH, SIMILARITY_BIN_SIZE)); hash.Append('-'); //create the spetrum hash block hash.Append(getSpectrumBlock(spectrum)); return hash.ToString(); }