IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16727


Ignore:
Timestamp:
Feb 28, 2008, 2:57:50 PM (18 years ago)
Author:
Paul Price
Message:

Combining generate_skycells and skycell_file from Operations.pm into a
single function that produces a single skycell file (using
dvoImageExtract). This is necessary because we're moving to a model
where the outroot name is provided to the scripts, rather than being
generated by the scripts --- so there's no workdir at the script
level, which would tell the script where it might possibly find the
skycell file, so we have to generate a new one each time.

File:
1 edited

Legend:

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

    r16611 r16727  
    11# Copyright (c) 2006  Paul Price, Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.76 2008-02-22 20:20:37 eugene Exp $
     3# $Id: Config.pm,v 1.77 2008-02-29 00:57:50 price Exp $
    44
    55package PS::IPP::Config;
     
    10231023}
    10241024
     1025sub skycell_file
     1026{
     1027    my $self = shift;           # Configuration object
     1028    my $tess_id = shift;        # Tessellation identifier
     1029    my $skycell_id = shift;     # Skycell identifier
     1030    my $outname = shift;        # Output name
     1031    my $verbose = shift;        # Verbose?
     1032
     1033    unless (defined $self and defined $tess_id and defined $skycell_id and defined $outname) {
     1034        carp "Input parameters not defined";
     1035        return 0;
     1036    }
     1037
     1038    my $dvoImageExtract = can_run('dvoImageExtract') or die "Can't find dvoImageExtract";
     1039   
     1040    my $tess_dir = $self->tessellation_catdir( $tess_id ); # Tessellation catdir for DVO
     1041    unless (defined $tess_dir) {
     1042        carp "Can't get list of tessellations.";
     1043        return 0;
     1044    }
     1045    $tess_dir = $self->convert_filename_absolute( $tess_dir );
     1046
     1047    unless ($self->file_exists( $outName )) {
     1048        my $outNameResolved = $self->file_create( $outName ); # Resolved filename, for Nebulous
     1049        my $command = "$dvoImageExtract -D CATDIR $tess_dir $skycell_id -o $outNameResolved";
     1050        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     1051            run(command => $command, verbose => $verbose);
     1052        die "Unable to perform dvoImageExtract for $tess_id $skycell_id\n" unless ($success and $self->file_exists( $outName ));
     1053    }
     1054
     1055    return 1;
     1056}
     1057
    10251058# Interpolate environment variables in a directory (or colon-delimited list of directories)
    10261059sub _interpolate_env
Note: See TracChangeset for help on using the changeset viewer.