IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13167


Ignore:
Timestamp:
May 2, 2007, 3:17:40 PM (19 years ago)
Author:
Paul Price
Message:

Adding function to return list of defined tessellations.

File:
1 edited

Legend:

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

    r12836 r13167  
    11# Copyright (c) 2006  Paul Price, Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.36 2007-04-17 01:25:44 eugene Exp $
     3# $Id: Config.pm,v 1.37 2007-05-03 01:17:40 price Exp $
    44
    55package PS::IPP::Config;
     
    420420}   
    421421
     422# Return hash of tessellations, from TESSELLATIONS within the camera configuration
     423sub tessellations
     424{
     425    my $self = shift;           # Configuration object
     426
     427    unless (defined $self) {
     428        carp "Programming error";
     429        exit($PS_EXIT_PROG_ERROR);
     430    }
     431
     432    my $camera = $self->{camera}; # Camera configuration
     433    unless (defined $camera) {
     434        carp "Camera has not yet been defined.\n";
     435        exit($PS_EXIT_PROG_ERROR);
     436    }
     437
     438    my $tessellations = _mdLookupMD($camera, 'TESSELLATIONS'); # Tessellations
     439    unless (defined $tessellations) {
     440        carp "Can't find TESSELLATIONS in camera configuration.\n";
     441        exit($PS_EXIT_CONFIG_ERROR);
     442    }
     443
     444    my %tessellations;          # Tessellations hash to return
     445    foreach my $tess ( @$tessellations ) {
     446        unless ($tess->{type} eq "STR") {
     447            carp "Type for " . $tess->{name} . " within TESSELLATIONS in camera config is not STR.\n";
     448            next;
     449        }
     450
     451        $tessellations{$tess->{name}} = $tess->{value};
     452    }
     453
     454    return \%tessellations;
     455}
     456
     457
    422458# Return the DVO.CAMERADIR in the camera configuration
    423459sub dvo_cameradir
Note: See TracChangeset for help on using the changeset viewer.