Index: trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
===================================================================
--- trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 38124)
+++ trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 38125)
@@ -411,12 +411,10 @@
     my $release_args;
     if (($req_type eq 'byexp' and $stage ne 'raw') or ($req_type eq 'byskycell' and $stage ne 'diff')) {
-        # XXX: Think hard before committing the change to use releasetool for byexp requests regardless.
-        # XXX: using releasetool by default for byexp requests will break for nightly data when 
-        # the release table survey task breaks.
-        # (MOPS one off requests for last night's data)
-        # we could fall back and do the old style lookup in that case.
-        # Need to fix the duplicate camRun problem.
-        my $force_releasetool_for_byexp = 0;
-        if ($release_name or $survey or ($force_releasetool_for_byexp and ($req_type eq 'byexp'))) {
+        # we use releasetool for lookups if we get here and have a survey or release specfied and
+        # the survey is not 'bypass' 
+        # That is a hook to allow sophisticated users to bypass the release mechanisms. Useful for
+        # MOPS which is interested primarily in nightly data and wants to get their data immediately
+        # without regard to timeleness of the relexp tables
+        if ($release_name or ($survey and $survey ne 'bypass')) {  
             $use_releasetool = 1;
             if ($release_name) {
@@ -579,5 +577,10 @@
         # $cmf_name    = "PSPHOT.OUTPUT";    # this puts .fpa. in the name
         $psf_name    = "PPSTACK.TARGET.PSF";
+        # XXX TODO should we filter stacks so that only one per skycell/filter combintation is returned for
+        # most requests. Currently unless a release is provided all that match are returned.
+        # Actually maybe that is the right answer. User's simply need to specify a release value
+        # if that is all that they want.
     } else {
+        # this should have been caught before we get here.
         die "Unknown IMG_TYPE supplied: $stage";
     }
@@ -615,4 +618,5 @@
         $command .= " -dateobs_end $dateobs_end" if $dateobs_end;
     } elsif ($req_type ne "byid") {
+        # stacks
         $command .= " -mjd_obs_begin $mjd_min" if $mjd_min;
         $command .= " -mjd_obs_end $mjd_max" if $mjd_max;
