#!/usr/local/bin/perl -w # shift-peaks v. 7 Apr 1996, Dave Schweisguth # Applies linear (0 and 1st-order) corrections to peak centers in a Felix # peaks entity. Useful when transferring a set of picked peaks from one # matrix to another with the same sample but different spectral parameters. $a1 = 35; # 1st-order correction to D1 $b1 = -0.0389; # 2nd-order correction to D1 $a2 = 35; # 1st-order correction to D2 $b2 = -0.0389; # 2nd-order correction to D2 print scalar(<>), scalar(<>); # c** and xpk lines foreach (<>) { /^( .{5})(.{10})(.{10} .{5} .{16})(.{10})(.{10} .{5} .{16}.{10}\n)/o; $d1 = $a1 + (1 + $b1) * $2; $d2 = $a2 + (1 + $b2) * $4; print $1, sprintf("%10.3f", $d1), $3, sprintf("%10.3f", $d2), $5; }