IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 41531


Ignore:
Timestamp:
Apr 3, 2021, 2:16:42 PM (5 years ago)
Author:
eugene
Message:

add argument to psPlaneTransformInvert to specific extra orders to be added to non-linear inverse transforms

Location:
trunk/psLib/src/astro
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r41519 r41531  
    10001000    const psPlaneTransform *in,
    10011001    psRegion region,
    1002     int nSamples)
     1002    int nSamples, int extraOrders)
    10031003{
    10041004    PS_ASSERT_PTR_NON_NULL(in, NULL);
     
    10261026    PS_ASSERT_INT_LARGER_THAN_OR_EQUAL(nSamples, 1, NULL);
    10271027
    1028     //
    1029     // Allocate a new psPlaneTransform if "out" is NULL, or has the wrong size.
    1030     //
    1031     psS32 order = in->x->nX;
     1028
     1029    // Allocate a new psPlaneTransform if "out" is NULL, or has the wrong size.  For a
     1030    // non-linear transformation, the inverted solution must have a higher order than the
     1031    // forward solution.  Since we are fitting a dense grid (generated below), it is not a
     1032    // problem (in terms of over-fitting) to use a higher order
     1033
     1034    // XXX : the extra orders supplied here needs to be something supplied by the user
     1035
     1036    psS32 order = in->x->nX + extraOrders;
    10321037    psPlaneTransform *myPT = NULL;
    10331038    if (out == NULL) {
     
    10361041      // the user has supplied a model with a specific order : fit that order
    10371042      myPT = psMemIncrRefCounter(out); // we need to return something which can be freed
    1038 # if (0)
    1039         if ((out->x->nX == order) && (out->x->nY == order) &&
    1040             (out->y->nX == order) && (out->y->nX == order)) {
    1041             myPT = out;
    1042         } else {
    1043             psFree(out);
    1044             myPT = psPlaneTransformAlloc(order, order);
    1045         }
    1046 # endif
    10471043    }
    10481044
  • trunk/psLib/src/astro/psCoord.h

    r39926 r41531  
    348348    const psPlaneTransform *in,        ///< transform to invert
    349349    psRegion region,                   ///< region to fit for non-linear transform inversion
    350     int nSamples                       ///< number of samples in each axis for fit
     350    int nSamples,                       ///< number of samples in each axis for fit
     351    int extraOrders                     ///< increase the order of the output by the amount vs input, if input is non-linear
    351352);
    352353
Note: See TracChangeset for help on using the changeset viewer.