IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39537


Ignore:
Timestamp:
Apr 16, 2016, 7:04:50 AM (10 years ago)
Author:
eugene
Message:

report sample stdev for mean radial aperture stdevs instead of r.m.s. of individual stdevs

Location:
trunk/Ohana/src/dvolens/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/dvolens/src/args.c

    r39487 r39537  
    158158  }
    159159
     160  /* specify region file by name (eg n0000/0000.00) */
     161  UserCatalog = NULL;
     162  if ((N = get_argument (argc, argv, "-catalog"))) {
     163    remove_argument (N, &argc, argv);
     164    UserCatalog = strcreate (argv[N]);
     165    remove_argument (N, &argc, argv);
     166  }
     167
    160168  VERBOSE = VERBOSE2 = FALSE;
    161169  if ((N = get_argument (argc, argv, "-v"))) {
  • trunk/Ohana/src/dvolens/src/dvolens_client.c

    r39487 r39537  
    1919      FREE (HOSTDIR);
    2020      FREE (CATDIR);
     21      FREE (UserCatalog);
    2122      free_images();
    2223      FreeWarpGroups();
  • trunk/Ohana/src/dvolens/src/update_objects.c

    r39487 r39537  
    5050    // does this host ID match the desired location for the table?
    5151    if (!HostTableTestHost(skylist[0].regions[i], HOST_ID)) continue;
     52
     53    if (UserCatalog && strcasecmp (skylist[0].regions[i]->name, UserCatalog)) continue;
    5254
    5355    INITTIME;
     
    171173    if (UPDATE)             strextend (&command, "-update");
    172174    if (REPAIR_LENSING_IDS) strextend (&command, "-repair-lensing-ids");
     175    if (UserCatalog)        strextend (&command, "-catalog %s", UserCatalog);
    173176
    174177    fprintf (stderr, "command: %s\n", command);
  • trunk/Ohana/src/dvolens/src/update_objects_catalog.c

    r39489 r39537  
    109109          Mj = RecoverLensingIndex (average, measureSeq, lensing);
    110110          if (Mj == -1) {
    111             fprintf (stderr, "failed %f %f : %d\n", average->R, average->D, lensing->imageID);
     111            if (Nfailed < 10) fprintf (stderr, "failed %f %f : %d\n", average->R, average->D, lensing->imageID);
    112112            Nfailed ++;
    113113            continue;
     
    190190      // Fcal * lensing->F_ApR5 is in Jy
    191191
     192      // F_ApR5 is <F_ApR5_i>, the mean of the lensing entries.  we will save stdev of F_ApR5_i,
     193      // not the r.m.s. of sF_ApR5
     194
     195      // stdev = sqrt(F_Ap_R5_i^2 / N - <F_Ap_R5>)
     196
    192197      if (isfinite(lensing-> F_ApR5)) {
    193198        lensobj[Nsec]. F_ApR5 +=    Fcal * lensing-> F_ApR5;
    194199        lensobj[Nsec].dF_ApR5 += SQ(Fcal * lensing->dF_ApR5);
    195         lensobj[Nsec].sF_ApR5 += SQ(Fcal * lensing->sF_ApR5);
     200        lensobj[Nsec].sF_ApR5 += SQ(Fcal * lensing-> F_ApR5);
    196201        lensobj[Nsec].fF_ApR5 +=           lensing->fF_ApR5;
    197202        N5[Nsec] ++;
     
    201206        lensobj[Nsec]. F_ApR6 +=    Fcal * lensing-> F_ApR6;
    202207        lensobj[Nsec].dF_ApR6 += SQ(Fcal * lensing->dF_ApR6);
    203         lensobj[Nsec].sF_ApR6 += SQ(Fcal * lensing->sF_ApR6);
     208        lensobj[Nsec].sF_ApR6 += SQ(Fcal * lensing-> F_ApR6);
    204209        lensobj[Nsec].fF_ApR6 +=           lensing->fF_ApR6;
    205210        N6[Nsec] ++;
     
    209214        lensobj[Nsec]. F_ApR7 +=    Fcal * lensing-> F_ApR7;
    210215        lensobj[Nsec].dF_ApR7 += SQ(Fcal * lensing->dF_ApR7);
    211         lensobj[Nsec].sF_ApR7 += SQ(Fcal * lensing->sF_ApR7);
     216        lensobj[Nsec].sF_ApR7 += SQ(Fcal * lensing-> F_ApR7);
    212217        lensobj[Nsec].fF_ApR7 +=           lensing->fF_ApR7;
    213218        N7[Nsec] ++;
     
    253258      if (N5[j]) {
    254259        lensobj[j]. F_ApR5 /= (float) N5[j];
    255         lensobj[j].dF_ApR5 /= (float) N5[j];
    256         lensobj[j].sF_ApR5 /= (float) N5[j];
    257260        lensobj[j].fF_ApR5 /= (float) N5[j];
     261        lensobj[j].dF_ApR5  = sqrt(lensobj[j].dF_ApR5 / (float) N5[j]);
     262
     263        double S1 = SQ(lensobj[j]. F_ApR5); // <f>^2
     264        double S2 = lensobj[j].sF_ApR5 / (float) N5[j]; // sum(f^2) / N
     265        lensobj[j].sF_ApR5  = sqrt(S2 - S1) * (N5[j] / (N5[j] - 1.0)); // correct to sample stdev
    258266      } else {
    259267        lensobj[j]. F_ApR5 = NAN;
     
    265273      if (N6[j]) {
    266274        lensobj[j]. F_ApR6 /= (float) N6[j];
    267         lensobj[j].dF_ApR6 /= (float) N6[j];
    268         lensobj[j].sF_ApR6 /= (float) N6[j];
    269275        lensobj[j].fF_ApR6 /= (float) N6[j];
     276        lensobj[j].dF_ApR6 = sqrt(lensobj[j].dF_ApR6 / (float) N6[j]);
     277
     278        double S1 = SQ(lensobj[j]. F_ApR6); // <f>^2
     279        double S2 = lensobj[j].sF_ApR6 / (float) N6[j]; // sum(f^2) / N
     280        lensobj[j].sF_ApR6 = sqrt(S2 - S1) * (N6[j] / (N6[j] - 1.0)); // correct to sample stdev
    270281      } else {
    271282        lensobj[j]. F_ApR6 = NAN;
     
    277288      if (N7[j]) {
    278289        lensobj[j]. F_ApR7 /= (float) N7[j];
    279         lensobj[j].dF_ApR7 /= (float) N7[j];
    280         lensobj[j].sF_ApR7 /= (float) N7[j];
    281290        lensobj[j].fF_ApR7 /= (float) N7[j];
     291        lensobj[j].dF_ApR7 = sqrt(lensobj[j].dF_ApR7 / (float) N7[j]);
     292
     293        double S1 = SQ(lensobj[j]. F_ApR7); // <f>^2
     294        double S2 = lensobj[j].sF_ApR7 / (float) N7[j]; // sum(f^2) / N
     295        lensobj[j].sF_ApR7  = sqrt(S2 - S1) * (N7[j] / (N7[j] - 1.0)); // correct to sample stdev
    282296      } else {
    283297        lensobj[j]. F_ApR7 = NAN;
     
    286300        lensobj[j].fF_ApR7 = NAN;
    287301      }
    288 
    289       lensobj[j].dF_ApR5 = sqrt(lensobj[j].dF_ApR5);
    290       lensobj[j].sF_ApR5 = sqrt(lensobj[j].sF_ApR5);
    291       lensobj[j].dF_ApR6 = sqrt(lensobj[j].dF_ApR6);
    292       lensobj[j].sF_ApR6 = sqrt(lensobj[j].sF_ApR6);
    293       lensobj[j].dF_ApR7 = sqrt(lensobj[j].dF_ApR7);
    294       lensobj[j].sF_ApR7 = sqrt(lensobj[j].sF_ApR7);
    295 
    296       // somewhere in here I should calculate the values of E1, E2, and gamma
    297302
    298303      float e0 = Mxx_obj[j] + Myy_obj[j];
Note: See TracChangeset for help on using the changeset viewer.