line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Misc::Quality; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Astro::Quality - Class for handling quality flags for astronomical objects. |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 SYNOPSIS |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Astro::Quality; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$quality = new Astro::Quality( 'derived' => 1 ); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$derived = $quality->query('derived'); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$quality->set( 'derived' => 0 ); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 DESCRIPTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Class for handling quality flags for astronomical objects. This class |
20
|
|
|
|
|
|
|
can handle any type of flag used. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=cut |
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
2
|
|
9001
|
use 5.006; |
|
2
|
|
|
|
|
17
|
|
|
2
|
|
|
|
|
183
|
|
25
|
2
|
|
|
2
|
|
25
|
use strict; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
131
|
|
26
|
2
|
|
|
2
|
|
96
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
176
|
|
27
|
2
|
|
|
2
|
|
12
|
use warnings::register; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
749
|
|
28
|
2
|
|
|
2
|
|
13
|
use Carp; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
1063
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# CVS version $Id: Quality.pm,v 1.2 2005/06/10 00:50:04 aa Exp $ |
31
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new { |
34
|
0
|
|
|
0
|
0
|
|
my $proto = shift; |
35
|
0
|
|
0
|
|
|
|
my $class = ref( $proto ) || $proto; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $quality = (); |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my %args = @_; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
foreach my $key ( keys %args ) { |
42
|
0
|
|
|
|
|
|
$quality->{uc($key)} = $args{$key}; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
bless( $quality, $class ); |
46
|
0
|
|
|
|
|
|
return $quality; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub query { |
50
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
51
|
0
|
|
|
|
|
|
my $flag = uc(shift); |
52
|
|
|
|
|
|
|
|
53
|
0
|
0
|
|
|
|
|
if( exists( $self->{$flag} ) ) { |
54
|
0
|
|
|
|
|
|
return $self->{$flag}; |
55
|
|
|
|
|
|
|
} else { |
56
|
0
|
|
|
|
|
|
return undef; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub set { |
61
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
62
|
0
|
|
|
|
|
|
my $flag = uc(shift); |
63
|
0
|
|
|
|
|
|
my $value = shift; |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
$self->{$flag} = $value; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |
69
|
|
|
|
|
|
|
|