IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24037


Ignore:
Timestamp:
May 1, 2009, 5:23:59 PM (17 years ago)
Author:
eugene
Message:

astrometry was allowing too high orders for the number of stars

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroMosaicOneChip.c

    r21422 r24037  
    5858
    5959    // modify the order to correspond to the actual number of matched stars:
    60     if ((match->n < 17) && (order >= 3)) order = 2;
    61     if ((match->n < 13) && (order >= 2)) order = 1;
    62     if ((match->n <  9) && (order >= 1)) order = 0;
    63     if ((match->n <  3) || (order < 0) || (order > 3)) {
     60    int Ndof_min = 3;
     61    int order_max = 0.5*(sqrt(4*match->n - 4*Ndof_min + 1) - 3);
     62    order = PS_MIN (order, order_max);
     63
     64    // if ((match->n < 17) && (order >= 3)) order = 2;
     65    // if ((match->n < 13) && (order >= 2)) order = 1;
     66    // if ((match->n <  9) && (order >= 1)) order = 0;
     67
     68    if (order < 0) {
    6469        psLogMsg ("psastro", 3, "insufficient stars (%ld) or invalid order (%d)", match->n, order);
    6570        return false;
Note: See TracChangeset for help on using the changeset viewer.