IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21471


Ignore:
Timestamp:
Feb 13, 2009, 12:41:28 PM (17 years ago)
Author:
giebink
Message:

Account for weight(s) to variance(s) change

Location:
trunk/psModules/test/objects
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/objects/tap_pmModel.c

    r15985 r21471  
    3333    readout->image = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    3434    readout->mask = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_U8);
    35     readout->weight = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     35    readout->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    3636    for (psS32 i = 0 ; i < NUM_BIAS_DATA ; i++) {
    3737        psImage *tmpImage = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
  • trunk/psModules/test/objects/tap_pmModelClass.c

    r15985 r21471  
    3030    readout->image = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    3131    readout->mask = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_U8);
    32     readout->weight = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     32    readout->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    3333    for (psS32 i = 0 ; i < NUM_BIAS_DATA ; i++) {
    3434        psImage *tmpImage = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
  • trunk/psModules/test/objects/tap_pmPSF_IO.c

    r21223 r21471  
    5555    readout->image = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    5656    readout->mask = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_U8);
    57     readout->weight = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     57    readout->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    5858    for (psS32 i = 0 ; i < NUM_BIAS_DATA ; i++) {
    5959        psImage *tmpImage = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     
    9393    cell->hdu->images = psArrayAlloc(NUM_HDUS);
    9494    cell->hdu->masks = psArrayAlloc(NUM_HDUS);
    95     cell->hdu->weights = psArrayAlloc(NUM_HDUS);
     95    cell->hdu->variances = psArrayAlloc(NUM_HDUS);
    9696    for (int k = 0 ; k < NUM_HDUS ; k++) {
    9797        cell->hdu->images->data[k]  = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    9898        cell->hdu->masks->data[k]   = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_MASK);
    99         cell->hdu->weights->data[k] = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     99        cell->hdu->variances->data[k] = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    100100        psImageInit(cell->hdu->images->data[k], (float) (BASE_IMAGE+k));
    101101        psImageInit(cell->hdu->masks->data[k], (psU8) (BASE_MASK+k));
    102         psImageInit(cell->hdu->weights->data[k], (float) (BASE_WEIGHT+k));
     102        psImageInit(cell->hdu->variances->data[k], (float) (BASE_WEIGHT+k));
    103103    }
    104104
  • trunk/psModules/test/objects/tap_pmResiduals.c

    r15985 r21471  
    2929        ok(resid->Rx && psMemCheckImage(resid->Rx), "pmResidualsAlloc() allocated the resid->Rx image");
    3030        ok(resid->Ry && psMemCheckImage(resid->Ry), "pmResidualsAlloc() allocated the resid->Ry image");
    31         ok(resid->weight && psMemCheckImage(resid->weight), "pmResidualsAlloc() allocated the resid->weight image");
     31        ok(resid->variance && psMemCheckImage(resid->variance ), "pmResidualsAlloc() allocated the resid->variance image");
    3232        ok(resid->mask && psMemCheckImage(resid->mask), "pmResidualsAlloc() allocated the resid->mask image");
    3333
  • trunk/psModules/test/objects/tap_pmSource.c

    r21223 r21471  
    4848    readout->image = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    4949    readout->mask = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_U8);
    50     readout->weight = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     50    readout->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    5151    for (psS32 i = 0 ; i < NUM_BIAS_DATA ; i++) {
    5252        psImage *tmpImage = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     
    7777        ok(src->peak == NULL, "pmSourceAlloc() pmSource->peak correctly");
    7878        ok(src->pixels == NULL, "pmSourceAlloc() pmSource->pixels correctly");
    79         ok(src->weight == NULL, "pmSourceAlloc() pmSource->weight correctly");
     79        ok(src->variance == NULL, "pmSourceAlloc() pmSource->variance correctly");
    8080        ok(src->maskObj == NULL, "pmSourceAlloc() pmSource->maskObj correctly");
    8181        ok(src->maskView == NULL, "pmSourceAlloc() pmSource->maskView correctly");
     
    169169
    170170        src->pixels = psImageAlloc(2, 4, PS_TYPE_F32);
    171         src->weight = psImageAlloc(6, 8, PS_TYPE_F32);
     171        src->variance = psImageAlloc(6, 8, PS_TYPE_F32);
    172172        src->maskView  = psImageAlloc(10, 12, PS_TYPE_U8);
    173173        pmSource *dst = pmSourceCopy(src);
     
    207207        ok(dst->pixels->numCols == src->pixels->numCols && dst->pixels->numRows == src->pixels->numRows,
    208208           "pmSourceCopy() generated correct size pmSource->pixels");
    209         ok(dst->weight != NULL, "pmSourceCopy() allocated a new pmSource->weight");
    210         ok(dst->weight->numCols == src->weight->numCols && dst->weight->numRows == src->weight->numRows,
    211            "pmSourceCopy() generated correct size pmSource->weight");
     209        ok(dst->variance != NULL, "pmSourceCopy() allocated a new pmSource->variance");
     210        ok(dst->variance->numCols == src->variance->numCols && dst->variance->numRows == src->variance->numRows,
     211           "pmSourceCopy() generated correct size pmSource->variance");
    212212        ok(dst->maskView != NULL, "pmSourceCopy() allocated a new pmSource->maskView");
    213213        ok(dst->maskView->numCols == src->maskView->numCols && dst->maskView->numRows == src->maskView->numRows,
     
    290290        int expectedNumCols = 1 + (TEST_NUM_COLS/2);
    291291        int expectedNumRows = 1 + (TEST_NUM_COLS/2);
    292         // XX: We only verify the size of the pixels, weight, maskView, and maskObj
     292        // XX: We only verify the size of the pixels, variance, maskView, and maskObj
    293293        // images.  A better test would verify that the actual data is set correctly.
    294294        // We don't do that here since it basically duplicated psLib function tests.
    295295        ok(src->pixels->numCols == expectedNumCols && src->pixels->numRows == expectedNumRows,
    296296               "pmSourceDefinePixels() set the size of pmSource->pixels correctly");
    297         ok(src->weight->numCols == expectedNumCols && src->weight->numRows == expectedNumRows,
    298                "pmSourceDefinePixels() set the size of pmSource->weight correctly");
     297        ok(src->variance->numCols == expectedNumCols && src->variance->numRows == expectedNumRows,
     298               "pmSourceDefinePixels() set the size of pmSource->variance correctly");
    299299        ok(src->maskView->numCols == expectedNumCols && src->maskView->numRows == expectedNumRows,
    300300               "pmSourceDefinePixels() set the size of pmSource->maskView correctly");
     
    396396        int expectedNumCols = 1 + (TEST_NUM_COLS/2);
    397397        int expectedNumRows = 1 + (TEST_NUM_COLS/2);
    398         // XX: We only verify the size of the pixels, weight, maskView, and maskObj
     398        // XX: We only verify the size of the pixels, variance, maskView, and maskObj
    399399        // images.  A better test would verify that the actual data is set correctly.
    400400        // We don't do that here since it basically duplicated psLib function tests.
    401401        ok(src->pixels->numCols == expectedNumCols && src->pixels->numRows == expectedNumRows,
    402402               "pmSourceRedefinePixels() set the size of pmSource->pixels correctly");
    403         ok(src->weight->numCols == expectedNumCols && src->weight->numRows == expectedNumRows,
    404                "pmSourceRedefinePixels() set the size of pmSource->weight correctly");
     403        ok(src->variance->numCols == expectedNumCols && src->variance->numRows == expectedNumRows,
     404               "pmSourceRedefinePixels() set the size of pmSource->variance correctly");
    405405        ok(src->maskView->numCols == expectedNumCols && src->maskView->numRows == expectedNumRows,
    406406               "pmSourceRedefinePixels() set the size of pmSource->maskView correctly");
     
    584584    // We only test with a single Gaussian model, with no residuals or masks.
    585585    // For completeness, additional tests should be added.
    586         // We should also set mode &= PM_MODEL_OP_NOISE to test that the src->weights are added.
     586        // We should also set mode &= PM_MODEL_OP_NOISE to test that the src->variances are added.
    587587    {
    588588        psMemId id = psMemGetId();
     
    632632    // call pmSourceOp() with acceptable parameters
    633633    // Test source->modelFlux
    634         // We should also set mode &= PM_MODEL_OP_NOISE to test that the src->weights are added.
     634        // We should also set mode &= PM_MODEL_OP_NOISE to test that the src->variances are added.
    635635    {
    636636        psMemId id = psMemGetId();
  • trunk/psModules/test/objects/tap_pmSourceExtendedPars.c

    r15985 r21471  
    4646        ok(tmp->radius == NULL, "pmSourceRadialProfileAlloc() set the ->radius member to NULL");
    4747        ok(tmp->flux == NULL, "pmSourceRadialProfileAlloc() set the ->flux member to NULL");
    48         ok(tmp->weight == NULL, "pmSourceRadialProfileAlloc() set the ->weight member to NULL");
     48        ok(tmp->variance == NULL, "pmSourceRadialProfileAlloc() set the ->variance member to NULL");
    4949
    5050        psFree(tmp);
  • trunk/psModules/test/objects/tap_pmSourceFitSet.c

    r15985 r21471  
    3030    if (1) {
    3131        src->pixels = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    32         src->weight = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     32        src->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    3333        src->maskObj = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_U8);
    3434        if (1) {
     
    3636                for (int j = 0 ; j < TEST_NUM_COLS ; j++) {
    3737                    src->pixels->data.F32[i][j] = 0.0;
    38                     src->weight->data.F32[i][j] = 1.0;
     38                    src->variance->data.F32[i][j] = 1.0;
    3939                    src->maskObj->data.U8[i][j] = 0;
    4040                }
     
    663663
    664664
    665     // Call pmSourceFitSet() with NULL psSource pixels, weight, maskObj input parameters
     665    // Call pmSourceFitSet() with NULL psSource pixels, variance, maskObj input parameters
    666666    {
    667667        psMemId id = psMemGetId();
     
    677677        src->pixels = tmpImg;
    678678
    679         tmpImg = src->weight;
    680         src->weight = NULL;
     679        tmpImg = src->variance;
     680        src->variance = NULL;
    681681        rc = pmSourceFitSet(src, modelSet, PM_SOURCE_FIT_PSF, 1);
    682         ok(rc == false, "pmSourceFitSet() returned FALSE with NULL src->weight input parameter");
    683         src->weight = tmpImg;
     682        ok(rc == false, "pmSourceFitSet() returned FALSE with NULL src->variance input parameter");
     683        src->variance = tmpImg;
    684684
    685685        tmpImg = src->maskObj;
  • trunk/psModules/test/objects/tap_pmSourceSky.c

    r15985 r21471  
    153153        psMemId id = psMemGetId();
    154154        pmSource *src = pmSourceAlloc();
    155         src->weight = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    156         for (int i =0 ; i < src->weight->numRows ; i++) {
    157             for (int j = 0 ; j < src->weight->numCols ; j++) {
    158                 src->weight->data.F32[i][j] = (float) (i + j);
     155        src->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     156        for (int i =0 ; i < src->variance->numRows ; i++) {
     157            for (int j = 0 ; j < src->variance->numCols ; j++) {
     158                src->variance->data.F32[i][j] = (float) (i + j);
    159159            }
    160160        }
     
    168168
    169169
    170     // Call pmSourceLocalSkyVariance() with NULL pmSource->weight input parameter
     170    // Call pmSourceLocalSkyVariance() with NULL pmSource->variance input parameter
    171171    {
    172172        psMemId id = psMemGetId();
     
    175175        src->peak = pmPeakAlloc(1, 2, 3.0, PM_PEAK_LONE);
    176176        bool rc = pmSourceLocalSkyVariance(src, PS_STAT_SAMPLE_MEAN, 10.0, 1, 2);
    177         ok(rc == false, "pmSourceLocalSkyVariance() returned FALSE with NULL pmSource->weight input parameter");
     177        ok(rc == false, "pmSourceLocalSkyVariance() returned FALSE with NULL pmSource->variance input parameter");
    178178        psFree(src);
    179179        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
     
    185185        psMemId id = psMemGetId();
    186186        pmSource *src = pmSourceAlloc();
    187         src->weight = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    188         for (int i =0 ; i < src->weight->numRows ; i++) {
    189             for (int j = 0 ; j < src->weight->numCols ; j++) {
    190                 src->weight->data.F32[i][j] = (float) (i + j);
     187        src->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     188        for (int i =0 ; i < src->variance->numRows ; i++) {
     189            for (int j = 0 ; j < src->variance->numCols ; j++) {
     190                src->variance->data.F32[i][j] = (float) (i + j);
    191191            }
    192192        }
     
    203203        psMemId id = psMemGetId();
    204204        pmSource *src = pmSourceAlloc();
    205         src->weight = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    206         for (int i =0 ; i < src->weight->numRows ; i++) {
    207             for (int j = 0 ; j < src->weight->numCols ; j++) {
    208                 src->weight->data.F32[i][j] = (float) (i + j);
     205        src->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     206        for (int i =0 ; i < src->variance->numRows ; i++) {
     207            for (int j = 0 ; j < src->variance->numCols ; j++) {
     208                src->variance->data.F32[i][j] = (float) (i + j);
    209209            }
    210210        }
     
    221221        psMemId id = psMemGetId();
    222222        pmSource *src = pmSourceAlloc();
    223         src->weight = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    224         for (int i =0 ; i < src->weight->numRows ; i++) {
    225             for (int j = 0 ; j < src->weight->numCols ; j++) {
    226                 src->weight->data.F32[i][j] = (float) (i + j);
     223        src->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     224        for (int i =0 ; i < src->variance->numRows ; i++) {
     225            for (int j = 0 ; j < src->variance->numCols ; j++) {
     226                src->variance->data.F32[i][j] = (float) (i + j);
    227227            }
    228228        }
     
    245245        psMemId id = psMemGetId();
    246246        pmSource *src = pmSourceAlloc();
    247         src->weight = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     247        src->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    248248        src->maskObj = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_MASK);
    249249        psF32 mean = 0.0;
    250         for (int i = 0 ; i < src->weight->numRows ; i++) {
    251             for (int j = 0 ; j < src->weight->numCols ; j++) {
    252                 src->weight->data.F32[i][j] = (float) (i + j);
     250        for (int i = 0 ; i < src->variance->numRows ; i++) {
     251            for (int j = 0 ; j < src->variance->numCols ; j++) {
     252                src->variance->data.F32[i][j] = (float) (i + j);
    253253                mean+= (float) (i + j);
    254254                src->maskObj->data.U8[i][j] = 0;
  • trunk/psModules/test/objects/tap_pmSourceUtils.c

    r21223 r21471  
    3939    readout->image = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    4040    readout->mask = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_U8);
    41     readout->weight = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     41    readout->variance = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    4242    for (psS32 i = 0 ; i < NUM_BIAS_DATA ; i++) {
    4343        psImage *tmpImage = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     
    7777    cell->hdu->images = psArrayAlloc(NUM_HDUS);
    7878    cell->hdu->masks = psArrayAlloc(NUM_HDUS);
    79     cell->hdu->weights = psArrayAlloc(NUM_HDUS);
     79    cell->hdu->variances = psArrayAlloc(NUM_HDUS);
    8080    for (int k = 0 ; k < NUM_HDUS ; k++) {
    8181        cell->hdu->images->data[k]  = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    8282        cell->hdu->masks->data[k]   = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_MASK);
    83         cell->hdu->weights->data[k] = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
     83        cell->hdu->variances->data[k] = psImageAlloc(TEST_NUM_COLS, TEST_NUM_ROWS, PS_TYPE_F32);
    8484        psImageInit(cell->hdu->images->data[k], (float) (BASE_IMAGE+k));
    8585        psImageInit(cell->hdu->masks->data[k], (psU8) (BASE_MASK+k));
    86         psImageInit(cell->hdu->weights->data[k], (float) (BASE_WEIGHT+k));
     86        psImageInit(cell->hdu->variances->data[k], (float) (BASE_WEIGHT+k));
    8787    }
    8888
Note: See TracChangeset for help on using the changeset viewer.