IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19277


Ignore:
Timestamp:
Aug 28, 2008, 5:34:22 PM (18 years ago)
Author:
bills
Message:

move resolve_project here so it can be shared.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PStamp/lib/PStamp/Job.pm

    r19272 r19277  
    1515our @EXPORT_OK = qw(
    1616                    locate_images
     17                    resolve_project
    1718                    );
    1819our %EXPORT_TAGS = (standard => [@EXPORT_OK]);
     
    185186        }
    186187        $out->{camera} = $camera;
     188
     189#XXX gpc1 and mops data that I've been looking at was made with astrometry in chip processing
     190#so the filerule doesn't match
     191if ($camera ne "SIMTEST") {
     192    $want_astrom = 0;
     193}
     194       
    187195        $out->{astrom} = find_astrometry($ipprc, $image_db, $image, $verbose) if $want_astrom;
    188196
     
    364372}
    365373
     374# resolve_project()
     375# get project specific information
     376# This is a placeholder final implementation will use configuration file and database to
     377# map from "project" to image database, dvo database, telescope, camera, etc
     378#
     379# For now just get the database and the class_id that will be used for image lookup
     380
     381sub resolve_project {
     382    my $project_name = shift;
     383    my $img_type     = shift;
     384    my $class_id     = shift;
     385    die "project is not defined" if !$project_name;
     386
     387    # for megacam and simtest since images are at the fpa level, leave out the
     388    # class_id at the lookup stage
     389    #
     390    # TODO: get this information from a database or a configuration file
     391
     392    my $ret_dbname;
     393    my $ret_class_id;
     394    my $ret_inst;
     395    my $ret_magic;
     396    my $ret_camera;
     397
     398    if ($project_name eq "megacam-mops") {
     399        $ret_dbname = "mops";
     400        $ret_class_id = "null";
     401        $ret_camera = "MEGACAM";
     402        $ret_magic = 0;
     403    } elsif ($project_name eq "simtest") {
     404        $ret_dbname = "ps_simtest";
     405        $ret_class_id = "null";
     406        $ret_camera = "SIMTEST";
     407        $ret_magic = 0;
     408    } elsif ($project_name eq "gpc1") {
     409        $ret_dbname = "gpc1";
     410        $ret_class_id = $class_id;
     411        $ret_camera = "GPC1";
     412        $ret_magic = 0; # switch this to 1 when we're ready
     413    } else {
     414        die "unknown project $project_name";
     415    }
     416
     417    if (($img_type ne "raw") and ($img_type ne "chip")) {
     418        # don't need class_id
     419        $ret_class_id = "";
     420    }
     421
     422    return ($ret_dbname, $ret_class_id, $ret_camera, $ret_magic);
     423}
     424
    3664251;
Note: See TracChangeset for help on using the changeset viewer.