IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 1, 2014, 4:37:12 AM (12 years ago)
Author:
eugene
Message:

object mean position done based on projected x,y (like pm and par); fix region manual; update measures had error in dR,dD

Location:
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateMeasures.c

    r37699 r37702  
    6666
    6767      double R, D;
    68       double dR = NAN, dD = NAN;
    6968      XY_to_RD (&R, &D, X, Y, imcoords);
    7069
    7170      int n = measureT[0].averef;
    7271      Average *average = &catalog[i].average[n];
     72
     73      double dR = 3600.0*(average[0].R - R);
     74      double dD = 3600.0*(average[0].D - D);
    7375
    7476      // make sure detection is on the same side of the 0,360 boundary as the average
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateObjects.c

    r37642 r37702  
    332332  // to judge the quality of the PM and PAR fits, we need to fit all three models and compare Chisq
    333333
     334  // project all of the R,D coordinates to a plane centered on this coordinate. set
     335  // the times to be relative to Tmean (this is required for parallax as well)
     336  for (k = 0; k < N; k++) {
     337    RD_to_XY (&X[k], &Y[k], R[k], D[k], &coords);
     338    T[k] -= Tmean;
     339    if (XVERB) {
     340      fprintf (stderr, OFF_T_FMT" %f %f %f  %f %f +/- %f %f\n",  k, T[k], R[k], D[k], X[k], Y[k], dX[k], dY[k]);
     341    }
     342  }       
     343
    334344  // *** first fit for the proper motion (skip fit if Trange or Npts is too small) ***
    335345  if ((mode == FIT_PM_ONLY) || (mode == FIT_PM_AND_PAR)) {
     
    342352      goto skipPM;
    343353    }
    344 
    345     // project all of the R,D coordinates to a plane centered on this coordinate. set
    346     // the times to be relative to Tmean (this is required for parallax as well)
    347     for (k = 0; k < N; k++) {
    348       RD_to_XY (&X[k], &Y[k], R[k], D[k], &coords);
    349       T[k] -= Tmean;
    350       if (XVERB) {
    351         fprintf (stderr, OFF_T_FMT" %f %f %f  %f %f +/- %f %f\n",  k, T[k], R[k], D[k], X[k], Y[k], dX[k], dY[k]);
    352       }
    353     }     
    354354
    355355    FitPM (&fitPM, X, dX, Y, dY, T, N, XVERB);
     
    426426    // ALWAYS fit the average model
    427427    StatType statsR, statsD;
    428     liststats_pos (R, dR, N, &statsR, XVERB); // WARNING: this function modifies R (do not use after here)
    429     liststats_pos (D, dD, N, &statsD, XVERB); // WARNING: this function modifies D (do not use after here)
    430 
    431     fitAve.Ro = statsR.mean;
    432     fitAve.dRo = 3600.0*statsR.sigma;
    433 
    434     fitAve.Do = statsD.mean;
    435     fitAve.dDo = 3600.0*statsD.sigma;
     428    liststats_pos (X, dX, N, &statsR, XVERB); // WARNING: this function modifies R (do not use after here)
     429    liststats_pos (Y, dY, N, &statsD, XVERB); // WARNING: this function modifies D (do not use after here)
     430
     431    // project Ro, Do back to RA,DEC
     432    XY_to_RD (&fitAve.Ro, &fitAve.Do, statsR.mean, statsD.mean, &coords);
     433    if (XVERB) fprintf (stderr, "average: %f %f\n", fitAve.Ro, fitAve.Do);
     434
     435    fitAve.dRo = statsR.sigma;
     436    fitAve.dDo = statsD.sigma;
    436437
    437438    fitAve.chisq = (N > 1) ? 0.5 * (statsR.chisq + statsD.chisq) : NAN;
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/launch_region_hosts.c

    r37699 r37702  
    66  int i;
    77
    8   // clear the I/O files
    9   for (i = 0; i < regionHosts->Nhosts; i++) {
    10     char *meansync = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanpos.sync");
    11     if (truncate (meansync, 0)) fprintf (stderr, "trouble clearing meansync %s\n", meansync);
    12     free (meansync);
    13 
    14     char *meanfits = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanpos.fits");
    15     if (truncate (meanfits, 0)) fprintf (stderr, "trouble clearing meanfits %s\n", meanfits);
    16     free (meanfits);
    17 
    18     char *meassync = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "measpos.sync");
    19     if (truncate (meassync, 0)) fprintf (stderr, "trouble clearing meassync %s\n", meassync);
    20     free (meassync);
    21 
    22     char *measfits = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "measpos.fits");
    23     if (truncate (measfits, 0)) fprintf (stderr, "trouble clearing measfits %s\n", measfits);
    24     free (measfits);
    25 
    26     char *icrfsync = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "icrfobj.sync");
    27     if (truncate (icrfsync, 0)) fprintf (stderr, "trouble clearing icrfsync %s\n", icrfsync);
    28     free (icrfsync);
    29 
    30     char *icrffits = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "icrfobj.fits");
    31     if (truncate (icrffits, 0)) fprintf (stderr, "trouble clearing icrffits %s\n", icrffits);
    32     free (icrffits);
    33 
    34     char *imsyncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagepos.sync");
    35     if (truncate (imsyncfile, 0)) fprintf (stderr, "trouble clearing imsyncfile %s\n", imsyncfile);
    36     free (imsyncfile);
    37 
    38     char *imfitsfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagepos.fits");
    39     if (truncate (imfitsfile, 0)) fprintf (stderr, "trouble clearing imfitsfile %s\n", imfitsfile);
    40     free (imfitsfile);
    41 
    42     char *loopsyncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "loop.sync");
    43     if (truncate (loopsyncfile, 0)) fprintf (stderr, "trouble clearing loopsyncfile %s\n", loopsyncfile);
    44     free (loopsyncfile);
    45 
    46     char imagename[1024];
    47     snprintf (imagename, 1024, "%s/Image.%d.fits", CATDIR, regionHosts->hosts[i].hostID);
    48     if (unlink (imagename)) fprintf (stderr, "trouble clearing image %s\n", imagename);
     8  // do not remote the sync and fits files if we do a manual run -- user must clear if needed
     9  if (!PARALLEL_REGIONS_MANUAL) {
     10    // clear the I/O files
     11    for (i = 0; i < regionHosts->Nhosts; i++) {
     12      char *meansync = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanpos.sync");
     13      if (truncate (meansync, 0)) fprintf (stderr, "trouble clearing meansync %s\n", meansync);
     14      free (meansync);
     15
     16      char *meanfits = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "meanpos.fits");
     17      if (truncate (meanfits, 0)) fprintf (stderr, "trouble clearing meanfits %s\n", meanfits);
     18      free (meanfits);
     19
     20      char *meassync = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "measpos.sync");
     21      if (truncate (meassync, 0)) fprintf (stderr, "trouble clearing meassync %s\n", meassync);
     22      free (meassync);
     23
     24      char *measfits = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "measpos.fits");
     25      if (truncate (measfits, 0)) fprintf (stderr, "trouble clearing measfits %s\n", measfits);
     26      free (measfits);
     27
     28      char *icrfsync = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "icrfobj.sync");
     29      if (truncate (icrfsync, 0)) fprintf (stderr, "trouble clearing icrfsync %s\n", icrfsync);
     30      free (icrfsync);
     31
     32      char *icrffits = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "icrfobj.fits");
     33      if (truncate (icrffits, 0)) fprintf (stderr, "trouble clearing icrffits %s\n", icrffits);
     34      free (icrffits);
     35
     36      char *imsyncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagepos.sync");
     37      if (truncate (imsyncfile, 0)) fprintf (stderr, "trouble clearing imsyncfile %s\n", imsyncfile);
     38      free (imsyncfile);
     39
     40      char *imfitsfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "imagepos.fits");
     41      if (truncate (imfitsfile, 0)) fprintf (stderr, "trouble clearing imfitsfile %s\n", imfitsfile);
     42      free (imfitsfile);
     43
     44      char *loopsyncfile = make_filename (CATDIR, regionHosts->hosts[i].hostname, regionHosts->hosts[i].hostID, "loop.sync");
     45      if (truncate (loopsyncfile, 0)) fprintf (stderr, "trouble clearing loopsyncfile %s\n", loopsyncfile);
     46      free (loopsyncfile);
     47
     48      char imagename[1024];
     49      snprintf (imagename, 1024, "%s/Image.%d.fits", CATDIR, regionHosts->hosts[i].hostID);
     50      if (unlink (imagename)) fprintf (stderr, "trouble clearing image %s\n", imagename);
     51    }
     52
     53    char *framesync = make_filename (CATDIR, "master", 0, "frame.corr.sync");
     54    if (truncate (framesync, 0)) fprintf (stderr, "trouble clearing framesync %s\n", framesync);
     55    free (framesync);
     56 
     57    char *framefits = make_filename (CATDIR, "master", 0, "frame.corr.fits");
     58    if (truncate (framefits, 0)) fprintf (stderr, "trouble clearing framefits %s\n", framefits);
     59    free (framefits);
    4960  }
    50 
    51   char *framesync = make_filename (CATDIR, "master", 0, "frame.corr.sync");
    52   if (truncate (framesync, 0)) fprintf (stderr, "trouble clearing framesync %s\n", framesync);
    53   free (framesync);
    54  
    55   char *framefits = make_filename (CATDIR, "master", 0, "frame.corr.fits");
    56   if (truncate (framefits, 0)) fprintf (stderr, "trouble clearing framefits %s\n", framefits);
    57   free (framefits);
    5861
    5962  for (i = 0; i < regionHosts->Nhosts; i++) {
     
    189192  int i;
    190193
     194  int status = TRUE;
     195
    191196  if (PARALLEL_REGIONS_MANUAL) {
    192197    fprintf (stderr, "run the relastro_client commands above.  when these are done, hit return\n");
    193198    getchar();
    194199  } else {
    195     RegionHostTableWaitJobsGetIO (regionHosts, __FILE__, __LINE__, VERBOSE);
     200    status = RegionHostTableWaitJobsGetIO (regionHosts, __FILE__, __LINE__, VERBOSE);
    196201  }
    197  
    198   int status = TRUE;
    199   for (i = 0; i < regionHosts->Nhosts; i++) {
    200     status = status && (regionHosts->hosts[i].status == 0);
    201   }
    202 
    203202  return status;
    204203}
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/liststats.c

    r34576 r37702  
    252252    X2 += M / dM;
    253253    dS += M;
    254     if (XVERB) fprintf (stderr, "chisq contrib : %f : %f : %f : %f : %f\n", Mo, 3600.0*(value[i] - Mo), 3600.0*dvalue[i], (value[i] - Mo) / dvalue[i], X2);
     254    if (XVERB) fprintf (stderr, "chisq contrib : %f : %f : %f : %f : %f\n", Mo, (value[i] - Mo), dvalue[i], (value[i] - Mo) / dvalue[i], X2);
    255255  }
    256256  X2 = X2 / (Nm - 1);
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/relastro_parallel_images.c

    r37701 r37702  
    102102
    103103    case TARGET_CHIPS:
     104      if (RESET_IMAGES) {
     105        UpdateMeasures (catalog, Ncatalog);
     106        MARKTIME("reset measures loop %d, host %d: %f sec\n", i, REGION_HOST_ID, dtime);
     107      }
    104108      for (i = 0; i < NLOOP; i++) {
    105         if (RESET_IMAGES) {
    106           UpdateMeasures (catalog, Ncatalog);
    107           MARKTIME("reset measures loop %d, host %d: %f sec\n", i, REGION_HOST_ID, dtime);
    108         }
    109109        UpdateObjects (catalog, Ncatalog, (i > 0));
    110110        MARKTIME("update objects loop %d, host %d: %f sec\n", i, REGION_HOST_ID, dtime);
Note: See TracChangeset for help on using the changeset viewer.