IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40263


Ignore:
Timestamp:
Dec 8, 2017, 12:20:53 PM (9 years ago)
Author:
eugene
Message:

add Mkron to BrightCatalog I/O

Location:
branches/eam_branches/ohana.20170822/src/relphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20170822/src/relphot/src/BrightCatalog.c

    r40258 r40263  
    6666    GET_COLUMN(D,         "DEC",        double);
    6767    GET_COLUMN(M,         "MAG_SYS",    float);
     68    GET_COLUMN(Mkron,     "MAG_KRON",   float);
    6869    GET_COLUMN(McalPSF,   "MCAL_PSF",   float);
    6970    GET_COLUMN(McalAPER,  "MCAL_APER",  float);
     
    9091      measure[i].D         = D[i];
    9192      measure[i].M         = M[i];
     93      measure[i].Mkron     = Mkron[i];
    9294      measure[i].McalPSF   = McalPSF[i];
    9395      measure[i].McalAPER  = McalAPER[i];
     
    112114    free (D       );
    113115    free (M       );
     116    free (Mkron   );
    114117    free (McalPSF );
    115118    free (McalAPER);
     
    189192    // need to create and assign to flat-field correction
    190193    GET_COLUMN(M,      "MAG",      float);
     194    GET_COLUMN(Mkron,  "MAG_KRON", float);
    191195    GET_COLUMN(dM,     "MAG_ERR",  float);
    192196    GET_COLUMN(Mchisq, "MAG_CHI",  float);
     
    203207    for (i = 0; i < Nrow; i++) {
    204208      secfilt[i].MpsfChp  = M[i];         
     209      secfilt[i].MkronChp = Mkron[i];         
    205210      secfilt[i].dMpsfChp = dM[i];
    206211      secfilt[i].Mchisq   = Mchisq[i];
     
    214219
    215220    free (M     );
     221    free (Mkron );
    216222    free (dM    );
    217223    free (Mchisq);
     
    274280    gfits_define_bintable_column (&theader, "D", "DEC",      "dec",                        "degree", 1.0, 0.0);
    275281    gfits_define_bintable_column (&theader, "E", "MAG_SYS",  "magnitude (sys)",             NULL,    1.0, 0.0);
     282    gfits_define_bintable_column (&theader, "E", "MAG_KRON", "magnitude (sys,kron)",        NULL,    1.0, 0.0);
    276283    gfits_define_bintable_column (&theader, "E", "MCAL_PSF", "magnitude (cal)",             NULL,    1.0, 0.0);
    277284    gfits_define_bintable_column (&theader, "E", "MCAL_APER","magnitude (cal)",             NULL,    1.0, 0.0);
     
    297304    double *D         ; ALLOCATE (D        ,  double, catalog->Nmeasure);
    298305    float  *M         ; ALLOCATE (M        ,  float,  catalog->Nmeasure);
     306    float  *Mkron     ; ALLOCATE (Mkron    ,  float,  catalog->Nmeasure);
    299307    float  *McalPSF   ; ALLOCATE (McalPSF  ,  float,  catalog->Nmeasure);
    300308    float  *McalAPER  ; ALLOCATE (McalAPER ,  float,  catalog->Nmeasure);
     
    319327      D[i]        = measure[i].D        ;
    320328      M[i]        = measure[i].M        ;
     329      Mkron[i]    = measure[i].Mkron    ;
    321330      McalPSF[i]  = measure[i].McalPSF  ;
    322331      McalAPER[i] = measure[i].McalAPER ;
     
    340349    gfits_set_bintable_column (&theader, &ftable, "DEC",        D,         catalog->Nmeasure);
    341350    gfits_set_bintable_column (&theader, &ftable, "MAG_SYS",    M,         catalog->Nmeasure);
     351    gfits_set_bintable_column (&theader, &ftable, "MAG_KRON",   Mkron,     catalog->Nmeasure);
    342352    gfits_set_bintable_column (&theader, &ftable, "MCAL_PSF",   McalPSF,   catalog->Nmeasure);
    343353    gfits_set_bintable_column (&theader, &ftable, "MCAL_APER",  McalAPER,  catalog->Nmeasure);
     
    359369    free (D       );
    360370    free (M       );
     371    free (Mkron   );
    361372    free (McalPSF );
    362373    free (McalAPER);
     
    444455    gfits_create_table_header (&theader, "BINTABLE", "SECFILT");
    445456
    446     gfits_define_bintable_column (&theader, "E", "MAG",      "",              "arcsec", 1.0, 0.0);
    447     gfits_define_bintable_column (&theader, "E", "MAG_ERR",  "",              "arcsec", 1.0, 0.0);
     457    gfits_define_bintable_column (&theader, "E", "MAG",      "",              "mag",   1.0, 0.0);
     458    gfits_define_bintable_column (&theader, "E", "MAG_KRON", "",              "mag",   1.0, 0.0);
     459    gfits_define_bintable_column (&theader, "E", "MAG_ERR",  "",              "mag",   1.0, 0.0);
    448460    gfits_define_bintable_column (&theader, "E", "MAG_CHI",  "",              NULL,    1.0, 0.0);
    449461    gfits_define_bintable_column (&theader, "J", "FLAGS",    "",              NULL,    1.0, 0.0);
     
    462474    // create intermediate storage arrays
    463475    float *M        ; ALLOCATE (M      ,  float, Nsec);
     476    float *Mkron    ; ALLOCATE (Mkron  ,  float, Nsec);
    464477    float *dM       ; ALLOCATE (dM     ,  float, Nsec);
    465478    float *Mchisq   ; ALLOCATE (Mchisq ,  float, Nsec);
     
    474487    for (i = 0; i < Nsec; i++) {
    475488      M     [i]       = secfilt[i].MpsfChp ;
     489      Mkron [i]       = secfilt[i].MkronChp;
    476490      dM    [i]       = secfilt[i].dMpsfChp;
    477491      Mchisq[i]       = secfilt[i].Mchisq  ;
     
    485499    // add the columns to the output array
    486500    gfits_set_bintable_column (&theader, &ftable, "MAG",      M     , Nsec);
     501    gfits_set_bintable_column (&theader, &ftable, "MAG_KRON", Mkron , Nsec);
    487502    gfits_set_bintable_column (&theader, &ftable, "MAG_ERR",  dM    , Nsec);
    488503    gfits_set_bintable_column (&theader, &ftable, "MAG_CHI",  Mchisq, Nsec);
     
    494509
    495510    free (M      );
     511    free (Mkron  );
    496512    free (dM     );
    497513    free (Mchisq );
  • branches/eam_branches/ohana.20170822/src/relphot/src/ImageOps.c

    r40259 r40263  
    721721
    722722      if ((image[i].imageID == TEST_IMAGE1) || (image[i].imageID == TEST_IMAGE2)) {
    723         fprintf (stderr, "%1d, %3d : %3d, %3d : %10.6f %10.6f : %6.3f  %6.3f  %6.3f  %6.3f  %6.3f : %6.3f\n", (int) i, (int) j, (int) c, (int) m, catalog[c].averageT[n].R, catalog[c].averageT[n].D, MsysPSF, MrelPSF, Mmos, Mgrid, Mflat, psfStars->flxlist[Nref]);
     723        fprintf (stderr, "%1d, %3d : %3d, %3d : %10.6f %10.6f : %6.3f  %6.3f  %6.3f  %6.3f  %6.3f : %6.3f\n", (int) i, (int) j, (int) c, (int) m, catalog[c].averageT[n].R, catalog[c].averageT[n].D, MsysKron, MrelKron, Mmos, Mgrid, Mflat, kronStars->flxlist[Nref]);
    724724      }
    725725
     
    771771    if ((image[i].imageID == TEST_IMAGE1) || (image[i].imageID == TEST_IMAGE2)) {
    772772      for (j = 0; j < Nref; j++) {
    773         fprintf (stderr, "%1d, %8d : %6.3f  %6.3f  %6.3f  %d\n", (int) i, (int) image[i].imageID, psfStars->flxlist[j], psfStars->errlist[j], psfStars->wgtlist[j], psfStars->msklist[j]);
     773        fprintf (stderr, "%1d, %8d : %6.3f  %6.3f  %6.3f  %d\n", (int) i, (int) image[i].imageID, kronStars->flxlist[j], kronStars->errlist[j], kronStars->wgtlist[j], kronStars->msklist[j]);
    774774      }
    775775    }
    776776
    777777    if ((image[i].imageID == TEST_IMAGE1) || (image[i].imageID == TEST_IMAGE2)) {
    778       fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].McalPSF, image[i].dMcal);
     778      fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].McalAPER, image[i].dMcal);
    779779    }
    780780
    781781    if (!mark && VERBOSE_IMAGE) {
    782       fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].McalPSF, image[i].dMcal);
     782      fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].McalAPER, image[i].dMcal);
    783783    }
    784784
    785785    if (PLOTSTUFF) {
    786       fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].McalPSF, image[i].dMcal);
     786      fprintf (stderr, "Mcal for : %s : %7.4f %7.4f\n", image[i].name, image[i].McalAPER, image[i].dMcal);
    787787      plot_setMcal (psfStars->flxlist, Nref, &stats, CLOUD_TOLERANCE);
    788788    }
Note: See TracChangeset for help on using the changeset viewer.