IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 15, 2005, 3:10:36 PM (21 years ago)
Author:
gusciora
Message:

There are a lot of changes here required by the new SDRS. Most changes
involve the new definitions of the psAstrometry types. Not all tests work
correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/tst_pmFlatField.c

    r2950 r4770  
    1616 *    Test M - Attempt to use non-mask type mask image
    1717 *
     18 * XXX: Added a mask argument to pmFlatField().  Must add tests.  For now, all
     19 * masks are NULL.
     20 *
    1821 *  @author Ross Harman, MHPCC
    1922 *
    20  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    21  *  @date $Date: 2005-01-11 01:17:28 $
     23 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     24 *  @date $Date: 2005-08-16 01:10:36 $
    2225 *
    2326 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6871int main(int argc, char* argv[])
    6972{
     73    psLogSetFormat("HLNM");
    7074    return !runTestSuite(stderr, "Test Point Driver", tests, argc, argv);
    7175}
     
    7781    printPositiveTestHeader(stdout, "pmFlatField", "Test A - Divide input image by flat image");
    7882    CREATE_AND_SET_IMAGE(inImage,F64,6.0,3,3)
    79     psReadout *inReadout = psReadoutAlloc();
     83    pmReadout *inReadout = pmReadoutAlloc(NULL);
    8084    inReadout->image = inImage;
    8185    PRINT_MATRIX(inImage,F64,"Input image:");
    8286    CREATE_AND_SET_IMAGE(flatImage1,F64,2.0,3,3)
    83     psReadout *flatReadout = psReadoutAlloc();
     87    pmReadout *flatReadout = pmReadoutAlloc(NULL);
    8488    flatReadout->image = flatImage1;
    8589    PRINT_MATRIX(flatImage1,F64,"Flat image:");
    86     if ( !pmFlatField(inReadout, flatReadout) ) {
     90    if ( !pmFlatField(inReadout, NULL, flatReadout) ) {
    8791        psError(PS_ERR_UNKNOWN,true,"Test A - Returned false should be true");
    8892        return 1;
     
    99103    PRINT_MATRIX(flatImage2, F64, "Flat image:");
    100104    flatReadout->image = flatImage2;
    101     if ( !pmFlatField(inReadout, flatReadout) ) {
     105    if ( !pmFlatField(inReadout, NULL, flatReadout) ) {
    102106        psError(PS_ERR_UNKNOWN,true,"Test B - Returned false should be true");
    103107        return 2;
     
    118122    psFree(inReadout->mask);
    119123    inReadout->mask = mask1;
    120     if ( !pmFlatField(inReadout, flatReadout) ) {
     124    if ( !pmFlatField(inReadout, NULL, flatReadout) ) {
    121125        psError(PS_ERR_UNKNOWN,true,"Test C - Returned false should be true");
    122126        return 3;
     
    132136    printNegativeTestHeader(stdout,"pmFlatField", "Test D - Attempt to use null flat readout",
    133137                            "Null not allowed for flat readout", 0);
    134     if( pmFlatField(inReadout, NULL) ) {
     138    if( pmFlatField(inReadout, NULL, NULL) ) {
    135139        psError(PS_ERR_UNKNOWN,true,"Test D - Returned true should be false");
    136140        return 4;
     
    145149    psImage *temp = inReadout->image;
    146150    inReadout->image = NULL;
    147     if ( pmFlatField(inReadout, flatReadout) ) {
     151    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
    148152        psError(PS_ERR_UNKNOWN,true,"Test E - Returned true should be false" );
    149153        return 5;
     
    159163    temp = flatReadout->image;
    160164    flatReadout->image = NULL;
    161     if ( pmFlatField(inReadout, flatReadout) ) {
     165    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
    162166        psError(PS_ERR_UNKNOWN,true,"Test F - Returned true should be false" );
    163167        return 6;
     
    174178    temp = flatReadout->image;
    175179    flatReadout->image = smallFlat;
    176     if ( pmFlatField(inReadout, flatReadout) ) {
     180    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
    177181        psError(PS_ERR_UNKNOWN,true,"Test G - Returned true should be false");
    178182        return 7;
     
    189193    temp = inReadout->mask;
    190194    inReadout->mask = largeMask;
    191     if ( pmFlatField(inReadout, flatReadout) ) {
     195    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
    192196        psError(PS_ERR_UNKNOWN,true,"Test H - Returned true should be false");
    193197        return 8;
     
    203207    *(int*)&inReadout->col0 = 50;
    204208    *(int*)&inReadout->row0 = 50;
    205     if ( pmFlatField(inReadout, flatReadout) ) {
     209    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
    206210        psError(PS_ERR_UNKNOWN,true,"Test I - Returned true should be false");
    207211        return 9;
     
    217221                            "Complex types not allowed for input image", 0);
    218222    *(psElemType* ) & inReadout->image->type.type = PS_TYPE_C64;
    219     if ( pmFlatField(inReadout, flatReadout) ) {
     223    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
    220224        psError(PS_ERR_UNKNOWN,true,"Test J - Returned true should be false");
    221225        return 10;
     
    230234                            "Complex types not allowed for flat image", 0);
    231235    *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_C64;
    232     if ( pmFlatField(inReadout, flatReadout) ) {
     236    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
    233237        psError(PS_ERR_UNKNOWN,true,"Test K - Returned ture should be false");
    234238        return 11;
     
    243247                            "Input and flat image types differ", 0);
    244248    *(psElemType* ) & flatReadout->image->type.type = PS_TYPE_F32;
    245     if ( pmFlatField(inReadout, flatReadout) ) {
     249    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
    246250        psError(PS_ERR_UNKNOWN,true,"Test L - Returned true should be false");
    247251        return 12;
     
    256260                            "Mask must be PS_TYPE_MASK type", 0);
    257261    *(psElemType* ) & inReadout->mask->type.type = PS_TYPE_F32;
    258     if ( pmFlatField(inReadout, flatReadout) ) {
     262    if ( pmFlatField(inReadout, NULL, flatReadout) ) {
    259263        psError(PS_ERR_UNKNOWN,true,"Test M - Returned true should be false");
    260264        return 13;
Note: See TracChangeset for help on using the changeset viewer.