IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28763


Ignore:
Timestamp:
Jul 29, 2010, 11:13:07 AM (16 years ago)
Author:
eugene
Message:

add sanity check for cgrid ticks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/Ohana/src/opihi/cmd.astro/cgrid.c

    r26258 r28763  
    153153  SetVector (&Yvec, OPIHI_FLT, NELEMENTS);
    154154 
     155  { // sanity check
     156    float Nelem;
     157    Nelem = (lastRA - firstRA) / minorRA;
     158    if (!isfinite(Nelem) || (fabs(Nelem) > 10000)) { fprintf (stderr, "absurd cgrid range %f to %f in steps of %f\n", firstRA, lastRA, minorRA); return FALSE; }
     159    Nelem = (lastDEC - firstDEC) / minorDEC;
     160    if (!isfinite(Nelem) || (fabs(Nelem) > 10000)) { fprintf (stderr, "absurd cgrid range %f to %f in steps of %f\n", firstDEC, lastDEC, minorDEC); return FALSE; }
     161  }
     162
    155163  /***  do consecutive RA lines, first increasing **/
    156164  OnPic = TRUE;
Note: See TracChangeset for help on using the changeset viewer.