-- H,C HSQC -- draws two arrows; 99% of HSQC peaks will fall between the two arrows -- it is known that a relation exists betwee the coordinates of a cross peak: -- H1_ppm = 0.053 13C_ppm + 0.852 -- the error can be as high as 2 or as low as -1.5 (tolerance) local T = {} -- tolerance T[1] = 2 -- max positive error T[2] = -1.5 -- max negative error (with minus sign) local C13 = getf 'x' -- coordinates of the spectrum, in ppm units local H1 = getf 'y' local transposed = false if (C13.atom ~= 'C' and H1.atom ~= 'C') or (C13.atom ~= 'H' and H1.atom ~= 'H') then print "this script requires an hetero-correlated H-C experiment" return end if C13.atom == 'H' and H1.atom == 'C' then local swap = H1 H1 = C13 C13 = swap transposed = true end local Xmin = C13.start -- limits of the spectrum local Xmax = C13.start + C13.width local Ymin = H1.start local Ymax = H1.start + H1.width for i = 1,2 do -- for each arrow local fromX, fromY, toX, toY -- coordinates of the arrow fromX = Xmin fromY = 0.053 * Xmin + 0.852 + T[i] if fromY < Ymin then fromY = Ymin fromX = (Ymin - 0.852 - T[i]) / 0.053 end toX = Xmax toY = 0.053 * Xmax + 0.852 + T[i] if toY > Ymax then toY = Ymax toX = (Ymax - 0.852 - T[i]) / 0.053 end if transposed then arrow( fromY, fromX, toY, toX, 0x380 ) else arrow( fromX, fromY, toX, toY, 0x380 ) end -- hollow arrow with two short points end amp()