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