Changeset 33828
- Timestamp:
- Apr 26, 2012, 3:05:47 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/MosaicOps.c
r33827 r33828 759 759 } 760 760 761 int setMmos_mosaic (Mosaic *mosaic, off_t Nmos, Image *image, Catalog *catalog, SetMmosInfo *info, FlatCorrectionTable *flatcorr) { 762 763 off_t j; 761 // 'mosaic' is a pointer to the current mosaic of interest (Nmos) 762 int setMmos_mosaic (Mosaic *myMosaic, off_t Nmos, Image *image, Catalog *catalog, SetMmosInfo *info, FlatCorrectionTable *flatcorr) { 763 764 Image *imageReal; 765 off_t j, NimageReal; 764 766 StatType stats; 765 767 … … 769 771 double *dMlist = info->dMlist; 770 772 773 assert (Nmos >= 0); 774 assert (Nmos < Nmosaic); 775 776 imageReal = getimages (&NimageReal, NULL); 777 771 778 /* on PoorImages run, skip good images */ 772 779 if (info->PoorImages) { 773 int bad = m osaic[0].flags & (ID_IMAGE_PHOTOM_FEW | ID_IMAGE_PHOTOM_POOR | ID_IMAGE_PHOTOM_SKIP);780 int bad = myMosaic[0].flags & (ID_IMAGE_PHOTOM_FEW | ID_IMAGE_PHOTOM_POOR | ID_IMAGE_PHOTOM_SKIP); 774 781 if (!bad) return TRUE; 775 782 } … … 777 784 // UBERCAL image: if this is an ubercal image, set minUbercalDist to 0: 778 785 // we optionally do not recalibrate images with UBERCAL zero points 779 if (m osaic[0].flags & ID_IMAGE_PHOTOM_UBERCAL) {780 m osaic[0].ubercalDist = 0;786 if (myMosaic[0].flags & ID_IMAGE_PHOTOM_UBERCAL) { 787 myMosaic[0].ubercalDist = 0; 781 788 // propagate ubercalDist to the images 782 789 for (j = 0; j < MosaicN_Image[Nmos]; j++) { 783 790 off_t im = MosaicToImage[Nmos][j]; 784 image[im].ubercalDist = mosaic[0].ubercalDist; 791 assert (im < NimageReal); 792 assert (im >= 0); 793 image[im].ubercalDist = myMosaic[0].ubercalDist; 785 794 // fprintf (stderr, "%d %d %d\n", (int) i, (int) im, image[im].ubercalDist); 786 795 } … … 793 802 794 803 // do not modify the calibration for mosaics with partial images loaded (skipCal TRUE) 795 if (m osaic[0].skipCal) {804 if (myMosaic[0].skipCal) { 796 805 info->Nskip ++; 797 806 return TRUE; … … 799 808 800 809 int testImage = FALSE; 801 // testImage |= (abs(m osaic[0].start - 1324104046) < 10);802 // testImage |= (abs(m osaic[0].start - 1324103823) < 10);803 // testImage |= (abs(m osaic[0].start - 1323003245) < 10);804 // testImage |= (abs(m osaic[0].start - 1323003069) < 10);805 // testImage |= (abs(m osaic[0].start - 1323003125) < 10);806 // testImage |= (abs(m osaic[0].start - 1323003300) < 10);807 // testImage |= (abs(m osaic[0].start - 1323003365) < 10);808 // testImage |= (abs(m osaic[0].start - 1323003191) < 10);809 // testImage |= (abs(m osaic[0].start - 1323003014) < 10);810 // testImage |= (abs(m osaic[0].start - 1323003484) < 10);811 // testImage |= (abs(m osaic[0].start - 1323003419) < 10);812 // testImage |= (abs(m osaic[0].start - 1323002949) < 10);810 // testImage |= (abs(myMosaic[0].start - 1324104046) < 10); 811 // testImage |= (abs(myMosaic[0].start - 1324103823) < 10); 812 // testImage |= (abs(myMosaic[0].start - 1323003245) < 10); 813 // testImage |= (abs(myMosaic[0].start - 1323003069) < 10); 814 // testImage |= (abs(myMosaic[0].start - 1323003125) < 10); 815 // testImage |= (abs(myMosaic[0].start - 1323003300) < 10); 816 // testImage |= (abs(myMosaic[0].start - 1323003365) < 10); 817 // testImage |= (abs(myMosaic[0].start - 1323003191) < 10); 818 // testImage |= (abs(myMosaic[0].start - 1323003014) < 10); 819 // testImage |= (abs(myMosaic[0].start - 1323003484) < 10); 820 // testImage |= (abs(myMosaic[0].start - 1323003419) < 10); 821 // testImage |= (abs(myMosaic[0].start - 1323002949) < 10); 813 822 814 823 FILE *fout = NULL; … … 887 896 888 897 skip: 898 assert (N < info->Nmax); 899 assert (N >= 0); 900 assert (Nbright < info->Nmax); 901 assert (Nbright >= 0); 902 889 903 list[N] = Msys - Mrel - Mcal - Mgrid + Mflat; 890 904 dlist[N] = MAX (catalog[c].measureT[m].dM, MIN_ERROR); … … 907 921 if (mark) { 908 922 if (VERBOSE2) { fprintf (stderr, "marked mosaic %s ("OFF_T_FMT"), (%d < %d) || (%d < %f*"OFF_T_FMT")\n", image[MosaicToImage[Nmos][0]].name, Nmos, N, IMAGE_TOOFEW, N, IMAGE_GOOD_FRACTION, N_onMosaic[Nmos]); } 909 m osaic[0].flags |= ID_IMAGE_PHOTOM_FEW;923 myMosaic[0].flags |= ID_IMAGE_PHOTOM_FEW; 910 924 info->Nfew ++; 911 925 if (testImage) { … … 913 927 } 914 928 } else { 915 m osaic[0].flags &= ~ID_IMAGE_PHOTOM_FEW;929 myMosaic[0].flags &= ~ID_IMAGE_PHOTOM_FEW; 916 930 } 917 931 } … … 919 933 if (VERBOSE2 && info->PoorImages) fprintf (stderr, "Mmos: %f %f %d %d\n", stats.mean, stats.sigma, stats.Nmeas, N); 920 934 921 m osaic[0].Mcal = stats.mean;922 m osaic[0].dMcal = stats.error;923 m osaic[0].nFitPhotom = N;924 m osaic[0].Xm = 100.0*log10(stats.chisq);935 myMosaic[0].Mcal = stats.mean; 936 myMosaic[0].dMcal = stats.error; 937 myMosaic[0].nFitPhotom = N; 938 myMosaic[0].Xm = 100.0*log10(stats.chisq); 925 939 926 940 if (testImage) { 927 fprintf (stderr, "test image %d (%d) %f %f %d ... ", (int) Nmos, m osaic[0].start, stats.mean, stats.error, mosaic[0].nFitPhotom);941 fprintf (stderr, "test image %d (%d) %f %f %d ... ", (int) Nmos, myMosaic[0].start, stats.mean, stats.error, myMosaic[0].nFitPhotom); 928 942 } 929 943 … … 932 946 // bright end scatter 933 947 liststats (Mlist, dMlist, Nbright, &stats); 934 m osaic[0].dMsys = stats.sigma;935 936 if (m osaic[0].Mcal < -CLOUD_TOLERANCE) {937 m osaic[0].Mcal = 0.0;948 myMosaic[0].dMsys = stats.sigma; 949 950 if (myMosaic[0].Mcal < -CLOUD_TOLERANCE) { 951 myMosaic[0].Mcal = 0.0; 938 952 } 939 953 940 954 if (testImage) { 941 fprintf (stderr, "%f %f : %d %f\n", m osaic[0].Mcal, mosaic[0].dMsys, mosaic[0].Xm, pow(10.0, 0.01*mosaic[0].Xm));955 fprintf (stderr, "%f %f : %d %f\n", myMosaic[0].Mcal, myMosaic[0].dMsys, myMosaic[0].Xm, pow(10.0, 0.01*myMosaic[0].Xm)); 942 956 } 943 957 944 958 // minUbercalDist calculated here is the min value for any star owned by this image 945 959 // since this particular image is tied to that star, bump its distance by 1 946 m osaic[0].ubercalDist = minUbercalDist + 1;960 myMosaic[0].ubercalDist = minUbercalDist + 1; 947 961 948 962 // propagate ubercalDist to the images 949 963 for (j = 0; j < MosaicN_Image[Nmos]; j++) { 950 964 off_t im = MosaicToImage[Nmos][j]; 951 image[im].ubercalDist = m osaic[0].ubercalDist;965 image[im].ubercalDist = myMosaic[0].ubercalDist; 952 966 // fprintf (stderr, "%d %d %d\n", (int) i, (int) im, image[im].ubercalDist); 953 967 }
Note:
See TracChangeset
for help on using the changeset viewer.
