Changeset 2751
- Timestamp:
- Dec 17, 2004, 11:39:39 AM (22 years ago)
- Location:
- trunk/stac/src
- Files:
-
- 4 edited
-
Makefile (modified) (1 diff)
-
stac.c (modified) (4 diffs)
-
stacRejection.c (modified) (3 diffs)
-
stacTransform.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/stac/src/Makefile
r2711 r2751 1 1 SHELL = /bin/sh 2 2 CC = gcc 3 CFLAGS += -O2 -g -std=c99 -I/home/mithrandir/price/psLib3/psLib/include -DCRFLUX -DTESTING3 CFLAGS += -O2 -g -std=c99 -I/home/mithrandir/price/psLib3/psLib/include # -DCRFLUX -DTESTING 4 4 PSLIB += -L/home/mithrandir/price/psLib3/psLib/lib/ -lpslib -lgsl -lgslcblas -lfftw3f -lsla -lcfitsio -lm 5 5 LDFLAGS += $(PSLIB) -
trunk/stac/src/stac.c
r2711 r2751 2 2 #include "pslib.h" 3 3 #include "stac.h" 4 #include <sys/time.h> 5 6 double 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 } 4 13 5 14 6 15 int main(int argc, char **argv) 7 16 { 17 18 double startTime = getTime(); 8 19 9 20 #if 0 … … 24 35 psTraceSetLevel("stac.combine",10); 25 36 psTraceSetLevel("stac.rejection",10); 37 psTraceSetLevel("stac.time",10); 38 26 39 27 40 // Set logging level … … 46 59 psArray *transformedErrors = NULL; 47 60 psArray *transformed = stacTransform(inputs, inverseMaps, errors, &transformedErrors, NULL, config); 61 62 psTrace("stac.time",1,"Transformation completed at %f seconds\n", getTime() - startTime); 48 63 49 64 // Combine with rejection … … 87 102 psFree(combined); 88 103 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 90 107 stacCheckMemory(); 91 108 } -
trunk/stac/src/stacRejection.c
r2670 r2751 162 162 #endif 163 163 164 #ifdef TESTING 164 165 // Check gradient 165 166 float meanGrads = 0.0; … … 184 185 meanGrads = 0; 185 186 } 187 #else 188 float meanGrads = 10000.0; 189 #endif 190 186 191 187 192 #ifdef TESTING … … 197 202 fprintf(crs, "%d %d --> %f %f %f\n", x, y, ((psImage*)(inputs->data[i]))->data.F32[y][x], 198 203 maskVal, stacGradient(inputs->data[i], x, y)); 204 #endif 199 205 } 200 #endif201 206 } else { 202 207 mask->data.U8[y][x] = 0; -
trunk/stac/src/stacTransform.c
r2711 r2751 176 176 psImage *outError = psImageAlloc(nx, ny, PS_TYPE_F32); 177 177 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. 178 181 for (int y = 0; y < ny; y++) { 179 182 for (int x = 0; x < nx; x++) { … … 182 185 } 183 186 } 187 #endif 184 188 185 189 // Mask … … 201 205 for (int x = 0; x < nx; x++) { 202 206 // Transform! 203 // Could no doubt make this quicker by calculating derivatives and incrementing by those.204 207 sky->x = (double)x + 0.5; 205 208 sky->y = (double)y + 0.5;
Note:
See TracChangeset
for help on using the changeset viewer.
