Changeset 9740
- Timestamp:
- Oct 24, 2006, 2:27:29 PM (20 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
-
pois/src/poisCalculateDeviations.c (modified) (1 diff)
-
pois/src/poisCheckKernel.c (modified) (1 diff)
-
pois/src/poisFindStamps.c (modified) (1 diff)
-
pois/src/poisKernelBasisFunctions.c (modified) (1 diff)
-
pois/src/poisReadStamps.c (modified) (1 diff)
-
pois/src/poisSolveEquation.c (modified) (1 diff)
-
stac/src/combine.c (modified) (2 diffs)
-
stac/src/combineConfig.c (modified) (1 diff)
-
stac/src/shift.c (modified) (2 diffs)
-
stac/src/shiftSize.c (modified) (2 diffs)
-
stac/src/stac.c (modified) (4 diffs)
-
stac/src/stacCombine.c (modified) (2 diffs)
-
stac/src/stacErrorImages.c (modified) (1 diff)
-
stac/src/stacInvertMaps.c (modified) (4 diffs)
-
stac/src/stacRead.c (modified) (3 diffs)
-
stac/src/stacRejection.c (modified) (2 diffs)
-
stac/src/stacScales.c (modified) (6 diffs)
-
stac/src/stacTransform.c (modified) (2 diffs)
-
stac/src/sum.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pois/src/poisCalculateDeviations.c
r8781 r9740 53 53 if (!deviations) { 54 54 deviations = psVectorAlloc(stamps->n, PS_TYPE_F32); 55 deviations->n = stamps->n;56 55 } 57 56 -
trunk/pois/src/poisCheckKernel.c
r8781 r9740 33 33 psVector *radKernel = psVectorAlloc((2*config->xKernel + 1) * (2*config->yKernel + 1), PS_TYPE_F32); 34 34 psVector *radii = psVectorAlloc((2*config->xKernel + 1) * (2*config->yKernel + 1), PS_TYPE_F32); // Radius 35 radKernel->n = radii->n = (2*config->xKernel + 1) * (2*config->yKernel + 1);36 35 for (int i = 0; i < solution->n - 1; i++) { 37 36 poisKernelBasis *kernel = kernels->data[i]; // The kernel basis function -
trunk/pois/src/poisFindStamps.c
r8781 r9740 51 51 if (stamps == NULL) { 52 52 stamps = psArrayAlloc(nsx * nsy); 53 stamps->n = nsx * nsy;54 53 // Initialise 55 54 for (int i = 0; i < nsx * nsy; i++) { -
trunk/pois/src/poisKernelBasisFunctions.c
r8781 r9740 40 40 41 41 psArray *array = psArrayAlloc(nBF); // Array to hold the basis functions 42 array->n = nBF;43 42 44 43 int num = 0; // Kernel parameter number -
trunk/pois/src/poisReadStamps.c
r8781 r9740 37 37 if (stamps == NULL) { 38 38 stamps = psArrayAlloc(config->nsx); 39 stamps->n = config->nsx;40 39 // Initialise 41 40 for (int i = 0; i < config->nsx; i++) { -
trunk/pois/src/poisSolveEquation.c
r8781 r9740 40 40 psImage *matrix = psImageAlloc(size, size, PS_TYPE_F64); 41 41 psVector *vector = psVectorAlloc(size, PS_TYPE_F64); 42 vector->n = size;43 42 for (int j = 0; j < size; j++) { 44 43 for (int i = 0; i < size; i++) { -
trunk/stac/src/combine.c
r8783 r9740 29 29 // Make fake errors 30 30 psArray *errors = psArrayAlloc(images->n); 31 errors->n = images->n;32 31 for (int i = 0; i < images->n; i++) { 33 32 psImage *image = images->data[i]; … … 49 48 psVector *saturated = psVectorAlloc(images->n, PS_TYPE_F32); // Saturation limits 50 49 psVector *bad = psVectorAlloc(images->n, PS_TYPE_F32); // Bad limits 51 saturated->n = images->n;52 bad->n = images->n;53 50 for (int i = 0; i < images->n; i++) { 54 51 saturated->data.F32[i] = (config->saturated - offsets->data.F32[i]) / scales->data.F32[i]; -
trunk/stac/src/combineConfig.c
r8783 r9740 157 157 config->outName = argv[0]; // Output filename 158 158 config->inNames = psArrayAlloc(argc-1); // Input filenames 159 config->inNames->n = argc-1;160 159 for (int i = 1; i < argc; i++) { 161 160 config->inNames->data[i-1] = psAlloc(strlen(argv[i])); -
trunk/stac/src/shift.c
r8783 r9740 130 130 psArray *maps = psArrayAlloc(1); // An array of one 131 131 psArray *masks = psArrayAlloc(1); // An array of one 132 images->n = maps->n = masks->n = 1;133 132 images->data[0] = image; 134 133 maps->data[0] = map; … … 139 138 psVector *xSize = psVectorAlloc(1, PS_TYPE_S32); // A vector of one 140 139 psVector *ySize = psVectorAlloc(1, PS_TYPE_S32); // A vector of one 141 xSize->n = 1;142 ySize->n = 1;143 140 xSize->data.S32[0] = image->numCols; 144 141 ySize->data.S32[0] = image->numRows; -
trunk/stac/src/shiftSize.c
r8783 r9740 77 77 78 78 psArray *inputs = psArrayAlloc(argc); // Input filenames 79 inputs->n = argc;80 79 for (int i = 0; i < argc; i++) { 81 80 inputs->data[i] = psAlloc(strlen(argv[i])); … … 87 86 psVector *xSize = psVectorAlloc(inputs->n, PS_TYPE_S32); 88 87 psVector *ySize = psVectorAlloc(inputs->n, PS_TYPE_S32); 89 xSize->n = inputs->n;90 ySize->n = inputs->n;91 88 for (int i = 0; i < inputs->n; i++) { 92 89 const char *filename = inputs->data[i]; // Name of FITS file -
trunk/stac/src/stac.c
r8783 r9740 49 49 // Generate masks 50 50 psArray *masks = psArrayAlloc(inputs->n); 51 masks->n = inputs->n;52 51 for (int i = 0; i < inputs->n; i++) { 53 52 psImage *image = inputs->data[i]; // Image for which to get mask … … 74 73 psVector *xSize = psVectorAlloc(inputs->n, PS_TYPE_S32); // Sizes of images in x 75 74 psVector *ySize = psVectorAlloc(inputs->n, PS_TYPE_S32); // Sizes of images in y 76 xSize->n = inputs->n;77 ySize->n = inputs->n;78 75 for (int i = 0; i < inputs->n; i++) { 79 76 psImage *image = inputs->data[i]; // The i-th image … … 169 166 psVector *saturated = psVectorAlloc(transformed->n, PS_TYPE_F32); // Saturation limits 170 167 psVector *bad = psVectorAlloc(transformed->n, PS_TYPE_F32); // Bad limits 171 saturated->n = transformed->n;172 bad->n = transformed->n;173 168 float minSaturated = INFINITY; // The minimum saturation level 174 169 float maxBad = -INFINITY; // The maximum bad level … … 240 235 // Get regions of interest in the source frame 241 236 psArray *regions = psArrayAlloc(inputs->n); // Array of images denoting regions of interest 242 regions->n = inputs->n;243 237 for (int i = 0; i < inputs->n; i++) { 244 238 regions->data[i] = stacAreaOfInterest(rejected->data[i], inverseMaps->data[i], -
trunk/stac/src/stacCombine.c
r8783 r9740 107 107 psVector *deltas = psVectorAlloc(nImages, PS_TYPE_F32); // Will hold the errors in the statistics step 108 108 psVector *mask = psVectorAlloc(nImages, PS_TYPE_U8); // Will hold the mask in the statistics step 109 pixels->n = nImages;110 deltas->n = nImages;111 mask->n = nImages;112 109 113 110 // Set up rejection masks … … 116 113 // Allocate the rejection masks, if required 117 114 *rejected = psArrayAlloc(nImages); 118 (*rejected)->n = nImages;119 115 } else { 120 116 assert((*rejected)->n != nImages); -
trunk/stac/src/stacErrorImages.c
r8783 r9740 15 15 rn /= gain; // Read noise in ADU 16 16 psArray *errors = psArrayAlloc(inputs->n); 17 errors->n = inputs->n;18 17 19 18 psTrace("stac.errors", 1, "Calculating error images....\n"); -
trunk/stac/src/stacInvertMaps.c
r8783 r9740 18 18 int nMaps = maps->n; // Number of maps 19 19 psArray *inverted = psArrayAlloc(nMaps); // Array of inverted maps for output 20 inverted->n = nMaps;21 20 22 21 psTrace("stac.invertMaps", 1, "Inverting maps....\n"); … … 50 49 psVector *xOut = psVectorAlloc(NUM_GRID * NUM_GRID, PS_TYPE_F32); 51 50 psVector *yOut = psVectorAlloc(NUM_GRID * NUM_GRID, PS_TYPE_F32); 52 xIn->n = NUM_GRID * NUM_GRID;53 yIn->n = NUM_GRID * NUM_GRID;54 xOut->n = NUM_GRID * NUM_GRID;55 yOut->n = NUM_GRID * NUM_GRID;56 51 57 52 // Create grid of points … … 75 70 psVector *xVector = psVectorAlloc(nCoeff, PS_TYPE_F64); // Vector for solution in x 76 71 psVector *yVector = psVectorAlloc(nCoeff, PS_TYPE_F64); // Vector for solution in y 77 xVector->n = nCoeff;78 yVector->n = nCoeff;79 72 for (int i = 0; i < nCoeff; i++) { 80 73 for (int j = 0; j < nCoeff; j++) { … … 115 108 // Solution via LU Decomposition 116 109 psVector *permutation = psVectorAlloc(nCoeff, PS_TYPE_F64); // Permutation vector for LU Decomposition 117 permutation->n = nCoeff;118 110 psImage *luMatrix = psMatrixLUD(NULL, &permutation, matrix); // LU decomposed matrix 119 111 psVector *xSolution = psMatrixLUSolve(NULL, luMatrix, xVector, permutation); // Solution in x -
trunk/stac/src/stacRead.c
r8783 r9740 17 17 int nFiles = filenames->n; // The number of input files 18 18 psArray *images = psArrayAlloc(nFiles); // The input files, to be returned 19 images->n = nFiles;20 19 assert(!headers || ! *headers || (*headers)->n == nFiles); 21 20 if (headers && ! *headers) { 22 21 *headers = psArrayAlloc(nFiles); 23 (*headers)->n = nFiles;24 22 } 25 23 … … 75 73 psTrace("stac.read.coords", 5, "Reading coordinate file, %s\n", filename); 76 74 77 psArray *coords = psArrayAlloc (BUFFER); // The array of coordinates to be returned75 psArray *coords = psArrayAllocEmpty(BUFFER); // The array of coordinates to be returned 78 76 float x, y; // Coordinates to read 79 77 while (fscanf(file, "%f %f\n", &x, &y) == 2) { … … 188 186 int nFiles = filenames->n; // The number of input files 189 187 psArray *maps = psArrayAlloc(nFiles); // The maps, to be returned 190 maps->n = nFiles;191 188 char mapfile[MAXCHAR]; // Filename of map 192 189 -
trunk/stac/src/stacRejection.c
r8783 r9740 17 17 { 18 18 int num = 0; 19 psVector *pixels = psVectorAlloc (8, PS_TYPE_F32); // Array of pixels20 psVector *mask = psVectorAlloc (8, PS_TYPE_U8); // Corresponding mask19 psVector *pixels = psVectorAllocEmpty(8, PS_TYPE_F32); // Array of pixels 20 psVector *mask = psVectorAllocEmpty(8, PS_TYPE_U8); // Corresponding mask 21 21 22 22 // Get limits … … 81 81 psVector *grads = psVectorAlloc(nImages, PS_TYPE_F32); // Gradient for each image 82 82 psVector *gradsMask = psVectorAlloc(nImages, PS_TYPE_U8); // Mask for gradient vector 83 grads->n = nImages;84 gradsMask->n = nImages;85 83 86 84 // Transform rejection masks back to source 87 85 psArray *inputRej = psArrayAlloc(nImages); 88 inputRej->n = nImages;89 86 for (int i = 0; i < nImages; i++) { 90 87 // Size of input image -
trunk/stac/src/stacScales.c
r8783 r9740 23 23 psVector *values = psVectorAlloc(numSamples + 1, PS_TYPE_F32); // Vector containing sub-sample 24 24 psVector *mask = psVectorAlloc(numSamples + 1, PS_TYPE_U8); // Mask for sample 25 values->n = numSamples + 1;26 mask->n = numSamples + 1;27 25 28 26 int offset = 0; // Offset from start of the row … … 90 88 } else { 91 89 scales = psVectorAlloc(images->n, PS_TYPE_F32); 92 scales->n = images->n;93 90 *scalesPtr = scales; 94 91 } … … 100 97 } else { 101 98 offsets = psVectorAlloc(images->n, PS_TYPE_F32); 102 offsets->n = images->n;103 99 *offsetsPtr = offsets; 104 100 } … … 130 126 // Transform the stellar positions to match the transformed reference frame 131 127 psArray *starCoordsTransformed = psArrayAlloc(starCoords->n); // Transformed positions 132 starCoordsTransformed->n = starCoords->n;133 128 // Fix up difference between map and output frame 134 129 starMap->x->coeff[0][0] -= xMapDiff; … … 141 136 psArray *stars = psArrayAlloc(images->n); // Array of stellar photometry vectors 142 137 psArray *masks = psArrayAlloc(images->n); // Array of masks for stars 143 stars->n = images->n;144 masks->n = images->n;145 138 146 139 // Set scales relative to the first image … … 155 148 psVector *photometry = psVectorAlloc(starCoords->n, PS_TYPE_F32); // Photometry of the stars 156 149 psVector *mask = psVectorAlloc(starCoords->n, PS_TYPE_U8); // Mask for the photometry 157 photometry->n = starCoords->n;158 mask->n = starCoords->n;159 150 for (int j = 0; j < starCoordsTransformed->n; j++) { 160 151 psPlane *coords = starCoordsTransformed->data[j]; // The coordinates of the star -
trunk/stac/src/stacTransform.c
r8783 r9740 131 131 if (*outputs == NULL) { 132 132 *outputs = psArrayAlloc(nImages); 133 (*outputs)->n = nImages;134 133 psTrace("stac.transform", 5, "Allocating space for transformed images, %dx%d\n", outnx, outny); 135 134 for (int i = 0; i < nImages; i++) { … … 143 142 if (errors && (*outErrors == NULL)) { 144 143 *outErrors = psArrayAlloc(errors->n); 145 (*outErrors)->n = errors->n;146 144 psTrace("stac.transform", 5, "Allocating space for transformed error images, %dx%d\n", outnx, outny); 147 145 for (int i = 0; i < nImages; i++) { -
trunk/stac/src/sum.c
r8783 r9740 14 14 const char *outputName = argv[1]; // Output file name 15 15 psArray *inputNames = psArrayAlloc(argc-2); 16 inputNames->n = argc - 2;17 16 for (int i = 2; i < argc; i++) { 18 17 inputNames->data[i-2] = psStringCopy(argv[i]);
Note:
See TracChangeset
for help on using the changeset viewer.
