Changeset 37992
- Timestamp:
- Mar 23, 2015, 8:13:04 AM (11 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 5 edited
- 6 moved
-
addstar/src/ReadStarsFITS.c (modified) (9 diffs)
-
libautocode/def/lensing-ps1-v5-r0.d (moved) (moved from trunk/Ohana/src/libautocode/def/lensing-ps1-v5-alt.d ) (1 diff)
-
libautocode/def/lensing-ps1-v5-r1.d (moved) (moved from trunk/Ohana/src/libautocode/def/lensing-ps1-v5.d ) (1 diff)
-
libautocode/def/lensing.d (modified) (2 diffs)
-
libdvo/Makefile (modified) (2 diffs)
-
libdvo/include/cmf-ps1-v5-r0-lensing.h (moved) (moved from trunk/Ohana/src/libdvo/include/cmf-ps1-v5-lensing-alt.h ) (1 diff)
-
libdvo/include/cmf-ps1-v5-r1-lensing.h (moved) (moved from trunk/Ohana/src/libdvo/include/cmf-ps1-v5-lensing.h ) (2 diffs)
-
libdvo/include/dvo.h (modified) (1 diff)
-
libdvo/src/cmf-ps1-v5-r0-lensing.c (moved) (moved from trunk/Ohana/src/libdvo/src/cmf-ps1-v5-lensing-alt.c ) (11 diffs)
-
libdvo/src/cmf-ps1-v5-r2-lensing.c (moved) (moved from trunk/Ohana/src/libdvo/src/cmf-ps1-v5-lensing.c ) (14 diffs)
-
libdvo/src/dvo_convert_PS1_V5.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/ReadStarsFITS.c
r37967 r37992 4 4 // (excluding SDSS data and reference database info, such as 2MASS) 5 5 // NOTE: these must also be listed in MatchHeaders.c (line ~ 62) 6 Stars *Convert_SMPDATA PROTO((FTable *table, unsigned int *nstars)); 7 Stars *Convert_PS1_DEV_0 PROTO((FTable *table, unsigned int *nstars)); 8 Stars *Convert_PS1_DEV_1 PROTO((FTable *table, unsigned int *nstars)); 9 Stars *Convert_PS1_V1 PROTO((FTable *table, unsigned int *nstars)); 10 Stars *Convert_PS1_V1_Alt PROTO((FTable *table, unsigned int *nstars)); 11 Stars *Convert_PS1_V2 PROTO((FTable *table, unsigned int *nstars)); 12 Stars *Convert_PS1_V3 PROTO((FTable *table, unsigned int *nstars)); 13 Stars *Convert_PS1_V4 PROTO((FTable *table, unsigned int *nstars)); 14 Stars *Convert_PS1_V5 PROTO((FTable *table, unsigned int *nstars)); 15 Stars *Convert_PS1_V5_Lensing PROTO((FTable *table, unsigned int *nstars)); 16 Stars *Convert_PS1_V5_Lensing_Alt PROTO((FTable *table, unsigned int *nstars)); 17 Stars *Convert_PS1_SV1 PROTO((FTable *table, unsigned int *nstars)); 18 Stars *Convert_PS1_SV1_Alt PROTO((FTable *table, unsigned int *nstars)); 19 Stars *Convert_PS1_SV2 PROTO((FTable *table, unsigned int *nstars)); 20 Stars *Convert_PS1_SV3 PROTO((FTable *table, unsigned int *nstars)); 21 Stars *Convert_PS1_SV4 PROTO((FTable *table, unsigned int *nstars)); 22 Stars *Convert_PS1_DV3 PROTO((FTable *table, unsigned int *nstars)); 23 Stars *Convert_PS1_DV4 PROTO((FTable *table, unsigned int *nstars)); 24 Stars *Convert_PS1_DV5 PROTO((FTable *table, unsigned int *nstars)); 6 Stars *Convert_SMPDATA PROTO((FTable *table, unsigned int *nstars)); 7 Stars *Convert_PS1_DEV_0 PROTO((FTable *table, unsigned int *nstars)); 8 Stars *Convert_PS1_DEV_1 PROTO((FTable *table, unsigned int *nstars)); 9 Stars *Convert_PS1_V1 PROTO((FTable *table, unsigned int *nstars)); 10 Stars *Convert_PS1_V1_Alt PROTO((FTable *table, unsigned int *nstars)); 11 Stars *Convert_PS1_V2 PROTO((FTable *table, unsigned int *nstars)); 12 Stars *Convert_PS1_V3 PROTO((FTable *table, unsigned int *nstars)); 13 Stars *Convert_PS1_V4 PROTO((FTable *table, unsigned int *nstars)); 14 Stars *Convert_PS1_V5 PROTO((FTable *table, unsigned int *nstars)); 15 Stars *Convert_PS1_V5_R0_Lensing PROTO((FTable *table, unsigned int *nstars)); 16 Stars *Convert_PS1_V5_R1_Lensing PROTO((FTable *table, unsigned int *nstars)); 17 Stars *Convert_PS1_V5_R2_Lensing PROTO((FTable *table, unsigned int *nstars)); 18 Stars *Convert_PS1_SV1 PROTO((FTable *table, unsigned int *nstars)); 19 Stars *Convert_PS1_SV1_Alt PROTO((FTable *table, unsigned int *nstars)); 20 Stars *Convert_PS1_SV2 PROTO((FTable *table, unsigned int *nstars)); 21 Stars *Convert_PS1_SV3 PROTO((FTable *table, unsigned int *nstars)); 22 Stars *Convert_PS1_SV4 PROTO((FTable *table, unsigned int *nstars)); 23 Stars *Convert_PS1_DV3 PROTO((FTable *table, unsigned int *nstars)); 24 Stars *Convert_PS1_DV4 PROTO((FTable *table, unsigned int *nstars)); 25 Stars *Convert_PS1_DV5 PROTO((FTable *table, unsigned int *nstars)); 25 26 26 27 // given a file with the pointer at the start of the table block and the … … 86 87 break; 87 88 case 312: 88 stars = Convert_PS1_V5_ Lensing_Alt(&table, &Nstars);89 stars = Convert_PS1_V5_R0_Lensing (&table, &Nstars); 89 90 break; 90 91 case 320: 91 stars = Convert_PS1_V5_Lensing (&table, &Nstars); 92 stars = Convert_PS1_V5_R1_Lensing (&table, &Nstars); 93 break; 94 case 328: 95 stars = Convert_PS1_V5_R2_Lensing (&table, &Nstars); 92 96 break; 93 97 default: … … 864 868 } 865 869 866 Stars *Convert_PS1_V5_ Lensing (FTable *table, unsigned int *nstars) {870 Stars *Convert_PS1_V5_R0_Lensing (FTable *table, unsigned int *nstars) { 867 871 868 872 off_t Nstars; … … 870 874 double ZeroPt; 871 875 Stars *stars; 872 CMF_PS1_V5_ Lensing *ps1data;873 874 ps1data = gfits_table_get_CMF_PS1_V5_ Lensing (table, &Nstars, NULL);876 CMF_PS1_V5_R0_Lensing *ps1data; 877 878 ps1data = gfits_table_get_CMF_PS1_V5_R0_Lensing (table, &Nstars, NULL); 875 879 if (!ps1data) { 876 880 fprintf (stderr, "skipping inconsistent entry\n"); … … 989 993 } 990 994 991 Stars *Convert_PS1_V5_ Lensing_Alt(FTable *table, unsigned int *nstars) {995 Stars *Convert_PS1_V5_R1_Lensing (FTable *table, unsigned int *nstars) { 992 996 993 997 off_t Nstars; … … 995 999 double ZeroPt; 996 1000 Stars *stars; 997 CMF_PS1_V5_ Lensing_Alt*ps1data;998 999 ps1data = gfits_table_get_CMF_PS1_V5_ Lensing_Alt(table, &Nstars, NULL);1001 CMF_PS1_V5_R1_Lensing *ps1data; 1002 1003 ps1data = gfits_table_get_CMF_PS1_V5_R1_Lensing (table, &Nstars, NULL); 1000 1004 if (!ps1data) { 1001 1005 fprintf (stderr, "skipping inconsistent entry\n"); … … 1114 1118 } 1115 1119 1116 Stars *Convert_PS1_ SV1(FTable *table, unsigned int *nstars) {1120 Stars *Convert_PS1_V5_R2_Lensing (FTable *table, unsigned int *nstars) { 1117 1121 1118 1122 off_t Nstars; … … 1120 1124 double ZeroPt; 1121 1125 Stars *stars; 1122 CMF_PS1_SV1 *ps1data; 1123 1124 if (table[0].header[0].Naxis[0] == 196) { 1125 stars = Convert_PS1_SV1_Alt (table, nstars); 1126 return (stars); 1127 } 1128 1129 ps1data = gfits_table_get_CMF_PS1_SV1 (table, &Nstars, NULL); 1126 CMF_PS1_V5_R2_Lensing *ps1data; 1127 1128 ps1data = gfits_table_get_CMF_PS1_V5_R2_Lensing (table, &Nstars, NULL); 1130 1129 if (!ps1data) { 1131 1130 fprintf (stderr, "skipping inconsistent entry\n"); … … 1153 1152 stars[i].measure.dMcal = ps1data[i].dMcal; 1154 1153 stars[i].measure.Map = ps1data[i].Map + ZeroPt; 1154 stars[i].measure.dMap = (ps1data[i].apFlux > 0.0) ? fabs(ps1data[i].apFluxErr / ps1data[i].apFlux) : NAN; 1155 1156 stars[i].measure.Mkron = (ps1data[i].kronFlux > 0.0) ? -2.5*log10(ps1data[i].kronFlux) + ZeroPt : NAN; 1157 stars[i].measure.dMkron = (ps1data[i].kronFlux > 0.0) ? ps1data[i].kronFluxErr / ps1data[i].kronFlux : NAN; 1158 1159 // these fluxes are converted from counts to counts/sec in FilterStars.c 1160 stars[i].measure.FluxPSF = GetFluxFromFluxOrMag (ps1data[i].Flux, ps1data[i].M); 1161 stars[i].measure.dFluxPSF = GetFluxErrFromFluxOrMag (ps1data[i].dFlux, stars[i].measure.FluxPSF, ps1data[i].dM); 1162 stars[i].measure.FluxKron = ps1data[i].kronFlux; 1163 stars[i].measure.dFluxKron = ps1data[i].kronFluxErr; 1164 stars[i].measure.FluxAp = GetFluxFromFluxOrMag (ps1data[i].apFlux, ps1data[i].Map); 1165 stars[i].measure.dFluxAp = GetFluxErrFromFluxOrMag (ps1data[i].apFluxErr, stars[i].measure.FluxAp, stars[i].measure.dMap); 1166 1167 stars[i].measure.Sky = ps1data[i].sky; 1168 stars[i].measure.dSky = ps1data[i].dSky; 1169 1170 stars[i].measure.psfChisq = ps1data[i].psfChisq; 1171 stars[i].measure.psfQF = ps1data[i].psfQF; 1172 stars[i].measure.psfQFperf = ps1data[i].psfQFperf; 1173 1174 stars[i].measure.psfNdof = ps1data[i].psfNdof; 1175 stars[i].measure.psfNpix = ps1data[i].psfNpix; 1176 stars[i].measure.extNsigma = ps1data[i].extNsigma; 1177 1178 stars[i].measure.FWx = ToShortPixels(ps1data[i].fx); 1179 stars[i].measure.FWy = ToShortPixels(ps1data[i].fy); 1180 stars[i].measure.theta = ToShortDegrees(ps1data[i].df); 1181 1182 stars[i].measure.Mxx = ToShortPixels(ps1data[i].Mxx); 1183 stars[i].measure.Mxy = ToShortPixels(ps1data[i].Mxy); 1184 stars[i].measure.Myy = ToShortPixels(ps1data[i].Myy); 1185 1186 stars[i].measure.photFlags = ps1data[i].flags; 1187 stars[i].measure.photFlags2 = ps1data[i].flags2; 1188 1189 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 1190 stars[i].measure.detID = ps1data[i].detID; 1191 1192 ALLOCATE (stars[i].lensing, Lensing, 1); 1193 dvo_lensing_init (stars[i].lensing); 1194 1195 stars[i].lensing->X11_sm_obj = ps1data[i].X11_sm_obj; 1196 stars[i].lensing->X12_sm_obj = ps1data[i].X12_sm_obj; 1197 stars[i].lensing->X22_sm_obj = ps1data[i].X22_sm_obj; 1198 stars[i].lensing->E1_sm_obj = ps1data[i].E1_sm_obj; 1199 stars[i].lensing->E2_sm_obj = ps1data[i].E2_sm_obj; 1200 1201 stars[i].lensing->X11_sh_obj = ps1data[i].X11_sh_obj; 1202 stars[i].lensing->X12_sh_obj = ps1data[i].X12_sh_obj; 1203 stars[i].lensing->X22_sh_obj = ps1data[i].X22_sh_obj; 1204 stars[i].lensing->E1_sh_obj = ps1data[i].E1_sh_obj; 1205 stars[i].lensing->E2_sh_obj = ps1data[i].E2_sh_obj; 1206 1207 stars[i].lensing->X11_sm_psf = ps1data[i].X11_sm_psf; 1208 stars[i].lensing->X12_sm_psf = ps1data[i].X12_sm_psf; 1209 stars[i].lensing->X22_sm_psf = ps1data[i].X22_sm_psf; 1210 stars[i].lensing->E1_sm_psf = ps1data[i].E1_sm_psf; 1211 stars[i].lensing->E2_sm_psf = ps1data[i].E2_sm_psf; 1212 1213 stars[i].lensing->X11_sh_psf = ps1data[i].X11_sh_psf; 1214 stars[i].lensing->X12_sh_psf = ps1data[i].X12_sh_psf; 1215 stars[i].lensing->X22_sh_psf = ps1data[i].X22_sh_psf; 1216 stars[i].lensing->E1_sh_psf = ps1data[i].E1_sh_psf; 1217 stars[i].lensing->E2_sh_psf = ps1data[i].E2_sh_psf; 1218 1219 // stars[i].lensing->F_ApR5 = ps1data[i].F_ApR5; 1220 // stars[i].lensing->dF_ApR5 = ps1data[i].dF_ApR5; 1221 // stars[i].lensing->sF_ApR5 = ps1data[i].sF_ApR5; 1222 // stars[i].lensing->fF_ApR5 = ps1data[i].fF_ApR5; 1223 // 1224 // stars[i].lensing->F_ApR6 = ps1data[i].F_ApR6; 1225 // stars[i].lensing->dF_ApR6 = ps1data[i].dF_ApR6; 1226 // stars[i].lensing->sF_ApR6 = ps1data[i].sF_ApR6; 1227 // stars[i].lensing->fF_ApR6 = ps1data[i].fF_ApR6; 1228 1229 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 1230 stars[i].lensing->detID = ps1data[i].detID; 1231 1232 // the Average fields and the following Measure fields are set in FilterStars after 1233 // the image metadata is in hand: dR, dD, Mcal, dt, airmass, az, t, imageID, extID. 1234 1235 // averef is set in find_matches 1236 1237 // dbFlags is zero on ingest. 1238 1239 // the following fields are currently not being set anywhere: t_msec 1240 } 1241 *nstars = Nstars; 1242 return (stars); 1243 } 1244 1245 Stars *Convert_PS1_SV1 (FTable *table, unsigned int *nstars) { 1246 1247 off_t Nstars; 1248 unsigned int i; 1249 double ZeroPt; 1250 Stars *stars; 1251 CMF_PS1_SV1 *ps1data; 1252 1253 if (table[0].header[0].Naxis[0] == 196) { 1254 stars = Convert_PS1_SV1_Alt (table, nstars); 1255 return (stars); 1256 } 1257 1258 ps1data = gfits_table_get_CMF_PS1_SV1 (table, &Nstars, NULL); 1259 if (!ps1data) { 1260 fprintf (stderr, "skipping inconsistent entry\n"); 1261 return (NULL); 1262 } 1263 ZeroPt = GetZeroPoint(); 1264 1265 ALLOCATE (stars, Stars, Nstars); 1266 for (i = 0; i < Nstars; i++) { 1267 InitStar (&stars[i]); 1268 stars[i].measure.Xccd = ps1data[i].X; 1269 stars[i].measure.Yccd = ps1data[i].Y; 1270 stars[i].measure.dXccd = ToShortPixels(ps1data[i].dX); 1271 stars[i].measure.dYccd = ToShortPixels(ps1data[i].dY); 1272 1273 stars[i].measure.posangle = ToShortDegrees(ps1data[i].posangle); 1274 stars[i].measure.pltscale = ps1data[i].pltscale; 1275 1276 if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) { 1277 stars[i].measure.M = NAN; 1278 } else { 1279 stars[i].measure.M = ps1data[i].M + ZeroPt; 1280 } 1281 stars[i].measure.dM = ps1data[i].dM; 1282 stars[i].measure.dMcal = ps1data[i].dMcal; 1283 stars[i].measure.Map = ps1data[i].Map + ZeroPt; 1155 1284 stars[i].measure.dMap = ps1data[i].dM; // a proxy measure 1156 1285 -
trunk/Ohana/src/libautocode/def/lensing-ps1-v5-r0.d
r37985 r37992 1 STRUCT Lensing_PS1_V5_ ALT2 EXTNAME DVO_LENSING_PS1_V5_ ALT1 STRUCT Lensing_PS1_V5_R0 2 EXTNAME DVO_LENSING_PS1_V5_R0 3 3 TYPE BINTABLE 4 4 SIZE 128 -
trunk/Ohana/src/libautocode/def/lensing-ps1-v5-r1.d
r37985 r37992 1 STRUCT Lensing_PS1_V5 1 STRUCT Lensing_PS1_V5_R1 2 2 EXTNAME DVO_LENSING_PS1_V5 3 3 TYPE BINTABLE -
trunk/Ohana/src/libautocode/def/lensing.d
r37807 r37992 2 2 EXTNAME DVO_LENSING 3 3 TYPE BINTABLE 4 SIZE 1 364 SIZE 144 5 5 DESCRIPTION DVO Lensing Table 6 6 … … 29 29 FIELD E2_sh_psf, E2_SH_PSF, float, lensing shear psf stars E2 30 30 31 FIELD E1_psf, E1_PSF, float, polarization psf stars E1 32 FIELD E2_psf, E2_PSF, float, polarization psf stars E2 33 31 34 FIELD F_ApR5, FLUX_AP_R5, float, Flux inside r = 5 32 35 FIELD dF_ApR5, FLUX_ERR_AP_R5, float, error on Flux inside r = 5 -
trunk/Ohana/src/libdvo/Makefile
r37807 r37992 43 43 $(DESTINC)/cmf-ps1-sv3.h \ 44 44 $(DESTINC)/cmf-ps1-sv4.h \ 45 $(DESTINC)/cmf-ps1-v5-lensing.h \ 46 $(DESTINC)/cmf-ps1-v5-lensing-alt.h 45 $(DESTINC)/cmf-ps1-v5-r0-lensing.h \ 46 $(DESTINC)/cmf-ps1-v5-r1-lensing.h \ 47 $(DESTINC)/cmf-ps1-v5-r2-lensing.h 47 48 48 49 INCS = $(DEFS) $(DESTINC)/dvo.h $(DESTINC)/autocode.h $(DESTINC)/dvo_util.h $(DESTINC)/dvodb.h $(DESTINC)/libdvo_astro.h $(DESTINC)/convert.h $(DESTINC)/get_graphdata.h … … 102 103 $(SRC)/cmf-ps1-sv4.$(ARCH).o \ 103 104 $(SRC)/cmf-ps1-v5.$(ARCH).o \ 104 $(SRC)/cmf-ps1-v5-lensing.$(ARCH).o \ 105 $(SRC)/cmf-ps1-v5-lensing-alt.$(ARCH).o \ 105 $(SRC)/cmf-ps1-v5-r0-lensing.$(ARCH).o \ 106 $(SRC)/cmf-ps1-v5-r1-lensing.$(ARCH).o \ 107 $(SRC)/cmf-ps1-v5-r2-lensing.$(ARCH).o \ 106 108 $(SRC)/dvo_util.$(ARCH).o \ 107 109 $(SRC)/dbBooleanCond.$(ARCH).o \ -
trunk/Ohana/src/libdvo/include/cmf-ps1-v5-r0-lensing.h
r37985 r37992 84 84 short nFrames; // images overlapping peak 85 85 short padding; // padding for 8byte records 86 } CMF_PS1_V5_ Lensing_Alt;86 } CMF_PS1_V5_R0_Lensing; 87 87 88 CMF_PS1_V5_ Lensing_Alt *gfits_table_get_CMF_PS1_V5_Lensing_Alt(FTable *table, off_t *Ndata, char *swapped);89 int gfits_table_set_CMF_PS1_V5_ Lensing_Alt (FTable *ftable, CMF_PS1_V5_Lensing_Alt*data, off_t Ndata);90 int gfits_table_mkheader_CMF_PS1_V5_ Lensing_Alt(Header *header);91 int gfits_convert_CMF_PS1_V5_ Lensing_Alt(unsigned char *data, off_t size, off_t nitems, char toStruct);92 int Send_CMF_PS1_V5_ Lensing_Alt (int device, CMF_PS1_V5_Lensing_Alt*data, int Ndata, int copy);93 int Recv_CMF_PS1_V5_ Lensing_Alt (int device, CMF_PS1_V5_Lensing_Alt**data, int *Ndata);88 CMF_PS1_V5_R0_Lensing *gfits_table_get_CMF_PS1_V5_R0_Lensing (FTable *table, off_t *Ndata, char *swapped); 89 int gfits_table_set_CMF_PS1_V5_R0_Lensing (FTable *ftable, CMF_PS1_V5_R0_Lensing *data, off_t Ndata); 90 int gfits_table_mkheader_CMF_PS1_V5_R0_Lensing (Header *header); 91 int gfits_convert_CMF_PS1_V5_R0_Lensing (unsigned char *data, off_t size, off_t nitems, char toStruct); 92 int Send_CMF_PS1_V5_R0_Lensing (int device, CMF_PS1_V5_R0_Lensing *data, int Ndata, int copy); 93 int Recv_CMF_PS1_V5_R0_Lensing (int device, CMF_PS1_V5_R0_Lensing **data, int *Ndata); -
trunk/Ohana/src/libdvo/include/cmf-ps1-v5-r1-lensing.h
r37985 r37992 74 74 short srcChipX; 75 75 short srcChipY; 76 short padding3; 76 77 77 78 float Mr1; // first radial moment (pixels) … … 88 89 short nFrames; // images overlapping peak 89 90 short padding; // padding for 8byte records 90 } CMF_PS1_V5_ Lensing;91 } CMF_PS1_V5_R1_Lensing; 91 92 92 CMF_PS1_V5_ Lensing *gfits_table_get_CMF_PS1_V5_Lensing (FTable *table, off_t *Ndata, char *swapped);93 int gfits_table_set_CMF_PS1_V5_ Lensing (FTable *ftable, CMF_PS1_V5_Lensing *data, off_t Ndata);94 int gfits_table_mkheader_CMF_PS1_V5_ Lensing (Header *header);95 int gfits_convert_CMF_PS1_V5_ Lensing (unsigned char *data, off_t size, off_t nitems, char toStruct);96 int Send_CMF_PS1_V5_ Lensing (int device, CMF_PS1_V5_Lensing *data, int Ndata, int copy);97 int Recv_CMF_PS1_V5_ Lensing (int device, CMF_PS1_V5_Lensing **data, int *Ndata);93 CMF_PS1_V5_R1_Lensing *gfits_table_get_CMF_PS1_V5_R1_Lensing (FTable *table, off_t *Ndata, char *swapped); 94 int gfits_table_set_CMF_PS1_V5_R1_Lensing (FTable *ftable, CMF_PS1_V5_R1_Lensing *data, off_t Ndata); 95 int gfits_table_mkheader_CMF_PS1_V5_R1_Lensing (Header *header); 96 int gfits_convert_CMF_PS1_V5_R1_Lensing (unsigned char *data, off_t size, off_t nitems, char toStruct); 97 int Send_CMF_PS1_V5_R1_Lensing (int device, CMF_PS1_V5_R1_Lensing *data, int Ndata, int copy); 98 int Recv_CMF_PS1_V5_R1_Lensing (int device, CMF_PS1_V5_R1_Lensing **data, int *Ndata); -
trunk/Ohana/src/libdvo/include/dvo.h
r37807 r37992 334 334 # include "cmf-ps1-sv4.h" 335 335 # include "cmf-ps1-v5.h" 336 # include "cmf-ps1-v5-lensing.h" 337 # include "cmf-ps1-v5-lensing-alt.h" 336 # include "cmf-ps1-v5-r0-lensing.h" 337 # include "cmf-ps1-v5-r1-lensing.h" 338 # include "cmf-ps1-v5-r2-lensing.h" 338 339 339 340 typedef struct { -
trunk/Ohana/src/libdvo/src/cmf-ps1-v5-r0-lensing.c
r37985 r37992 3 3 4 4 // this function is based on the one generated by the autocode of cmf-ps1-v5.d 5 int gfits_convert_CMF_PS1_V5_ Lensing_Alt(unsigned char *data, off_t size, off_t nitems, char toStruct) {5 int gfits_convert_CMF_PS1_V5_R0_Lensing (unsigned char *data, off_t size, off_t nitems, char toStruct) { 6 6 7 7 off_t i; … … 9 9 10 10 if (size != ST_SIZE) { 11 fprintf (stderr, "WARNING: mismatch in data types CMF_PS1_V5_ Lensing_Alt: "OFF_T_FMT" vs %d\n", size, ST_SIZE);11 fprintf (stderr, "WARNING: mismatch in data types CMF_PS1_V5_R0_Lensing: "OFF_T_FMT" vs %d\n", size, ST_SIZE); 12 12 return (FALSE); 13 13 } … … 191 191 /*** add test of EXTNAME and header-defined columns? ***/ 192 192 /* return internal structure representation */ 193 CMF_PS1_V5_ Lensing_Alt *gfits_table_get_CMF_PS1_V5_Lensing_Alt(FTable *ftable, off_t *Ndata, char *swapped) {193 CMF_PS1_V5_R0_Lensing *gfits_table_get_CMF_PS1_V5_R0_Lensing (FTable *ftable, off_t *Ndata, char *swapped) { 194 194 195 195 int Ncols; 196 CMF_PS1_V5_ Lensing_Alt*data;196 CMF_PS1_V5_R0_Lensing *data; 197 197 198 198 Ncols = ftable[0].header[0].Naxis[0]; … … 203 203 204 204 *Ndata = ftable[0].header[0].Naxis[1]; 205 data = (CMF_PS1_V5_ Lensing_Alt*) ftable[0].buffer;205 data = (CMF_PS1_V5_R0_Lensing *) ftable[0].buffer; 206 206 if ((swapped == NULL) || (*swapped == FALSE)) { 207 if (!gfits_convert_CMF_PS1_V5_ Lensing_Alt ((unsigned char *) data, sizeof (CMF_PS1_V5_Lensing_Alt), *Ndata, TRUE)) {207 if (!gfits_convert_CMF_PS1_V5_R0_Lensing ((unsigned char *) data, sizeof (CMF_PS1_V5_R0_Lensing), *Ndata, TRUE)) { 208 208 return NULL; 209 209 } … … 214 214 } 215 215 216 int gfits_table_set_CMF_PS1_V5_ Lensing_Alt (FTable *ftable, CMF_PS1_V5_Lensing_Alt*data, off_t Ndata) {216 int gfits_table_set_CMF_PS1_V5_R0_Lensing (FTable *ftable, CMF_PS1_V5_R0_Lensing *data, off_t Ndata) { 217 217 218 218 Header *header; … … 221 221 222 222 /* create table header */ 223 if (!gfits_create_table_header (header, "BINTABLE", "CMF_PS1_V5_ Lensing_Alt")) return (FALSE);223 if (!gfits_create_table_header (header, "BINTABLE", "CMF_PS1_V5_R0_Lensing")) return (FALSE); 224 224 225 225 /* define table layout */ … … 308 308 /* add data values */ 309 309 if (!gfits_table_scale_data (ftable)) return (FALSE); 310 if (!gfits_convert_CMF_PS1_V5_ Lensing_Alt ((unsigned char *) data, sizeof (CMF_PS1_V5_Lensing_Alt), Ndata, FALSE)) return (FALSE);311 if (!gfits_add_rows (ftable, (char *) data, Ndata, sizeof (CMF_PS1_V5_ Lensing_Alt))) return (FALSE);310 if (!gfits_convert_CMF_PS1_V5_R0_Lensing ((unsigned char *) data, sizeof (CMF_PS1_V5_R0_Lensing), Ndata, FALSE)) return (FALSE); 311 if (!gfits_add_rows (ftable, (char *) data, Ndata, sizeof (CMF_PS1_V5_R0_Lensing))) return (FALSE); 312 312 313 313 return (TRUE); 314 314 } 315 315 316 int gfits_table_mkheader_CMF_PS1_V5_ Lensing_Alt(Header *header) {316 int gfits_table_mkheader_CMF_PS1_V5_R0_Lensing (Header *header) { 317 317 318 318 /* create table header */ 319 if (!gfits_create_table_header (header, "BINTABLE", "CMF_PS1_V5_ Lensing_Alt")) return (FALSE);319 if (!gfits_create_table_header (header, "BINTABLE", "CMF_PS1_V5_R0_Lensing")) return (FALSE); 320 320 321 321 /* define table layout */ … … 402 402 } 403 403 404 int Send_CMF_PS1_V5_ Lensing_Alt (int device, CMF_PS1_V5_Lensing_Alt*data, int Ndata, int copy) {404 int Send_CMF_PS1_V5_R0_Lensing (int device, CMF_PS1_V5_R0_Lensing *data, int Ndata, int copy) { 405 405 406 406 int Nwrite, Nbytes; 407 CMF_PS1_V5_ Lensing_Alt*tmpdata;408 409 Nbytes = Ndata * sizeof (CMF_PS1_V5_ Lensing_Alt);407 CMF_PS1_V5_R0_Lensing *tmpdata; 408 409 Nbytes = Ndata * sizeof (CMF_PS1_V5_R0_Lensing); 410 410 411 411 if (copy) { 412 ALLOCATE (tmpdata, CMF_PS1_V5_ Lensing_Alt, Ndata);412 ALLOCATE (tmpdata, CMF_PS1_V5_R0_Lensing, Ndata); 413 413 memcpy (tmpdata, data, Nbytes); 414 414 } else { … … 416 416 } 417 417 418 if (!gfits_convert_CMF_PS1_V5_ Lensing_Alt ((unsigned char *) tmpdata, sizeof (CMF_PS1_V5_Lensing_Alt), Ndata, FALSE)) return (FALSE);418 if (!gfits_convert_CMF_PS1_V5_R0_Lensing ((unsigned char *) tmpdata, sizeof (CMF_PS1_V5_R0_Lensing), Ndata, FALSE)) return (FALSE); 419 419 420 420 SendCommand (device, 16, "NVALUE: %6d", Ndata); … … 430 430 } 431 431 432 int Recv_CMF_PS1_V5_ Lensing_Alt (int device, CMF_PS1_V5_Lensing_Alt**data, int *Ndata) {432 int Recv_CMF_PS1_V5_R0_Lensing (int device, CMF_PS1_V5_R0_Lensing **data, int *Ndata) { 433 433 434 434 int ndata; 435 435 IOBuffer message; 436 CMF_PS1_V5_ Lensing_Alt*tmpdata;436 CMF_PS1_V5_R0_Lensing *tmpdata; 437 437 438 438 ExpectCommand (device, 16, 1.0, &message); … … 443 443 ExpectMessage (device, 1.0, &message); 444 444 445 tmpdata = (CMF_PS1_V5_ Lensing_Alt*) message.buffer;446 if (!gfits_convert_CMF_PS1_V5_ Lensing_Alt ((unsigned char *) tmpdata, sizeof (CMF_PS1_V5_Lensing_Alt), ndata, TRUE)) return (FALSE);445 tmpdata = (CMF_PS1_V5_R0_Lensing *) message.buffer; 446 if (!gfits_convert_CMF_PS1_V5_R0_Lensing ((unsigned char *) tmpdata, sizeof (CMF_PS1_V5_R0_Lensing), ndata, TRUE)) return (FALSE); 447 447 448 448 /* double-check data length? */ -
trunk/Ohana/src/libdvo/src/cmf-ps1-v5-r2-lensing.c
r37985 r37992 1 1 # include "dvo.h" 2 # define ST_SIZE 32 02 # define ST_SIZE 328 3 3 4 4 // this function is based on the one generated by the autocode of cmf-ps1-v5.d 5 int gfits_convert_CMF_PS1_V5_ Lensing (unsigned char *data, off_t size, off_t nitems, char toStruct) {5 int gfits_convert_CMF_PS1_V5_R2_Lensing (unsigned char *data, off_t size, off_t nitems, char toStruct) { 6 6 7 7 off_t i; … … 9 9 10 10 if (size != ST_SIZE) { 11 fprintf (stderr, "WARNING: mismatch in data types CMF_PS1_V5_ Lensing: "OFF_T_FMT" vs %d\n", size, ST_SIZE);11 fprintf (stderr, "WARNING: mismatch in data types CMF_PS1_V5_R2_Lensing: "OFF_T_FMT" vs %d\n", size, ST_SIZE); 12 12 return (FALSE); 13 13 } … … 101 101 SWAP_WORD (260); // E2_SH_PSF 102 102 103 SWAP_BYTE (264); // SRC_CHIP_NUM 104 SWAP_BYTE (266); // SRC_CHIP_X 105 SWAP_BYTE (268); // SRC_CHIP_Y 106 107 SWAP_WORD (272); // MOMENTS_R1 108 SWAP_WORD (276); // MOMENTS_RH 109 SWAP_WORD (280); // KRON_FLUX 110 SWAP_WORD (284); // KRON_FLUX_ERR 111 SWAP_WORD (288); // KRON_FLUX_INNER 112 SWAP_WORD (292); // KRON_FLUX_OUTER 113 SWAP_WORD (296); // SKY_LIMIT_RAD 114 SWAP_WORD (300); // SKY_LIMIT_FLUX 115 SWAP_WORD (304); // SKY_LIMIT_SLOPE 116 SWAP_WORD (308); // FLAGS 117 SWAP_WORD (312); // FLAGS2 118 SWAP_BYTE (316); // N_FRAMES 119 SWAP_BYTE (318); // PADDING 103 SWAP_WORD (264); // E1_PSF 104 SWAP_WORD (268); // E2_PSF 105 106 SWAP_BYTE (272); // SRC_CHIP_NUM 107 SWAP_BYTE (274); // SRC_CHIP_X 108 SWAP_BYTE (276); // SRC_CHIP_Y 109 // SWAP_BYTE (278); // PADDING3, not swapped 110 111 SWAP_WORD (280); // MOMENTS_R1 112 SWAP_WORD (284); // MOMENTS_RH 113 SWAP_WORD (288); // KRON_FLUX 114 SWAP_WORD (292); // KRON_FLUX_ERR 115 SWAP_WORD (296); // KRON_FLUX_INNER 116 SWAP_WORD (300); // KRON_FLUX_OUTER 117 SWAP_WORD (304); // SKY_LIMIT_RAD 118 SWAP_WORD (308); // SKY_LIMIT_FLUX 119 SWAP_WORD (312); // SKY_LIMIT_SLOPE 120 SWAP_WORD (316); // FLAGS 121 SWAP_WORD (320); // FLAGS2 122 SWAP_BYTE (324); // N_FRAMES 123 // SWAP_BYTE (326); // PADDING, not swapped 120 124 } 121 125 # endif … … 196 200 /*** add test of EXTNAME and header-defined columns? ***/ 197 201 /* return internal structure representation */ 198 CMF_PS1_V5_ Lensing *gfits_table_get_CMF_PS1_V5_Lensing (FTable *ftable, off_t *Ndata, char *swapped) {202 CMF_PS1_V5_R2_Lensing *gfits_table_get_CMF_PS1_V5_R2_Lensing (FTable *ftable, off_t *Ndata, char *swapped) { 199 203 200 204 int Ncols; 201 CMF_PS1_V5_ Lensing *data;205 CMF_PS1_V5_R2_Lensing *data; 202 206 203 207 Ncols = ftable[0].header[0].Naxis[0]; … … 208 212 209 213 *Ndata = ftable[0].header[0].Naxis[1]; 210 data = (CMF_PS1_V5_ Lensing *) ftable[0].buffer;214 data = (CMF_PS1_V5_R2_Lensing *) ftable[0].buffer; 211 215 if ((swapped == NULL) || (*swapped == FALSE)) { 212 if (!gfits_convert_CMF_PS1_V5_ Lensing ((unsigned char *) data, sizeof (CMF_PS1_V5_Lensing), *Ndata, TRUE)) {216 if (!gfits_convert_CMF_PS1_V5_R2_Lensing ((unsigned char *) data, sizeof (CMF_PS1_V5_R2_Lensing), *Ndata, TRUE)) { 213 217 return NULL; 214 218 } … … 219 223 } 220 224 221 int gfits_table_set_CMF_PS1_V5_ Lensing (FTable *ftable, CMF_PS1_V5_Lensing *data, off_t Ndata) {225 int gfits_table_set_CMF_PS1_V5_R2_Lensing (FTable *ftable, CMF_PS1_V5_R2_Lensing *data, off_t Ndata) { 222 226 223 227 Header *header; … … 226 230 227 231 /* create table header */ 228 if (!gfits_create_table_header (header, "BINTABLE", "CMF_PS1_V5_ Lensing")) return (FALSE);232 if (!gfits_create_table_header (header, "BINTABLE", "CMF_PS1_V5_R2_Lensing")) return (FALSE); 229 233 230 234 /* define table layout */ … … 294 298 gfits_define_bintable_column (header, "E", "E1_SH_PSF", "lensing shear", "", 1.0, 0.0); 295 299 gfits_define_bintable_column (header, "E", "E2_SH_PSF", "lensing shear", "", 1.0, 0.0); 300 gfits_define_bintable_column (header, "E", "E1_PSF", "psf polarization", "", 1.0, 0.0); 301 gfits_define_bintable_column (header, "E", "E2_PSF", "psf polarization", "", 1.0, 0.0); 296 302 297 303 gfits_define_bintable_column (header, "I", "SRC_CHIP_NUM", "number of source chip for warp", "", 1.0, 0.0); … … 319 325 /* add data values */ 320 326 if (!gfits_table_scale_data (ftable)) return (FALSE); 321 if (!gfits_convert_CMF_PS1_V5_ Lensing ((unsigned char *) data, sizeof (CMF_PS1_V5_Lensing), Ndata, FALSE)) return (FALSE);322 if (!gfits_add_rows (ftable, (char *) data, Ndata, sizeof (CMF_PS1_V5_ Lensing))) return (FALSE);327 if (!gfits_convert_CMF_PS1_V5_R2_Lensing ((unsigned char *) data, sizeof (CMF_PS1_V5_R2_Lensing), Ndata, FALSE)) return (FALSE); 328 if (!gfits_add_rows (ftable, (char *) data, Ndata, sizeof (CMF_PS1_V5_R2_Lensing))) return (FALSE); 323 329 324 330 return (TRUE); 325 331 } 326 332 327 int gfits_table_mkheader_CMF_PS1_V5_ Lensing (Header *header) {333 int gfits_table_mkheader_CMF_PS1_V5_R2_Lensing (Header *header) { 328 334 329 335 /* create table header */ 330 if (!gfits_create_table_header (header, "BINTABLE", "CMF_PS1_V5_ Lensing")) return (FALSE);336 if (!gfits_create_table_header (header, "BINTABLE", "CMF_PS1_V5_R2_Lensing")) return (FALSE); 331 337 332 338 /* define table layout */ … … 396 402 gfits_define_bintable_column (header, "E", "E1_SH_PSF", "lensing shear", "", 1.0, 0.0); 397 403 gfits_define_bintable_column (header, "E", "E2_SH_PSF", "lensing shear", "", 1.0, 0.0); 404 gfits_define_bintable_column (header, "E", "E1_PSF", "psf polarization", "", 1.0, 0.0); 405 gfits_define_bintable_column (header, "E", "E2_PSF", "psf polarization", "", 1.0, 0.0); 398 406 399 407 gfits_define_bintable_column (header, "I", "SRC_CHIP_NUM", "number of source chip for warp", "", 1.0, 0.0); … … 419 427 } 420 428 421 int Send_CMF_PS1_V5_ Lensing (int device, CMF_PS1_V5_Lensing *data, int Ndata, int copy) {429 int Send_CMF_PS1_V5_R2_Lensing (int device, CMF_PS1_V5_R2_Lensing *data, int Ndata, int copy) { 422 430 423 431 int Nwrite, Nbytes; 424 CMF_PS1_V5_ Lensing *tmpdata;425 426 Nbytes = Ndata * sizeof (CMF_PS1_V5_ Lensing);432 CMF_PS1_V5_R2_Lensing *tmpdata; 433 434 Nbytes = Ndata * sizeof (CMF_PS1_V5_R2_Lensing); 427 435 428 436 if (copy) { 429 ALLOCATE (tmpdata, CMF_PS1_V5_ Lensing, Ndata);437 ALLOCATE (tmpdata, CMF_PS1_V5_R2_Lensing, Ndata); 430 438 memcpy (tmpdata, data, Nbytes); 431 439 } else { … … 433 441 } 434 442 435 if (!gfits_convert_CMF_PS1_V5_ Lensing ((unsigned char *) tmpdata, sizeof (CMF_PS1_V5_Lensing), Ndata, FALSE)) return (FALSE);443 if (!gfits_convert_CMF_PS1_V5_R2_Lensing ((unsigned char *) tmpdata, sizeof (CMF_PS1_V5_R2_Lensing), Ndata, FALSE)) return (FALSE); 436 444 437 445 SendCommand (device, 16, "NVALUE: %6d", Ndata); … … 447 455 } 448 456 449 int Recv_CMF_PS1_V5_ Lensing (int device, CMF_PS1_V5_Lensing **data, int *Ndata) {457 int Recv_CMF_PS1_V5_R2_Lensing (int device, CMF_PS1_V5_R2_Lensing **data, int *Ndata) { 450 458 451 459 int ndata; 452 460 IOBuffer message; 453 CMF_PS1_V5_ Lensing *tmpdata;461 CMF_PS1_V5_R2_Lensing *tmpdata; 454 462 455 463 ExpectCommand (device, 16, 1.0, &message); … … 460 468 ExpectMessage (device, 1.0, &message); 461 469 462 tmpdata = (CMF_PS1_V5_ Lensing *) message.buffer;463 if (!gfits_convert_CMF_PS1_V5_ Lensing ((unsigned char *) tmpdata, sizeof (CMF_PS1_V5_Lensing), ndata, TRUE)) return (FALSE);470 tmpdata = (CMF_PS1_V5_R2_Lensing *) message.buffer; 471 if (!gfits_convert_CMF_PS1_V5_R2_Lensing ((unsigned char *) tmpdata, sizeof (CMF_PS1_V5_R2_Lensing), ndata, TRUE)) return (FALSE); 464 472 465 473 /* double-check data length? */ -
trunk/Ohana/src/libdvo/src/dvo_convert_PS1_V5.c
r37807 r37992 532 532 out[i].E2_sh_psf = in[i].E2_sh_psf; 533 533 534 out[i].E1_psf = in[i].E1_psf; 535 out[i].E2_psf = in[i].E2_psf; 536 534 537 out[i].F_ApR5 = in[i].F_ApR5; 535 538 out[i].dF_ApR5 = in[i].dF_ApR5; … … 580 583 out[i].E2_sm_psf = in[i].E2_sm_psf; 581 584 585 out[i].E1_psf = in[i].E1_psf; 586 out[i].E2_psf = in[i].E2_psf; 587 582 588 out[i].X11_sh_psf = in[i].X11_sh_psf; 583 589 out[i].X12_sh_psf = in[i].X12_sh_psf; … … 1264 1270 } 1265 1271 1266 1267 Lensing *Lensing_PS1_V5_ALT_ToInternal (Lensing_PS1_V5_ALT *in, off_t Nvalues) { 1272 Lensing *Lensing_PS1_V5_R0_ToInternal (Lensing_PS1_V5_R0 *in, off_t Nvalues) { 1268 1273 1269 1274 off_t i; … … 1318 1323 } 1319 1324 1325 Lensing *Lensing_PS1_V5_R1_ToInternal (Lensing_PS1_V5_R1 *in, off_t Nvalues) { 1326 1327 off_t i; 1328 Lensing *out; 1329 1330 ALLOCATE_ZERO (out, Lensing, Nvalues); 1331 1332 for (i = 0; i < Nvalues; i++) { 1333 dvo_lensing_init (&out[i]); 1334 1335 out[i].X11_sm_obj = in[i].X11_sm_obj; 1336 out[i].X12_sm_obj = in[i].X12_sm_obj; 1337 out[i].X22_sm_obj = in[i].X22_sm_obj; 1338 out[i].E1_sm_obj = in[i].E1_sm_obj; 1339 out[i].E2_sm_obj = in[i].E2_sm_obj; 1340 1341 out[i].X11_sh_obj = in[i].X11_sh_obj; 1342 out[i].X12_sh_obj = in[i].X12_sh_obj; 1343 out[i].X22_sh_obj = in[i].X22_sh_obj; 1344 out[i].E1_sh_obj = in[i].E1_sh_obj; 1345 out[i].E2_sh_obj = in[i].E2_sh_obj; 1346 1347 out[i].X11_sm_psf = in[i].X11_sm_psf; 1348 out[i].X12_sm_psf = in[i].X12_sm_psf; 1349 out[i].X22_sm_psf = in[i].X22_sm_psf; 1350 out[i].E1_sm_psf = in[i].E1_sm_psf; 1351 out[i].E2_sm_psf = in[i].E2_sm_psf; 1352 1353 out[i].X11_sh_psf = in[i].X11_sh_psf; 1354 out[i].X12_sh_psf = in[i].X12_sh_psf; 1355 out[i].X22_sh_psf = in[i].X22_sh_psf; 1356 out[i].E1_sh_psf = in[i].E1_sh_psf; 1357 out[i].E2_sh_psf = in[i].E2_sh_psf; 1358 1359 out[i].F_ApR5 = in[i].F_ApR5; 1360 out[i].dF_ApR5 = in[i].dF_ApR5; 1361 out[i].sF_ApR5 = in[i].sF_ApR5; 1362 out[i].fF_ApR5 = in[i].fF_ApR5; 1363 1364 out[i].F_ApR6 = in[i].F_ApR6; 1365 out[i].dF_ApR6 = in[i].dF_ApR6; 1366 out[i].sF_ApR6 = in[i].sF_ApR6; 1367 out[i].fF_ApR6 = in[i].fF_ApR6; 1368 1369 out[i].detID = in[i].detID; 1370 out[i].objID = in[i].objID; 1371 out[i].catID = in[i].catID; 1372 1373 out[i].averef = in[i].averef; 1374 } 1375 return (out); 1376 } 1377
Note:
See TracChangeset
for help on using the changeset viewer.
