IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35506


Ignore:
Timestamp:
May 3, 2013, 3:27:47 PM (13 years ago)
Author:
bills
Message:

fault request if MJD value < 54000 to avoid people entering 4 digit
mjd values and triggering all of the survey

File:
1 edited

Legend:

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

    r35500 r35506  
    221221    if (!iszero($mjd_min)) {
    222222        $dateobs_begin = mjd_to_dateobs($mjd_min);
     223        if (!$dateobs_begin) {
     224            $row->{error_code} = $PSTAMP_INVALID_REQUEST;
     225            print STDERR "Invalid MJD_MIN: $mjd_min\n";
     226            return undef;
     227        }
    223228    }
    224229    if (!iszero($mjd_max)) {
    225230        $dateobs_end = mjd_to_dateobs($mjd_max);
     231        if (!$dateobs_begin) {
     232            $row->{error_code} = $PSTAMP_INVALID_REQUEST;
     233            print STDERR "Invalid MJD_MAX: $mjd_max\n";
     234            return undef;
     235        }
    226236    }
    227237    if (isnull($tess_id)) {
     
    13271337sub mjd_to_dateobs {
    13281338    my $mjd = shift;
     1339
     1340    if ($mjd < 54000) {
     1341        print STDERR "MJD value too small minimum is 54000\n";
     1342        return undef;
     1343    }
    13291344
    13301345    my $ticks = ($mjd - 40587.0) * 86400;
Note: See TracChangeset for help on using the changeset viewer.