Index: /trunk/PStamp/lib/PStamp/Job.pm
===================================================================
--- /trunk/PStamp/lib/PStamp/Job.pm	(revision 19276)
+++ /trunk/PStamp/lib/PStamp/Job.pm	(revision 19277)
@@ -15,4 +15,5 @@
 our @EXPORT_OK = qw( 
                     locate_images
+                    resolve_project
                     );
 our %EXPORT_TAGS = (standard => [@EXPORT_OK]);
@@ -185,4 +186,11 @@
         }
         $out->{camera} = $camera;
+
+#XXX gpc1 and mops data that I've been looking at was made with astrometry in chip processing
+#so the filerule doesn't match
+if ($camera ne "SIMTEST") {
+    $want_astrom = 0;
+}
+       
         $out->{astrom} = find_astrometry($ipprc, $image_db, $image, $verbose) if $want_astrom;
 
@@ -364,3 +372,54 @@
 }
 
+# resolve_project()
+# get project specific information
+# This is a placeholder final implementation will use configuration file and database to
+# map from "project" to image database, dvo database, telescope, camera, etc
+#
+# For now just get the database and the class_id that will be used for image lookup
+
+sub resolve_project {
+    my $project_name = shift;
+    my $img_type     = shift;
+    my $class_id     = shift;
+    die "project is not defined" if !$project_name;
+
+    # for megacam and simtest since images are at the fpa level, leave out the
+    # class_id at the lookup stage
+    #
+    # TODO: get this information from a database or a configuration file
+
+    my $ret_dbname;
+    my $ret_class_id;
+    my $ret_inst;
+    my $ret_magic;
+    my $ret_camera;
+
+    if ($project_name eq "megacam-mops") {
+        $ret_dbname = "mops";
+        $ret_class_id = "null";
+        $ret_camera = "MEGACAM";
+        $ret_magic = 0;
+    } elsif ($project_name eq "simtest") {
+        $ret_dbname = "ps_simtest";
+        $ret_class_id = "null";
+        $ret_camera = "SIMTEST";
+        $ret_magic = 0;
+    } elsif ($project_name eq "gpc1") {
+        $ret_dbname = "gpc1";
+        $ret_class_id = $class_id;
+        $ret_camera = "GPC1";
+        $ret_magic = 0; # switch this to 1 when we're ready
+    } else {
+        die "unknown project $project_name";
+    }
+
+    if (($img_type ne "raw") and ($img_type ne "chip")) {
+        # don't need class_id
+        $ret_class_id = "";
+    }
+
+    return ($ret_dbname, $ret_class_id, $ret_camera, $ret_magic);
+}
+
 1;
