Changeset 38540
- Timestamp:
- Jun 24, 2015, 6:02:53 PM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150616/Ohana/src/addstar
- Files:
-
- 5 edited
-
include/addstar.h (modified) (1 diff)
-
src/FilterStars.c (modified) (2 diffs)
-
src/LoadData.c (modified) (2 diffs)
-
src/ReadStarsFITS.c (modified) (1 diff)
-
src/ReadXradFITS.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150616/Ohana/src/addstar/include/addstar.h
r38525 r38540 266 266 // Stars *MergeStars PROTO((Stars *stars, unsigned int *Nstars, Stars *instars, unsigned int Ninstars)); 267 267 268 // int ReadXradFITS PROTO((FILE *f, Header *theader, Stars *stars, unsigned int Nstars));268 int ReadXradFITS PROTO((FILE *f, Header *theader, Catalog *catalog)); 269 269 270 270 double scat_subpix PROTO((double x, double y)); -
branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/FilterStars.c
r38525 r38540 27 27 Catalog *outcat = addstar_catalog_init (newcat->Nmeasure); 28 28 ALLOCATE (outcat->average, Average, newcat->Nmeasure); 29 if (newcat->lensing) { 30 ALLOCATE (outcat->lensing, Lensing, newcat->Nlensing); 31 } 29 32 30 33 for (N = j = 0; j < newcat->Nmeasure; j++) { … … 42 45 dvo_average_init (&outcat->average[N]); 43 46 outcat->measure[N] = newcat->measure[j]; 47 48 if (newcat->lensing) { 49 outcat->lensing[N] = newcat->lensing[j]; 50 outcat->average[N].Nlensing = 1; 51 outcat->average[N].lensingOffset = N; 52 } 44 53 45 54 outcat->average[N].Nmeasure = 1; -
branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/LoadData.c
r38536 r38540 88 88 images[0][Nvalid].nstar = newcat->Nmeasure; 89 89 90 # if (0)91 90 // XRAD : if we want to read the xrad table, skip to that table here: 92 91 if (headerSets[i].extnum_xrad != -1) { … … 98 97 fseeko (f, Nskip, SEEK_SET); 99 98 100 if (!ReadXradFITS (f, headers[Nxrad], &catalog[ncatalog], images[0][Nvalid].nstar)) {99 if (!ReadXradFITS (f, headers[Nxrad], newcat)) { 101 100 fprintf (stderr, "problem reading the radial flux data for %s\n", headerSets[i].extdata); 102 101 } 103 102 } 104 # endif105 103 106 104 // replace full input catalog newcat with subset version -
branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/ReadStarsFITS.c
r38530 r38540 1205 1205 catalog->lensing[i].E2_psf = ps1data[i].E2_psf; 1206 1206 1207 // catalog->lensing[i].F_ApR5 = ps1data[i].F_ApR5; 1208 // catalog->lensing[i].dF_ApR5 = ps1data[i].dF_ApR5; 1209 // catalog->lensing[i].sF_ApR5 = ps1data[i].sF_ApR5; 1210 // catalog->lensing[i].fF_ApR5 = ps1data[i].fF_ApR5; 1211 // 1212 // catalog->lensing[i].F_ApR6 = ps1data[i].F_ApR6; 1213 // catalog->lensing[i].dF_ApR6 = ps1data[i].dF_ApR6; 1214 // catalog->lensing[i].sF_ApR6 = ps1data[i].sF_ApR6; 1215 // catalog->lensing[i].fF_ApR6 = ps1data[i].fF_ApR6; 1216 1217 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 1218 catalog->lensing[i].detID = ps1data[i].detID; 1207 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 1208 catalog->lensing[i].detID = ps1data[i].detID; 1219 1209 1220 1210 // the Average fields and the following Measure fields are set in FilterStars after -
branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/ReadXradFITS.c
r38153 r38540 3 3 // given a file with the pointer at the start of the table block and the 4 4 // corresponding image header, load the xrad data from the table 5 int ReadXradFITS (FILE *f, Header *theader, Stars *stars, unsigned int Nstars) {5 int ReadXradFITS (FILE *f, Header *theader, Catalog *catalog) { 6 6 7 7 FTable table; … … 51 51 myAssert (Nrow == NrowAlt, "column mismatch?"); 52 52 53 if (Nrow > Nstars) {53 if (Nrow > catalog->Nmeasure) { 54 54 myAbort("more radial measurements than stars? seems like a bug\n"); 55 55 } 56 56 57 myAssert (catalog->lensing, "lensing is not allocated"); 58 // we could allocate here, or just insist this is an error? 59 // if (!catalog->lensing) { 60 // ALLOCATE (catalog->lensing, Lensing, catalog->Nmeasure); 61 // } 62 57 63 int i; 58 64 int Nap = 0; 59 for (i = 0; i < Nstars; i++) {60 if ( stars[i].measure.detID < RadID[Nap]) {61 continue; // this star does not have an aperture65 for (i = 0; i < catalog->Nmeasure; i++) { 66 if (catalog->measure[i].detID < RadID[Nap]) { 67 myAbort("star without radial aperture, seems like a bug"); // this star does not have an aperture 62 68 } 63 if ( stars[i].measure.detID > RadID[Nap]) {69 if (catalog->measure[i].detID > RadID[Nap]) { 64 70 myAbort("radial apertures out of order? seems like a bug\n"); 65 71 } 66 72 67 // we could allocate here, or just insist this is an error? 68 if (!stars[i].lensing) { 69 fprintf (stderr, "!"); 70 ALLOCATE (stars[i].lensing, Lensing, 1); 71 dvo_lensing_init (stars[i].lensing); 72 } 73 // we assumed we have already set up lensing in ReadStarsFITS.c 73 74 74 75 // XXX this is all hard-wired and should make use of the headers. … … 77 78 // SDSS 3, 4, 5, 6, 7 78 79 79 stars[i].lensing->F_ApR5 = AperFlux [Nap*Ncol + 2];80 stars[i].lensing->dF_ApR5 = AperFluxErr[Nap*Ncol + 2];81 stars[i].lensing->sF_ApR5 = AperFluxStd[Nap*Ncol + 2];82 stars[i].lensing->fF_ApR5 = AperFill [Nap*Ncol + 2];80 catalog->lensing[i]. F_ApR5 = AperFlux [Nap*Ncol + 2]; 81 catalog->lensing[i].dF_ApR5 = AperFluxErr[Nap*Ncol + 2]; 82 catalog->lensing[i].sF_ApR5 = AperFluxStd[Nap*Ncol + 2]; 83 catalog->lensing[i].fF_ApR5 = AperFill [Nap*Ncol + 2]; 83 84 84 stars[i].lensing->F_ApR6 = AperFlux [Nap*Ncol + 3];85 stars[i].lensing->dF_ApR6 = AperFluxErr[Nap*Ncol + 3];86 stars[i].lensing->sF_ApR6 = AperFluxStd[Nap*Ncol + 3];87 stars[i].lensing->fF_ApR6 = AperFill [Nap*Ncol + 3];85 catalog->lensing[i]. F_ApR6 = AperFlux [Nap*Ncol + 3]; 86 catalog->lensing[i].dF_ApR6 = AperFluxErr[Nap*Ncol + 3]; 87 catalog->lensing[i].sF_ApR6 = AperFluxStd[Nap*Ncol + 3]; 88 catalog->lensing[i].fF_ApR6 = AperFill [Nap*Ncol + 3]; 88 89 89 stars[i].lensing->F_ApR7 = AperFlux [Nap*Ncol + 4];90 stars[i].lensing->dF_ApR7 = AperFluxErr[Nap*Ncol + 4];91 stars[i].lensing->sF_ApR7 = AperFluxStd[Nap*Ncol + 4];92 stars[i].lensing->fF_ApR7 = AperFill [Nap*Ncol + 4];90 catalog->lensing[i]. F_ApR7 = AperFlux [Nap*Ncol + 4]; 91 catalog->lensing[i].dF_ApR7 = AperFluxErr[Nap*Ncol + 4]; 92 catalog->lensing[i].sF_ApR7 = AperFluxStd[Nap*Ncol + 4]; 93 catalog->lensing[i].fF_ApR7 = AperFill [Nap*Ncol + 4]; 93 94 Nap ++; 94 95 } 96 catalog->Nlensing = Nap; 97 98 gfits_free_table (&table); 99 free (AperFlux); 100 free (AperFluxErr); 101 free (AperFluxStd); 102 free (AperFill); 103 free (RadID); 95 104 96 105 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.
