Changeset 35416 for trunk/Ohana/src/addstar
- Timestamp:
- Apr 19, 2013, 4:31:05 PM (13 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 5 edited
-
. (modified) (1 prop)
-
src/addstar/src/GetFileMode.c (modified) (4 diffs)
-
src/addstar/src/MatchHeaders.c (modified) (1 diff)
-
src/addstar/src/ReadStarsFITS.c (modified) (3 diffs)
-
src/addstar/src/load2mass_catalog.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
trunk/Ohana/src/addstar/src/GetFileMode.c
r35108 r35416 20 20 havePHOT_VER = gfits_scan (header, "PHOT_VER", "%s", 1, ctmp); 21 21 haveTARG_VER = gfits_scan (header, "TARG_VER", "%s", 1, ctmp); 22 if (havePHOT_VER && haveTARG_VER) return SDSS_OBJ; 22 if (havePHOT_VER && haveTARG_VER) { 23 if (VERBOSE) fprintf (stderr, "found SDSS objects\n"); 24 return SDSS_OBJ; 25 } 23 26 24 27 if (haveNaxis && (Naxis == 2)) { … … 28 31 if ((Nx > 0) && (Ny > 0)) { 29 32 if (haveCTYPE && !strcmp (&ctype[4], "-WRP")) { 33 if (VERBOSE) fprintf (stderr, "found MOSAIC CMP\n"); 30 34 return MOSAIC_CMP; 31 35 } 36 if (VERBOSE) fprintf (stderr, "found SIMPLE CMP\n"); 32 37 return SIMPLE_CMP; 33 38 } … … 36 41 if (haveNaxis && (TEXTMODE || !simple)) { 37 42 if (haveCTYPE && !strcmp (&ctype[4], "-WRP")) { 43 if (VERBOSE) fprintf (stderr, "found MOSAIC CMP\n"); 38 44 return MOSAIC_CMP; 39 45 } 46 if (VERBOSE) fprintf (stderr, "found SIMPLE CMP\n"); 40 47 return SIMPLE_CMP; 41 48 } … … 43 50 if (!extend && strcmp (&ctype[4], "-DIS")) { 44 51 if (!strcmp (&ctype[4], "-WRP")) { 52 if (VERBOSE) fprintf (stderr, "found MOSAIC CMF\n"); 45 53 return MOSAIC_CMF; 46 54 } 55 if (VERBOSE) fprintf (stderr, "found SIMPLE CMF\n"); 47 56 return SIMPLE_CMF; 48 57 } 49 58 50 59 if (!extend && !strcmp (&ctype[4], "-DIS")) { 60 if (VERBOSE) fprintf (stderr, "found MOSAIC PHU\n"); 51 61 return MOSAIC_PHU; 52 62 } 53 63 54 64 if (extend && strcmp (&ctype[4], "-DIS")) { 65 if (VERBOSE) fprintf (stderr, "found SIMPLE MEF\n"); 55 66 return SIMPLE_MEF; 56 67 } 57 68 58 69 if (extend && !strcmp (&ctype[4], "-DIS")) { 70 if (VERBOSE) fprintf (stderr, "found MOSAIC MEF\n"); 59 71 return MOSAIC_MEF; 60 72 } 61 73 74 if (VERBOSE) fprintf (stderr, "extension type is unknown\n"); 62 75 return (NONE); 63 76 } -
trunk/Ohana/src/addstar/src/MatchHeaders.c
r34405 r35416 61 61 if (!strcmp (exttype, "PS1_SV1")) goto keep; 62 62 if (!strcmp (exttype, "PS1_SV2")) goto keep; 63 if (!strcmp (exttype, "PS1_DV3")) { 64 goto keep; 65 } 63 66 continue; 64 67 -
trunk/Ohana/src/addstar/src/ReadStarsFITS.c
r34580 r35416 15 15 Stars *Convert_PS1_SV1_Alt PROTO((FTable *table, unsigned int *nstars)); 16 16 Stars *Convert_PS1_SV2 PROTO((FTable *table, unsigned int *nstars)); 17 Stars *Convert_PS1_DV3 PROTO((FTable *table, unsigned int *nstars)); 17 18 18 19 // given a file with the pointer at the start of the table block and the … … 78 79 stars = Convert_PS1_SV2 (&table, &Nstars); 79 80 } 81 if (!strcmp (type, "PS1_DV3")) { 82 stars = Convert_PS1_DV3 (&table, &Nstars); 83 } 80 84 if (stars == NULL) { 81 85 fprintf (stderr, "invalid table type %s\n", type); … … 962 966 } 963 967 964 968 Stars *Convert_PS1_DV3 (FTable *table, unsigned int *nstars) { 969 970 off_t Nstars; 971 unsigned int i; 972 double ZeroPt; 973 Stars *stars; 974 CMF_PS1_DV3 *ps1data; 975 976 ps1data = gfits_table_get_CMF_PS1_DV3 (table, &Nstars, NULL); 977 if (!ps1data) { 978 fprintf (stderr, "skipping inconsistent entry\n"); 979 return (NULL); 980 } 981 ZeroPt = GetZeroPoint(); 982 983 ALLOCATE (stars, Stars, Nstars); 984 for (i = 0; i < Nstars; i++) { 985 InitStar (&stars[i]); 986 stars[i].measure.Xccd = ps1data[i].X; 987 stars[i].measure.Yccd = ps1data[i].Y; 988 stars[i].measure.dXccd = ToShortPixels(ps1data[i].dX); 989 stars[i].measure.dYccd = ToShortPixels(ps1data[i].dY); 990 991 stars[i].measure.posangle = ToShortDegrees(ps1data[i].posangle); 992 stars[i].measure.pltscale = ps1data[i].pltscale; 993 994 if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) { 995 stars[i].measure.M = NAN; 996 } else { 997 stars[i].measure.M = ps1data[i].M + ZeroPt; 998 } 999 stars[i].measure.dM = ps1data[i].dM; 1000 stars[i].measure.dMcal = ps1data[i].dMcal; 1001 stars[i].measure.Map = ps1data[i].Map + ZeroPt; 1002 1003 stars[i].measure.Mkron = (ps1data[i].kronFlux > 0.0) ? -2.5*log10(ps1data[i].kronFlux) + ZeroPt : NAN; 1004 stars[i].measure.dMkron = (ps1data[i].kronFlux > 0.0) ? ps1data[i].kronFluxErr / ps1data[i].kronFlux : NAN; 1005 1006 // these fluxes are converted from counts to counts/sec in FilterStars.c 1007 stars[i].measure.FluxPSF = ps1data[i].Flux; 1008 stars[i].measure.dFluxPSF = ps1data[i].dFlux; 1009 stars[i].measure.FluxKron = ps1data[i].kronFlux; 1010 stars[i].measure.dFluxKron = ps1data[i].kronFluxErr; 1011 1012 stars[i].measure.Sky = ps1data[i].sky; 1013 stars[i].measure.dSky = ps1data[i].dSky; 1014 1015 stars[i].measure.psfChisq = ps1data[i].psfChisq; 1016 stars[i].measure.psfQF = ps1data[i].psfQF; 1017 stars[i].measure.psfQFperf = ps1data[i].psfQFperf; 1018 stars[i].measure.psfNdof = ps1data[i].psfNdof; 1019 stars[i].measure.psfNpix = ps1data[i].psfNpix; 1020 stars[i].measure.crNsigma = ps1data[i].crNsigma; 1021 stars[i].measure.extNsigma = ps1data[i].extNsigma; 1022 1023 stars[i].measure.FWx = ToShortPixels(ps1data[i].fx); 1024 stars[i].measure.FWy = ToShortPixels(ps1data[i].fy); 1025 stars[i].measure.theta = ToShortDegrees(ps1data[i].df); 1026 1027 stars[i].measure.Mxx = ToShortPixels(ps1data[i].Mxx); 1028 stars[i].measure.Mxy = ToShortPixels(ps1data[i].Mxy); 1029 stars[i].measure.Myy = ToShortPixels(ps1data[i].Myy); 1030 1031 stars[i].measure.photFlags = ps1data[i].flags; 1032 1033 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 1034 stars[i].measure.detID = ps1data[i].detID; 1035 1036 // the Average fields and the following Measure fields are set in FilterStars after 1037 // the image metadata is in hand: dR, dD, Mcal, dt, airmass, az, t, imageID, extID. 1038 1039 // averef is set in find_matches 1040 1041 // dbFlags is zero on ingest. 1042 1043 // the following fields are currently not being set anywhere: t_msec 1044 } 1045 *nstars = Nstars; 1046 return (stars); 1047 } 1048 1049 1050 -
trunk/Ohana/src/addstar/src/load2mass_catalog.c
r34405 r35416 20 20 // XXX for now, the output objects will have limited astrometric interpretation... 21 21 // XXX every 3 stars represents 3 measurements and 1 average 22 dvo_average_init (&catalog[0].average[Nave]); 22 23 catalog[0].average[Nave].R = stars[i].average.R; 23 24 catalog[0].average[Nave].D = stars[i].average.D; 24 catalog[0].average[Nave].dR = 0;25 catalog[0].average[Nave].dD = 0;26 catalog[0].average[Nave].uR = 0;27 catalog[0].average[Nave].uD = 0;28 catalog[0].average[Nave].duR = 0;29 catalog[0].average[Nave].duD = 0;30 catalog[0].average[Nave].P = 0;31 catalog[0].average[Nave].dP = 0;32 33 // XXX for now, set the average mag data to NULL34 catalog[0].average[Nave].Nmeasure = 0;35 catalog[0].average[Nave].Nmissing = 0;36 catalog[0].average[Nave].ChiSqAve = NAN_S_SHORT;37 25 catalog[0].average[Nave].measureOffset = Nmeas; 38 catalog[0].average[Nave].missingOffset = -1;39 catalog[0].average[Nave].flags = 0;40 26 41 27 for (j = 0; j < Nsec; j++) { 42 catalog[0].secfilt[Nave*Nsec+j].M = NAN; 43 catalog[0].secfilt[Nave*Nsec+j].dM = NAN; 44 catalog[0].secfilt[Nave*Nsec+j].Xm = NAN_S_SHORT; 45 catalog[0].secfilt[Nave*Nsec+j].M_20 = NAN_S_SHORT; 46 catalog[0].secfilt[Nave*Nsec+j].M_80 = NAN_S_SHORT; 47 catalog[0].secfilt[Nave*Nsec+j].Ncode = 0; 48 catalog[0].secfilt[Nave*Nsec+j].Nused = 0; 28 dvo_secfilt_init (&catalog[0].secfilt[Nave*Nsec+j]); 49 29 } 50 30
Note:
See TracChangeset
for help on using the changeset viewer.
