IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16319


Ignore:
Timestamp:
Feb 5, 2008, 3:55:43 PM (18 years ago)
Author:
Paul Price
Message:

Since tessellations are specified in advance, don't need a function to
return everything that's defined. Instead, need a function to return
the appropriate DVO catdir.

File:
1 edited

Legend:

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

    r16207 r16319  
    11# Copyright (c) 2006  Paul Price, Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.73 2008-01-23 23:33:25 eugene Exp $
     3# $Id: Config.pm,v 1.74 2008-02-06 01:55:43 price Exp $
    44
    55package PS::IPP::Config;
     
    784784}   
    785785
    786 # Return hash of tessellations, from TESSELLATIONS within the camera configuration
    787 sub tessellations
    788 {
    789     my $self = shift;           # Configuration object
    790 
    791     unless (defined $self) {
    792         carp "Programming error";
    793         exit($PS_EXIT_PROG_ERROR);
    794     }
    795 
    796     my $camera = $self->{camera}; # Camera configuration
    797     unless (defined $camera) {
    798         carp "Camera has not yet been defined.\n";
    799         exit($PS_EXIT_PROG_ERROR);
    800     }
    801 
    802     my $tessellations = metadataLookupMD($camera, 'TESSELLATIONS'); # Tessellations
     786# Return catdir for tessellation, from TESSELLATIONS within the site configuration
     787sub tessellation_catdir
     788{
     789    my $self = shift;           # Configuration object
     790    my $tess_id = shift;        # Tessellation identifier
     791
     792    unless (defined $self and defined $self->_ipprc and defined $tess_id) {
     793        carp "Programming error";
     794        exit($PS_EXIT_PROG_ERROR);
     795    }
     796
     797    my $tessellations = metadataLookupMD($self->_ipprc, 'TESSELLATIONS'); # Tessellations
    803798    unless (defined $tessellations) {
    804         carp "Can't find TESSELLATIONS in camera configuration.\n";
    805         exit($PS_EXIT_CONFIG_ERROR);
    806     }
    807 
    808     my %tessellations;          # Tessellations hash to return
    809     foreach my $tess ( @$tessellations ) {
    810         unless ($tess->{type} eq "STR") {
    811             carp "Type for " . $tess->{name} . " within TESSELLATIONS in camera config is not STR.\n";
    812             next;
    813         }
    814 
    815         $tessellations{$tess->{name}} = $tess->{value};
    816     }
    817 
    818     return \%tessellations;
     799        carp "Can't find TESSELLATIONS in site configuration.\n";
     800        exit($PS_EXIT_CONFIG_ERROR);
     801    }
     802
     803    my $catdir = metadataLookupStr($tessellations, $tess_id);
     804    unless (defined $catdir) {
     805        carp "Can't find tessellation identifier $tess_id in TESSELLATIONS in site configuration.\n";
     806        exit($PS_EXIT_CONFIG_ERROR);
     807    }
     808
     809    ### Because DVO doesn't use psModules, it doesn't understand Nebulous --- check
     810    my $scheme = file_scheme($catdir); # The scheme, e.g., file, path, neb
     811    if (defined $scheme and lc($scheme) eq 'neb') {
     812        carp "Tessellation $tess_id refers to a Nebulous path: $catdir\n";
     813        exit($PS_EXIT_CONFIG_ERROR);
     814    }
     815
     816    return $catdir
    819817}
    820818
Note: See TracChangeset for help on using the changeset viewer.