3 |
|
# |
4 |
|
# Sample Klems (full) directions impinging on surface(s) |
5 |
|
# |
6 |
+ |
# G. Ward |
7 |
+ |
# |
8 |
+ |
use strict; |
9 |
|
if ($#ARGV < 0) { |
10 |
< |
print "Usage: genklemsamp [-c N ][-f{a|f|d}] [view opts] [geom.rad ..]\n"; |
10 |
> |
print STDERR, "Usage: genklemsamp [-c N ][-f{a|f|d}] [view opts] [geom.rad ..]\n"; |
11 |
|
exit 1; |
12 |
|
} |
13 |
|
my $td = `mktemp -d /tmp/genklemsamp.XXXXXX`; |
28 |
|
push @vopts, "@ARGV[0..1]"; |
29 |
|
shift @ARGV; |
30 |
|
} elsif ("$ARGV[0]" =~ /^-v./) { |
31 |
< |
print "Unsupported view option: $ARGV[0]\n"; |
31 |
> |
print STDERR, "Unsupported view option: $ARGV[0]\n"; |
32 |
|
exit 1; |
33 |
|
} elsif ("$ARGV[0]" =~ /^-./) { |
34 |
< |
print "Unknown option: $ARGV[0]\n"; |
34 |
> |
print STDERR, "Unknown option: $ARGV[0]\n"; |
35 |
|
exit 1; |
36 |
|
} else { |
37 |
|
last; |
100 |
|
$ntot = -s "$td/origins.flt"; |
101 |
|
$ntot /= 3*4; |
102 |
|
if ($ntot == 0) { |
103 |
< |
print "View direction does not correspond to any surfaces\n"; |
103 |
> |
print STDERR, "View direction does not correspond to any surfaces\n"; |
104 |
|
exit 1; |
105 |
|
} |
106 |
|
$sca *= 1.05 * sqrt($nsamp/$ntot); |