IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8744


Ignore:
Timestamp:
Sep 5, 2006, 5:24:49 PM (20 years ago)
Author:
jhoblitt
Message:

add ->_parse_braindead() method
use ->_parse_braindead() instead of ->_parse_megacam()
VERSION to 0.02

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Config/lib/PS/IPP/Metadata/Stats.pm

    r8743 r8744  
    11# Copyright (c) 2006  Paul Price, Joshua Hoblitt
    22#
    3 # $Id: Stats.pm,v 1.8 2006-09-06 02:45:46 jhoblitt Exp $
     3# $Id: Stats.pm,v 1.9 2006-09-06 03:24:49 jhoblitt Exp $
    44
    55package PS::IPP::Metadata::Stats;
     
    88use warnings FATAL => qw( all );
    99
    10 our $VERSION = '0.01';
     10our $VERSION = '0.02';
    1111
    1212use Carp qw( carp croak );
     
    6262    my $errors = 0;
    6363
    64     $self->_parse_megacam($md);
     64#    $self->_parse_megacam($md);
     65    $self->_parse_braindead($md);
    6566
    6667    # Check that we found everything for the constants
     
    172173}
    173174
     175sub _parse_braindead
     176{
     177    my ($self, $md) = @_;
     178
     179    # descend through the fpa       
     180    foreach my $entry (@$md) {
     181        # recurse on nested metadata
     182        if ($entry->{class} eq 'metadata') {
     183            $self->_parse_braindead($entry->{value});
     184        }
     185
     186        if ($entry->{name} =~ /^(SAMPLE|ROBUST|FITTED|CLIPPED)_/) {
     187            # It's a statistic of some sort
     188            if ($entry->{name} =~ /_STDEV$/) {
     189                push @{$self->{bg_stdev_data}}, $entry->{value};
     190            } else {
     191                push @{$self->{bg_data}}, $entry->{value};
     192            }
     193        } else {
     194            $self->_check_values($entry);
     195        }
     196    }
     197
     198    return $self;
     199}
    174200
    175201# Private function to check a metadata item for things we're interested in
Note: See TracChangeset for help on using the changeset viewer.