File: spectrum2tikz.pl6

package info (click to toggle)
dmrgpp 6.06-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 113,900 kB
  • sloc: cpp: 80,986; perl: 14,772; ansic: 2,923; makefile: 83; sh: 17
file content (32 lines) | stat: -rw-r--r-- 444 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl6

use v6;

sub MAIN($file, $lx)
{
	my $input = open($file, :r);
	my ($x, $y) = (0, 0);
	while (my $line = $input.get) {
		my @temp = split(/\s/, $line);
		#print "$x $y " ~ @temp[3] ~ "\n";
		printThisLine(@temp, $lx);
		++$x;
		if ($x == $lx) {
			$x = 0;
			++$y;
			print "\n";
		}

	}

	$input.close;
}

sub printThisLine($a, $lx)
{
	my $kx = $a.[0];
	my $omega = $a.[1];
	my $imag = $a.[3];
	print "$kx $omega $imag\n";
}