IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29195


Ignore:
Timestamp:
Sep 22, 2010, 12:52:09 PM (16 years ago)
Author:
rhenders
Message:

Adding a new constructor for existing batches; broke smf getting code into two methods for convenience

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/perl/ippToPsps/DetectionBatch.pm

    r29192 r29195  
    1111use ippToPsps::Batch;
    1212our @ISA = qw(ippToPsps::Batch);    # inherits from Batch class
     13
     14
     15###########################################################################
     16#
     17# Constructor (overrides superclass)
     18#
     19###########################################################################
     20sub existing {
     21    my ($class) = @_;
     22
     23    # Call the constructor of the parent class
     24    my $self = $class->SUPER::existing(
     25            $_[1],  # camera
     26            $_[2],  # gpc1Db
     27            $_[3],  # batchId
     28            $_[4],  # ippToPspsDb
     29            $_[5],  # path
     30            $_[6],  # verbose
     31            $_[7]   # save_temps
     32            );
     33
     34    bless $self, $class;
     35    return $self;
     36}
     37
    1338
    1439###########################################################################
     
    4469#######################################################################################
    4570#
     71# Locates the relevant smf file for this exposure
     72#
     73#######################################################################################
     74sub getSmfFile {
     75    my ($self) = @_;
     76
     77    # get neb path of smf file
     78    my $nebPath = $self->{_gpc1Db}->getCameraStageSmfForThisDvoDb($self->{_dvoDb}, $self->{_expId});
     79    if (!$nebPath) { return 0; }
     80
     81    # get real filename from neb 'key'
     82    my $fpaObjects = $self->{_ipprc}->filename("PSASTRO.OUTPUT",$nebPath) or return undef;
     83    return $self->{_ipprc}->file_resolve($fpaObjects);
     84}
     85
     86#######################################################################################
     87#
    4688# Locates the relevant smf file for this exposure and writes the path to the file passed-in
    4789#
     
    5092    my ($self, $inputFile) = @_;
    5193
    52     # get neb path of smf file
    53     my $nebPath = $self->{_gpc1Db}->getCameraStageSmfForThisDvoDb($self->{_dvoDb}, $self->{_expId});
    54     if (!$nebPath) { return 0; }
    55 
    56     # get real filename from neb 'key'
    57     my $fpaObjects = $self->{_ipprc}->filename("PSASTRO.OUTPUT",$nebPath) or return 0;
    58     my $realFile = $self->{_ipprc}->file_resolve($fpaObjects) or return 0;
     94    my $smfFile = $self->getSmfFile();
     95    if (!defined $smfFile) {return 0;}
    5996
    6097    # now write the path to this file out to temp file
    61     print $inputFile $realFile . "\n";
     98    print $inputFile $smfFile . "\n";
    6299
    63100    return 1;
Note: See TracChangeset for help on using the changeset viewer.