- Timestamp:
- May 9, 2016, 9:12:10 AM (10 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 1 added
- 4 edited
-
dvo/Makefile (modified) (1 diff)
-
dvo/gstar.c (modified) (7 diffs)
-
dvo/mextract.c (modified) (4 diffs)
-
dvo/mySequence.c (added)
-
include/dvoshell.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/Makefile
r37807 r39569 25 25 $(SRC)/dvo_host_utils.$(ARCH).o \ 26 26 $(SRC)/region_list.$(ARCH).o \ 27 $(SRC)/mySequence.$(ARCH).o \ 27 28 $(SRC)/photcode_ops.$(ARCH).o \ 28 29 $(SRC)/find_matches.$(ARCH).o -
trunk/Ohana/src/opihi/dvo/gstar.c
r39457 r39569 92 92 off_t j, k, m, N, Nlo, Nhi; 93 93 int Nsecfilt, NPTS, QUIET, INST, SHOW_MASKS; 94 int found, GetMeasure s;94 int found, GetMeasure, GetLensing; 95 95 int SaveVectors; 96 96 Vector *vec1, *vec2, *vec3, *vec4, *vec5, *vec6; … … 196 196 } 197 197 198 GetMeasure s= FALSE;198 GetMeasure = FALSE; 199 199 if ((N = get_argument (argc, argv, "-m"))) { 200 GetMeasure s= TRUE;200 GetMeasure = TRUE; 201 201 remove_argument (N, &argc, argv); 202 202 } 203 203 if ((N = get_argument (argc, argv, "-meas"))) { 204 GetMeasures = TRUE; 204 GetMeasure = TRUE; 205 remove_argument (N, &argc, argv); 206 } 207 if (SaveVectors) GetMeasure = TRUE; 208 209 GetLensing = FALSE; 210 if ((N = get_argument (argc, argv, "-lens"))) { 211 GetLensing = TRUE; 205 212 remove_argument (N, &argc, argv); 206 213 } … … 258 265 /* lock, load, unlock catalog */ 259 266 catalog.catflags = DVO_LOAD_AVERAGE | DVO_LOAD_SECFILT; 260 catalog.catflags |= GetMeasures ? DVO_LOAD_MEASURE : DVO_SKIP_MEASURE; 267 catalog.catflags |= GetMeasure ? DVO_LOAD_MEASURE : DVO_SKIP_MEASURE; 268 catalog.catflags |= GetLensing ? DVO_LOAD_LENSING : DVO_SKIP_LENSING; 261 269 catalog.Nsecfilt = 0; 262 270 … … 676 684 gprint (GP_LOG, "\n"); 677 685 678 if (GetMeasure s || SaveVectors) {686 if (GetMeasure) { 679 687 680 688 if (catalog.average[k].Nmeasure == 0) continue; … … 717 725 float dDoff = dvoOffsetD(&catalog.measure[Nv], &catalog.average[k]); 718 726 719 if (GetMeasure s&& !QUIET) {727 if (GetMeasure && !QUIET) { 720 728 date = ohana_sec_to_date (catalog.measure[Nv].t); 721 729 gprint (GP_LOG, "%6.3f ", Mcat); … … 744 752 gprint (GP_LOG, "%5.2f ", FromShortPixels(catalog.measure[Nv].FWx)); 745 753 gprint (GP_LOG, "%5.2f ", FromShortPixels(catalog.measure[Nv].FWy)); 754 gprint (GP_LOG, "%5.2f ", FromShortPixels(catalog.measure[Nv].Mxx)); 755 gprint (GP_LOG, "%5.2f ", FromShortPixels(catalog.measure[Nv].Mxy)); 756 gprint (GP_LOG, "%5.2f ", FromShortPixels(catalog.measure[Nv].Myy)); 746 757 747 758 if (FULL_OUTPUT) { … … 777 788 gprint (GP_LOG, "%10.3e ", catalog.measure[Nv].dFluxAp); 778 789 } 779 gprint (GP_LOG, "\n"); 780 790 791 if (GetLensing && catalog.average[k].Nlensing) { 792 int mLens = catalog.average[k].lensingOffset; 793 int foundLens = FALSE; 794 for (int Nlens = 0; !foundLens && (Nlens < catalog.average[k].Nlensing); Nlens ++) { 795 Lensing *lensing = &catalog.lensing[mLens + Nlens]; 796 if (lensing->imageID != catalog.measure[Nv].imageID) continue; 797 798 gprint (GP_LOG, "%10.3e ", lensing->X11_sm_obj); 799 gprint (GP_LOG, "%10.3e ", lensing->X12_sm_obj); 800 gprint (GP_LOG, "%10.3e ", lensing->X22_sm_obj); 801 gprint (GP_LOG, "%10.3e ", lensing-> E1_sm_obj); 802 gprint (GP_LOG, "%10.3e ", lensing-> E2_sm_obj); 803 gprint (GP_LOG, "%10.3e ", lensing->X11_sh_obj); 804 gprint (GP_LOG, "%10.3e ", lensing->X12_sh_obj); 805 gprint (GP_LOG, "%10.3e ", lensing->X22_sh_obj); 806 gprint (GP_LOG, "%10.3e ", lensing-> E1_sh_obj); 807 gprint (GP_LOG, "%10.3e ", lensing-> E2_sh_obj); 808 gprint (GP_LOG, "%10.3e ", lensing->X11_sm_psf); 809 gprint (GP_LOG, "%10.3e ", lensing->X12_sm_psf); 810 gprint (GP_LOG, "%10.3e ", lensing->X22_sm_psf); 811 gprint (GP_LOG, "%10.3e ", lensing-> E1_sm_psf); 812 gprint (GP_LOG, "%10.3e ", lensing-> E2_sm_psf); 813 gprint (GP_LOG, "%10.3e ", lensing->X11_sh_psf); 814 gprint (GP_LOG, "%10.3e ", lensing->X12_sh_psf); 815 gprint (GP_LOG, "%10.3e ", lensing->X22_sh_psf); 816 gprint (GP_LOG, "%10.3e ", lensing-> E1_sh_psf); 817 gprint (GP_LOG, "%10.3e ", lensing-> E2_sh_psf); 818 gprint (GP_LOG, " %10.3e ", lensing-> E1_psf); 819 gprint (GP_LOG, "%10.3e ", lensing-> E2_psf); 820 foundLens = TRUE; 821 } 822 } 823 824 gprint (GP_LOG, "\n"); 781 825 free (date); 782 826 } -
trunk/Ohana/src/opihi/dvo/mextract.c
r39457 r39569 216 216 int needStarpar = dbFieldNeedStarpar (fields, Nfields, FALSE); 217 217 218 // the lensing table does not have a good index to/from the measure table. if we need lensing 219 // parameters, we need to generate a lookup table to avoid excess iterations 220 mySequenceType *lensingSeq = NULL; 221 if (needLensing) { 222 lensingSeq = mySequenceAlloc(); 223 } 224 218 225 // grab data from all selected sky regions 219 226 struct sigaction *old_sigaction = SetInterrupt(); … … 249 256 250 257 for (j = 0; (j < catalog.Naverage) && !interrupt; j++) { 251 m = catalog.average[j].measureOffset; 258 Average *average = &catalog.average[j]; 259 260 m = average->measureOffset; 252 261 if (m > catalog.Nmeasure) { 253 262 gprint (GP_ERR, "ERROR: inconsistent average->measure offset. Unsorted database?\n"); … … 257 266 dbExtractMeasuresInitAve (); // reset counters for saved fields (costs very little) 258 267 259 for (k = 0; (k < catalog.average[j].Nmeasure); k++, m++) { 268 off_t Lj; 269 off_t Loff = average->lensingOffset; 270 271 if (needLensing) { 272 mySequenceSetSize (lensingSeq, average->Nlensing); 273 274 // generate an index for these lensing entries (based on Lj and imageID) 275 for (Lj = 0; Lj < average->Nlensing; Lj++) { 276 mySequenceSetValue (lensingSeq, catalog.lensing[Loff + Lj].imageID, Lj); 277 } 278 279 mySequenceSort (lensingSeq); 280 } 281 282 for (k = 0; (k < average->Nmeasure); k++, m++) { 260 283 if (catalog.measure[m].averef != j) { 261 284 gprint (GP_ERR, "ERROR: inconsistent measure->average link. Unsorted database?\n"); … … 266 289 dbExtractMeasuresInitMeas (); // reset counters for saved fields (costs very little 267 290 268 Average *average = &catalog.average[j];269 270 291 int Nstarpar = average->starparOffset; 271 StarPar *starpar = needStarpar ? &catalog.starpar[Nstarpar] : NULL; 272 273 int Nlensing = average->lensingOffset; 274 Lensing *lensing = needLensing ? &catalog.lensing[Nlensing] : NULL; 292 StarPar *starpar = needStarpar && average->Nstarpar ? &catalog.starpar[Nstarpar] : NULL; 293 294 Lensing *lensing = NULL; 295 296 // a gpc1 analysis specific choice: only look for lensing if photcode is a warp one 297 if (needLensing && average->Nlensing && (catalog.measure[m].photcode >= 12000) && (catalog.measure[m].photcode <= 12500)) { 298 Lj = mySequenceGetEntry (lensingSeq, catalog.measure[m].imageID); 299 if (Lj >= 0) lensing = &catalog.lensing[Loff + Lj]; 300 } 275 301 276 302 int Nsec = j*Nsecfilt; -
trunk/Ohana/src/opihi/include/dvoshell.h
r39457 r39569 26 26 e_time t; 27 27 } CMPstars; 28 29 // a structure to define a sequence lookup 30 typedef struct { 31 int minID; 32 int maxID; 33 int *value; 34 int *sequence; 35 int Nsequence; 36 int NSEQUENCE; 37 } mySequenceType; 28 38 29 39 /** some globals used particularly by DVO_CLIENT **/ … … 93 103 int HostTableGetResults PROTO((char *uniquer, int VERBOSE)); 94 104 105 mySequenceType *mySequenceAlloc (); 106 int mySequenceFree (mySequenceType *mySequence); 107 int mySequenceSetSize (mySequenceType *mySequence, int Nmax); 108 int mySequenceSetValue (mySequenceType *mySequence, int value, int entry); 109 int mySequenceSort (mySequenceType *mySequence); 110 int mySequenceGetEntry (mySequenceType *mySequence, int value); 111 95 112 # endif // DVOSHELL_H
Note:
See TracChangeset
for help on using the changeset viewer.
