Changeset 40168
- Timestamp:
- Oct 15, 2017, 12:27:40 PM (9 years ago)
- Location:
- branches/eam_branches/ohana.20170822/src
- Files:
-
- 16 edited
-
libdvo/include/dvodb.h (modified) (3 diffs)
-
libdvo/src/dbCheckStack.c (modified) (1 diff)
-
libohana/include/ohana_sort.h (modified) (1 diff)
-
libohana/src/sorts.c (modified) (1 diff)
-
opihi/cmd.astro/fitplx.c (modified) (4 diffs)
-
opihi/cmd.astro/fitplx_irls.c (modified) (3 diffs)
-
opihi/cmd.astro/fitpm.c (modified) (1 diff)
-
opihi/cmd.astro/fitpm_irls.c (modified) (1 diff)
-
opihi/cmd.data/print_vectors.c (modified) (1 diff)
-
opihi/cmd.data/reindex.c (modified) (2 diffs)
-
opihi/cmd.data/uniq.c (modified) (1 diff)
-
opihi/cmd.data/write_vectors.c (modified) (1 diff)
-
opihi/dvo/remote.c (modified) (1 diff)
-
opihi/include/astro.h (modified) (1 diff)
-
opihi/lib.shell/dvomath.c (modified) (1 diff)
-
opihi/lib.shell/evaluate_stack.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20170822/src/libdvo/include/dvodb.h
r39633 r40168 3 3 4 4 # define MEASURE_HAS_XCCD 1 5 6 // Some values used by code moved to libdvo from opihi. 7 enum {OPIHI_NOTYPE, OPIHI_FLT, OPIHI_INT}; 8 # define opihi_flt double 9 // # define opihi_int int64_t 10 # define opihi_int long long int 11 # define OPIHI_INT_FMT "%lld" 5 12 6 13 typedef enum { … … 471 478 char type; 472 479 int field; 473 //opihi_flt FltValue;474 //opihi_int IntValue;475 double FltValue;476 int IntValue;480 opihi_flt FltValue; 481 opihi_int IntValue; 482 // double FltValue; 483 // int IntValue; 477 484 } dbStack; 478 485 479 486 typedef struct { 480 //opihi_flt Flt;481 //opihi_int Int;482 double Flt;483 int Int;487 opihi_flt Flt; 488 opihi_int Int; 489 // double Flt; 490 // int Int; 484 491 } dbValue; 485 492 … … 562 569 int dbExtractImagesReset (void); 563 570 564 // Some values used by code moved to libdvo from opihi.565 enum {OPIHI_NOTYPE, OPIHI_FLT, OPIHI_INT};566 #define opihi_flt double567 #define opihi_int int568 569 571 #include "get_graphdata.h" 570 572 -
branches/eam_branches/ohana.20170822/src/libdvo/src/dbCheckStack.c
r39578 r40168 43 43 * an int unless proven otherwise **/ 44 44 stack[i].FltValue = strtod (stack[i].name, &c1); 45 stack[i].IntValue = strtol (stack[i].name, &c2, 0);45 stack[i].IntValue = strtoll (stack[i].name, &c2, 0); 46 46 if (c2 == stack[i].name + strlen (stack[i].name)) { 47 47 stack[i].type |= DB_STACK_INT; -
branches/eam_branches/ohana.20170822/src/libohana/include/ohana_sort.h
r38986 r40168 68 68 void fsort (float *value, int N); 69 69 void isort (int *value, int N); 70 void llsort (long long int *value, int N); 70 71 71 72 void dsortpair (double *X, double *Y, int N); -
branches/eam_branches/ohana.20170822/src/libohana/src/sorts.c
r38986 r40168 30 30 31 31 # define SWAPFUNC(A,B){ int tmp = value[A]; value[A] = value[B]; value[B] = tmp; } 32 # define COMPARE(A,B)(value[A] < value[B]) 33 34 OHANA_SORT (N, COMPARE, SWAPFUNC); 35 36 # undef SWAPFUNC 37 # undef COMPARE 38 39 } 40 41 void llsort (long long int *value, int N) { 42 43 # define SWAPFUNC(A,B){ long long int tmp = value[A]; value[A] = value[B]; value[B] = tmp; } 32 44 # define COMPARE(A,B)(value[A] < value[B]) 33 45 -
branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitplx.c
r39610 r40168 77 77 double *dD = dDvec->elements.Flt; 78 78 79 int *mask = NULL;79 opihi_int *mask = NULL; 80 80 if (mvec) { 81 81 mask = mvec->elements.Int; … … 380 380 } 381 381 382 int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, int *mask, int Ntotal) {382 int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, opihi_int *mask, int Ntotal) { 383 383 384 384 int i; … … 413 413 414 414 // generate the fit values (projected X,Y; parallax factors; 415 int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, int *mask, int Ntotal, Coords *coords, double Tmean) {415 int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, opihi_int *mask, int Ntotal, Coords *coords, double Tmean) { 416 416 417 417 int i; … … 464 464 # define MAX_REJECT 0.1 465 465 466 int PlxOutlierClip (PlxFitData *fitdata, int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE) {466 int PlxOutlierClip (PlxFitData *fitdata, opihi_int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE) { 467 467 468 468 int i, n; -
branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitplx_irls.c
r39926 r40168 81 81 double *dD = dDvec->elements.Flt; 82 82 83 int *mask = NULL;83 opihi_int *mask = NULL; 84 84 if (mvec) { 85 85 mask = mvec->elements.Int; … … 109 109 for (i = 0; (VERBOSE == 2) && (i < fitdata.Npts); i++) { 110 110 int n = fitdata.index[i]; 111 int maskValue = mask ? mask[n] : 1;112 fprintf (stderr, "%f %f : %f %d: %f %f %f\n", R[n], D[n], T[n], maskValue, fitdata.t[i], fitdata.X[i], fitdata.Y[i]);111 opihi_int maskValue = mask ? mask[n] : 1; 112 fprintf (stderr, "%f %f : %f "OPIHI_INT_FMT" : %f %f %f\n", R[n], D[n], T[n], maskValue, fitdata.t[i], fitdata.X[i], fitdata.Y[i]); 113 113 } 114 114 … … 150 150 151 151 if (VERBOSE == 2) { 152 fprintf (stderr, "%f %f : %f %d: %f %f %f : %f %f %f %f\n", R[n], D[n], T[n], mask[n], fitdata.t[i], fitdata.X[i], fitdata.Y[i], fitdata.Wx[i], fitdata.Wy[i], Sum_Wx, Sum_Wy);152 fprintf (stderr, "%f %f : %f "OPIHI_INT_FMT" : %f %f %f : %f %f %f %f\n", R[n], D[n], T[n], mask[n], fitdata.t[i], fitdata.X[i], fitdata.Y[i], fitdata.Wx[i], fitdata.Wy[i], Sum_Wx, Sum_Wy); 153 153 } 154 154 } -
branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitpm.c
r39228 r40168 50 50 double *dD = dDvec->elements.Flt; 51 51 52 int *mask = NULL;52 opihi_int *mask = NULL; 53 53 if (mvec) { 54 54 mask = mvec->elements.Int; -
branches/eam_branches/ohana.20170822/src/opihi/cmd.astro/fitpm_irls.c
r39596 r40168 58 58 double *dD = dDvec->elements.Flt; 59 59 60 int *mask = NULL;60 opihi_int *mask = NULL; 61 61 if (mvec) { 62 62 mask = mvec->elements.Int; -
branches/eam_branches/ohana.20170822/src/opihi/cmd.data/print_vectors.c
r37049 r40168 35 35 gprint (GP_LOG, "%f ", vec[i][0].elements.Flt[j]); 36 36 } else { 37 gprint (GP_LOG, "%d ", vec[i][0].elements.Int[j]);37 gprint (GP_LOG, OPIHI_INT_FMT, vec[i][0].elements.Int[j]); 38 38 } 39 39 } -
branches/eam_branches/ohana.20170822/src/opihi/cmd.data/reindex.c
r39227 r40168 47 47 continue; 48 48 } 49 if (*vx > Nmax) ESCAPE("unexpected value in index: %d(%d)\n", *vx, i);49 if (*vx > Nmax) ESCAPE("unexpected value in index: "OPIHI_INT_FMT" (%d)\n", *vx, i); 50 50 ovec[0].elements.Flt[Npts] = vi[*vx]; 51 51 Npts++; … … 67 67 continue; 68 68 } 69 if (*vx > Nmax) ESCAPE("unexpected value in index: %d(%d)\n", *vx, i);69 if (*vx > Nmax) ESCAPE("unexpected value in index: "OPIHI_INT_FMT" (%d)\n", *vx, i); 70 70 ovec[0].elements.Int[Npts] = vi[*vx]; 71 71 Npts++; -
branches/eam_branches/ohana.20170822/src/opihi/cmd.data/uniq.c
r39457 r40168 80 80 memcpy (indata, ivec->elements.Int, ivec[0].Nelements*sizeof(opihi_int)); 81 81 82 isort (indata, ivec->Nelements);82 llsort (indata, ivec->Nelements); 83 83 84 84 Nnew = 0; -
branches/eam_branches/ohana.20170822/src/opihi/cmd.data/write_vectors.c
r39360 r40168 165 165 } else { 166 166 if (CSV) { 167 fprintf (f, "%d,", vec[j][0].elements.Int[i]);167 fprintf (f, OPIHI_INT_FMT",", vec[j][0].elements.Int[i]); 168 168 } else { 169 fprintf (f, "%d", vec[j][0].elements.Int[i]);169 fprintf (f, OPIHI_INT_FMT" ", vec[j][0].elements.Int[i]); 170 170 } 171 171 } -
branches/eam_branches/ohana.20170822/src/opihi/dvo/remote.c
r39283 r40168 27 27 gprint (GP_ERR, " -skip-result : do not try to read from the result file\n"); 28 28 gprint (GP_ERR, "OR: remote -reload (uniquer)\n"); 29 gprint (GP_ERR, " (reloads the remote host results into vectors as if a parallel command were run)\n"); 29 30 gprint (GP_ERR, "OR: remote -get-results (uniquer)\n"); 31 gprint (GP_ERR, " (generates the list of remote result filenames and status variables)\n"); 32 gprint (GP_ERR, " (RESULT_FILE:i is the filenme, RESULT_STATUS:i is the dvo_client exit status)\n"); 30 33 return FALSE; 31 34 } -
branches/eam_branches/ohana.20170822/src/opihi/include/astro.h
r39610 r40168 47 47 double VectorFractionInterpolate (double *values, float fraction, int Npts); 48 48 49 int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, int *mask, int Ntotal);50 int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, int *mask, int Ntotal, Coords *coords, double Tmean);51 int PlxOutlierClip (PlxFitData *fitdata, int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE);49 int PlxSetMeanEpoch (double *R, double *D, double *T, double *Rmean, double *Dmean, double *Tmean, opihi_int *mask, int Ntotal); 50 int PlxSetEpochPosition (PlxFitData *fitdata, double *R, double *D, double *dR, double *dD, double *T, opihi_int *mask, int Ntotal, Coords *coords, double Tmean); 51 int PlxOutlierClip (PlxFitData *fitdata, opihi_int *mask, int Noutlier, float dPsigMax, Vector *dPvec, int VERBOSE); 52 52 53 53 int PlxFitDataAlloc (PlxFitData *data, int N); -
branches/eam_branches/ohana.20170822/src/opihi/lib.shell/dvomath.c
r39457 r40168 82 82 } else { 83 83 if (stack[0].type == ST_SCALAR_INT) { 84 sprintf (outname, "%d", stack[0].IntValue);84 sprintf (outname, OPIHI_INT_FMT, stack[0].IntValue); 85 85 } else { 86 86 sprintf (outname, "%.12g", stack[0].FltValue); -
branches/eam_branches/ohana.20170822/src/opihi/lib.shell/evaluate_stack.c
r40014 r40168 89 89 } 90 90 if (tmp_stack.type == ST_SCALAR_INT) { 91 gprint (GP_ERR, "---> %d", tmp_stack.IntValue);91 gprint (GP_ERR, "---> "OPIHI_INT_FMT" ", tmp_stack.IntValue); 92 92 } 93 93 if (tmp_stack.type == ST_SCALAR_FLT) {
Note:
See TracChangeset
for help on using the changeset viewer.
