Changeset 7012
- Timestamp:
- Apr 30, 2006, 12:08:33 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceIO_CMP.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO_CMP.c
r6872 r7012 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-04- 17 18:01:05$5 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-30 22:08:33 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 29 29 #include "pmModelGroup.h" 30 30 #include "pmSourceIO.h" 31 32 // XXX make sure in and out have consistent zero-point adjustments 33 // XXX make sure the angle in correctly translated to/from degrees 34 // XXX we lose all information from the 'type' field 31 35 32 36 // elixir-style pseudo FITS table (header + ascii list) … … 121 125 { 122 126 127 bool status; 123 128 int Ninstar; 124 129 psF32 *PAR, *dPAR; 125 bool status;126 130 psEllipseShape shape; 127 131 psEllipseAxes axes; … … 162 166 163 167 // we have fixed bytes / line : use that info 164 char *buffer = psAlloc (BYTES_STAR*nStars); 168 // XXX use the min of nStars and BLOCK? 169 char *buffer = psAlloc (BYTES_STAR*PS_MIN(nStars, BLOCK)); 165 170 166 171 int Nextra = 0; … … 209 214 for (int j = 0; j < Ninstar; j++) { 210 215 psString line = psStringNCopy (&buffer[j*BYTES_STAR], BYTES_STAR); 216 217 // XXX this is failing on lines where there are multiple spaces in a row 211 218 psList *list = psStringSplit (line, " "); 212 219 psArray *array = psListToArray (list); 213 220 221 // XXX this is a bit cheap: I don't even attempt to interpret the 222 // sextractor / dophot analysis to distinguish stars and galaxies 223 // your milage may vary... 214 224 pmSource *source = pmSourceAlloc (); 215 225 pmModel *model = pmModelAlloc (modelType); 216 source->modelPSF = model;217 226 218 227 PAR = model->params->data.F32; … … 236 245 PAR[6] = shape.sxy; 237 246 238 // source->type = atof (array->data[4]); 247 source->modelPSF = model; 248 source->type = PM_SOURCE_TYPE_STAR; 239 249 240 250 psArrayAdd (sources, 100, source); 251 252 psFree (line); 253 psFree (list); 254 psFree (array); 255 psFree (source); 256 241 257 } 242 258 } 243 259 done_load: 244 260 245 // XXX free up temp memory in this block246 261 // XXX if sources->n != nStars, give an error? 262 psFree (buffer); 247 263 248 264 fclose (f);
Note:
See TracChangeset
for help on using the changeset viewer.
