IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2287


Ignore:
Timestamp:
Nov 4, 2004, 6:49:47 PM (22 years ago)
Author:
gusciora
Message:

This version of ReadoutCombine compiles, and runs, and generates correct
answers for simple input.

Location:
trunk/psModules
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/pmReadoutCombine.c

    r2286 r2287  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2004-11-05 02:45:42 $
     7 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2004-11-05 04:49:47 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6565    psListElem *tmpInput = NULL;
    6666    int numInputs = 0;
    67     psReadout *tmpReadout;
     67    psReadout *tmpReadout = NULL;
    6868    float tmpF;
    6969
     
    135135    //
    136136    if (output == NULL) {
    137         output = psImageAlloc(1+maxInputCols-minInputCols,
    138                               1+maxInputRows-minInputRows, PS_TYPE_F32);
     137        output = psImageAlloc(maxInputCols-minInputCols,
     138                              maxInputRows-minInputRows, PS_TYPE_F32);
    139139        *(int *) &(output->col0) = minInputCols;
    140140        *(int *) &(output->row0) = minInputRows;
     
    168168    psReadout **tmpReadouts = (psReadout **) psAlloc(numInputs * sizeof(psReadout *));
    169169
    170 
    171170    // For each input readout, we create a pointer to that readout in
    172171    // "tmpReadouts[]", and we store the min/max pixel indices for that
     
    174173    // (outRowLower, outColLower, outRowUpper, outColUpper).
    175174    i = 0;
     175    tmpInput = (psListElem *) inputs->head;
    176176    while (NULL != tmpInput) {
    177177        tmpReadouts[i] = (psReadout *) tmpInput->data;
    178         outRowLower->data.U32[i] = tmpReadouts[i]->row0 + tmpReadout->image->row0;
    179         outColLower->data.U32[i] = tmpReadouts[i]->col0 + tmpReadout->image->col0;
     178        outRowLower->data.U32[i] = tmpReadouts[i]->row0 + tmpReadouts[i]->image->row0;
     179        outColLower->data.U32[i] = tmpReadouts[i]->col0 + tmpReadouts[i]->image->col0;
    180180        outRowUpper->data.U32[i] = tmpReadouts[i]->row0 +
    181181                                   tmpReadouts[i]->image->row0 +
     
    185185                                   tmpReadouts[i]->image->numCols;
    186186
     187        //        printf("Bounds: [%d][%d] to [%d][%d]\n", outRowLower->data.U32[i], outColLower->data.U32[i], outRowUpper->data.U32[i], outColUpper->data.U32[i]);
     188
     189
    187190        tmpInput = tmpInput->next;
    188191        i++;
    189 
    190192    }
    191193
     
    197199    // stats routine on those pixels/mask.  Then we set the output pixel value
    198200    // to the result of the stats call.
    199     for (i = output->row0; i < output->numRows ; i++) {
    200         for (j = output->col0; j < output->numCols ; j++) {
     201
     202    for (i = output->row0; i < (output->row0 + output->numRows) ; i++) {
     203        for (j = output->col0; j < (output->col0 + output->numCols) ; j++) {
    201204            for (int r = 0; r < numInputs ; r++) {
     205                //                printf("[%d][%d]: [%d][%d] to [%d][%d]\n", i, j, outRowLower->data.U32[r], outColLower->data.U32[r], outRowUpper->data.U32[r], outColUpper->data.U32[r]);
    202206                if ((outRowLower->data.U32[r] <= i) &&
    203207                        (outColLower->data.U32[r] <= j) &&
     
    206210
    207211                    int imageRow = i - (tmpReadouts[r]->row0 +
    208                                         tmpReadouts[i]->image->row0);
     212                                        tmpReadouts[r]->image->row0);
    209213                    int imageCol = j - (tmpReadouts[r]->col0 +
    210214                                        tmpReadouts[r]->image->col0);
    211                     if (!(maskVal && tmpReadouts[i]->mask->data.U8[imageRow][imageCol])) {
    212                         tmpPixels->data.F32[r] = tmpReadouts[i]->image->data.F32[imageRow][imageCol];
     215
     216                    if ((NULL == tmpReadouts[r]->mask) ||
     217                            !(maskVal && tmpReadouts[r]->mask->data.U8[imageRow][imageCol])) {
     218                        tmpPixels->data.F32[r] = tmpReadouts[r]->image->data.F32[imageRow][imageCol];
    213219                        tmpPixelMask->data.U8[r] = 0;
    214220                    } else {
     
    220226                    tmpPixelMask->data.U8[r] = 1;
    221227                }
     228                //                printf("readout[%d], image [%d][%d] is %f\n", r, i, j, tmpPixels->data.F32[r]);
    222229            }
    223230            // At this point, we have scanned all input readouts for this
     
    299306
    300307    psFree(tmpPixels);
    301     psFree(tmpPixels);
    302308    psFree(tmpPixelMask);
    303309    psFree(tmpPixelMaskNKeep);
  • trunk/psModules/test/Makefile.am

    r2131 r2287  
    1 bin_PROGRAMS = tst_pmFlatField tst_pmMaskBadPixels tst_pmNonLinear tst_pmSubtractBias
     1bin_PROGRAMS = tst_pmFlatField tst_pmMaskBadPixels tst_pmNonLinear tst_pmSubtractBias tst_pmReadoutCombine
    22
    33tst_pmFlatField_SOURCES = tst_pmFlatField.c
     
    1313tst_pmSubtractBias_LDFLAGS = -L../src -lpsmodule
    1414
     15tst_pmReadoutCombine_SOURCES = tst_pmReadoutCombine.c
     16tst_pmReadoutCombine_LDFLAGS = -L../src -lpsmodule
  • trunk/psModules/test/Makefile.in

    r2164 r2287  
    9494am__quote = @am__quote@
    9595install_sh = @install_sh@
    96 bin_PROGRAMS = tst_pmFlatField tst_pmMaskBadPixels tst_pmNonLinear tst_pmSubtractBias
     96bin_PROGRAMS = tst_pmFlatField tst_pmMaskBadPixels tst_pmNonLinear tst_pmSubtractBias tst_pmReadoutCombine
    9797
    9898tst_pmFlatField_SOURCES = tst_pmFlatField.c
     
    107107tst_pmSubtractBias_SOURCES = tst_pmSubtractBias.c
    108108tst_pmSubtractBias_LDFLAGS = -L../src -lpsmodule
     109
     110tst_pmReadoutCombine_SOURCES = tst_pmReadoutCombine.c
     111tst_pmReadoutCombine_LDFLAGS = -L../src -lpsmodule
    109112subdir = test
    110113mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
     
    112115CONFIG_CLEAN_FILES =
    113116bin_PROGRAMS = tst_pmFlatField$(EXEEXT) tst_pmMaskBadPixels$(EXEEXT) \
    114         tst_pmNonLinear$(EXEEXT) tst_pmSubtractBias$(EXEEXT)
     117        tst_pmNonLinear$(EXEEXT) tst_pmSubtractBias$(EXEEXT) \
     118        tst_pmReadoutCombine$(EXEEXT)
    115119PROGRAMS = $(bin_PROGRAMS)
    116120
     
    127131tst_pmNonLinear_LDADD = $(LDADD)
    128132tst_pmNonLinear_DEPENDENCIES =
     133am_tst_pmReadoutCombine_OBJECTS = tst_pmReadoutCombine.$(OBJEXT)
     134tst_pmReadoutCombine_OBJECTS = $(am_tst_pmReadoutCombine_OBJECTS)
     135tst_pmReadoutCombine_LDADD = $(LDADD)
     136tst_pmReadoutCombine_DEPENDENCIES =
    129137am_tst_pmSubtractBias_OBJECTS = tst_pmSubtractBias.$(OBJEXT)
    130138tst_pmSubtractBias_OBJECTS = $(am_tst_pmSubtractBias_OBJECTS)
     
    142150@AMDEP_TRUE@    ./$(DEPDIR)/tst_pmMaskBadPixels.Po \
    143151@AMDEP_TRUE@    ./$(DEPDIR)/tst_pmNonLinear.Po \
     152@AMDEP_TRUE@    ./$(DEPDIR)/tst_pmReadoutCombine.Po \
    144153@AMDEP_TRUE@    ./$(DEPDIR)/tst_pmSubtractBias.Po
    145154COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
     
    151160        $(AM_LDFLAGS) $(LDFLAGS) -o $@
    152161DIST_SOURCES = $(tst_pmFlatField_SOURCES) $(tst_pmMaskBadPixels_SOURCES) \
    153         $(tst_pmNonLinear_SOURCES) $(tst_pmSubtractBias_SOURCES)
     162        $(tst_pmNonLinear_SOURCES) $(tst_pmReadoutCombine_SOURCES) \
     163        $(tst_pmSubtractBias_SOURCES)
    154164DIST_COMMON = Makefile.am Makefile.in
    155 SOURCES = $(tst_pmFlatField_SOURCES) $(tst_pmMaskBadPixels_SOURCES) $(tst_pmNonLinear_SOURCES) $(tst_pmSubtractBias_SOURCES)
     165SOURCES = $(tst_pmFlatField_SOURCES) $(tst_pmMaskBadPixels_SOURCES) $(tst_pmNonLinear_SOURCES) $(tst_pmReadoutCombine_SOURCES) $(tst_pmSubtractBias_SOURCES)
    156166
    157167all: all-am
     
    202212        @rm -f tst_pmNonLinear$(EXEEXT)
    203213        $(LINK) $(tst_pmNonLinear_LDFLAGS) $(tst_pmNonLinear_OBJECTS) $(tst_pmNonLinear_LDADD) $(LIBS)
     214tst_pmReadoutCombine$(EXEEXT): $(tst_pmReadoutCombine_OBJECTS) $(tst_pmReadoutCombine_DEPENDENCIES)
     215        @rm -f tst_pmReadoutCombine$(EXEEXT)
     216        $(LINK) $(tst_pmReadoutCombine_LDFLAGS) $(tst_pmReadoutCombine_OBJECTS) $(tst_pmReadoutCombine_LDADD) $(LIBS)
    204217tst_pmSubtractBias$(EXEEXT): $(tst_pmSubtractBias_OBJECTS) $(tst_pmSubtractBias_DEPENDENCIES)
    205218        @rm -f tst_pmSubtractBias$(EXEEXT)
     
    215228@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_pmMaskBadPixels.Po@am__quote@
    216229@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_pmNonLinear.Po@am__quote@
     230@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_pmReadoutCombine.Po@am__quote@
    217231@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_pmSubtractBias.Po@am__quote@
    218232
  • trunk/psModules/test/tst_pmSubtractBias.c

    r2147 r2287  
    1 /** @file tst_pmFlatField.c
     1/** @file tst_pmSubtractBias.c
    22 *
    33 *  @brief Contains the tests for pmSubtractBias.c:
     
    1111 *  row in the input image.
    1212 *
    13  *
    1413 *  @author GLG, MHPCC
    1514 *
    16  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    17  *  @date $Date: 2004-10-15 02:15:34 $
     15 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2004-11-05 04:49:47 $
    1817 *
    1918 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
Note: See TracChangeset for help on using the changeset viewer.