Changes

Jump to navigation Jump to search
<source lang="perl">
#! /usr/bin/perl
# Creates a peak list for seriesTab given a
# nmrPipe spektrum and a Sparky peak list
#
# usage: stPeakList [pipe spectrum] [Sparky peak list]
#
# Kaare Teilum 061025
# Modified 131008 by Troels E. Linnet
$pipeFile = $ARGV[0];
$sparkyList = $ARGV[1];
open HDR, "showhdr $pipeFile |" or die "can't run: showhdr $pipeFile";
while (<HDR>){
};
close(HDR);
$stepX=$swX/$frqX/$sizeX;
$highX=($origX+$swX)/$frqX;
$highX2SW=($origX+2*$swX)/$frqX;
$stepY=$swY/$frqY/$sizeY;
$highY=($origY+$swY)/$frqY;
$highY2SW=($origY+2*$swY)/$frqY;
$i=1;
print "VARS INDEX X_AXIS Y_AXIS X_PPM Y_PPM VOL ASSX1 X3 Y1 Y3\n";print "FORMAT %5d %9.3f %9.3f %8.3f %8.3f %+e %s%4d %4d %4d %4d\n\n";
open IN, "$sparkyList" or die "Cannot open $sparkyList for read";
while (<IN>){
if ($process[0] ne "Assignment" && $process[0] ne ""){
$ptsX=($highX-$process[2])/$stepX;
if ($ptsX < 0){
$ptsX=($highX2SW-$process[2])/$stepX;
}
$ptsX_X1=$ptsX-1;
$ptsX_X3=$ptsX+1;
$ptsY=($highY-$process[1])/$stepY;
if ($ptsY < 0){ $ptsY=($highY2SW-$process[1])/$stepY; } $ptsY_Y1=$ptsY-1; $ptsY_Y3=$ptsY+1; printf "%5d %9.3f %9.3f %8.3f %8.3f %+e %s%4.0f %4.0f %4.0f %4.0f\n",$i,$ptsX,$ptsY,$process[2],$process[1],700000,$process[0],$ptsX_X1,$ptsX_X3,$ptsY_Y1,$ptsY_Y3;
$i++;
};
Trusted, Bureaucrats
1,382

edits

Navigation menu