IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2751


Ignore:
Timestamp:
Dec 17, 2004, 11:39:39 AM (22 years ago)
Author:
Paul Price
Message:

Working well, and timing OK, but can yet be optimised.

Location:
trunk/stac/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/stac/src/Makefile

    r2711 r2751  
    11SHELL = /bin/sh
    22CC = gcc
    3 CFLAGS += -O2 -g -std=c99 -I/home/mithrandir/price/psLib3/psLib/include -DCRFLUX -DTESTING
     3CFLAGS += -O2 -g -std=c99 -I/home/mithrandir/price/psLib3/psLib/include # -DCRFLUX -DTESTING
    44PSLIB += -L/home/mithrandir/price/psLib3/psLib/lib/ -lpslib -lgsl -lgslcblas -lfftw3f -lsla -lcfitsio -lm
    55LDFLAGS += $(PSLIB)
  • trunk/stac/src/stac.c

    r2711 r2751  
    22#include "pslib.h"
    33#include "stac.h"
     4#include <sys/time.h>
     5
     6double getTime(void)
     7/* Gets the current time.  Got this from Nick Kaiser's fetchpix.c */
     8{
     9    struct timeval tv;
     10    gettimeofday(&tv, NULL);
     11    return(tv.tv_sec + 1.e-6 * tv.tv_usec);
     12}
    413
    514
    615int main(int argc, char **argv)
    716{
     17
     18    double startTime = getTime();
    819
    920#if 0
     
    2435    psTraceSetLevel("stac.combine",10);
    2536    psTraceSetLevel("stac.rejection",10);
     37    psTraceSetLevel("stac.time",10);
     38   
    2639
    2740    // Set logging level
     
    4659    psArray *transformedErrors = NULL;
    4760    psArray *transformed = stacTransform(inputs, inverseMaps, errors, &transformedErrors, NULL, config);
     61
     62    psTrace("stac.time",1,"Transformation completed at %f seconds\n", getTime() - startTime);
    4863
    4964    // Combine with rejection
     
    87102    psFree(combined);
    88103
    89     // Check memory for leaks, corruption
     104    psTrace("stac.time",1,"Combination completed at %f seconds\n", getTime() - startTime);
     105
     106   // Check memory for leaks, corruption
    90107    stacCheckMemory();
    91108}
  • trunk/stac/src/stacRejection.c

    r2670 r2751  
    162162#endif
    163163
     164#ifdef TESTING
    164165                // Check gradient
    165166                float meanGrads = 0.0;
     
    184185                    meanGrads = 0;
    185186                }
     187#else
     188                float meanGrads = 10000.0;
     189#endif
     190
    186191               
    187192#ifdef TESTING
     
    197202                        fprintf(crs, "%d %d --> %f %f %f\n", x, y, ((psImage*)(inputs->data[i]))->data.F32[y][x],
    198203                                maskVal, stacGradient(inputs->data[i], x, y));
     204#endif
    199205                    }
    200 #endif
    201206                } else {
    202207                    mask->data.U8[y][x] = 0;
  • trunk/stac/src/stacTransform.c

    r2711 r2751  
    176176        psImage *outError = psImageAlloc(nx, ny, PS_TYPE_F32);
    177177        psTrace("stac.transform", 5, "Allocating space for transformed image, %dx%d\n", nx, ny);
     178
     179#if 0
     180        // No need for initialisation, since we iterate over the entire output image.
    178181        for (int y = 0; y < ny; y++) {
    179182            for (int x = 0; x < nx; x++) {
     
    182185            }
    183186        }
     187#endif
    184188
    185189        // Mask
     
    201205            for (int x = 0; x < nx; x++) {
    202206                // Transform!
    203                 // Could no doubt make this quicker by calculating derivatives and incrementing by those.
    204207                sky->x = (double)x + 0.5;
    205208                sky->y = (double)y + 0.5;
Note: See TracChangeset for help on using the changeset viewer.