Changeset 37527
- Timestamp:
- Oct 23, 2014, 4:47:26 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src
- Files:
-
- 5 edited
-
fit_fake_stars.c (modified) (2 diffs)
-
fitpoly.c (modified) (2 diffs)
-
make_fake_images.c (modified) (1 diff)
-
make_fakeqsos.c (modified) (2 diffs)
-
match_fake_stars.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/fit_fake_stars.c
r37523 r37527 1 1 # include "fakeastro.h" 2 3 int dump_fit_stars (Stars *stars, double *L, double *M, int Nstars, char *filename) { 4 5 FILE *f = fopen (filename, "w"); 6 if (!f) { 7 fprintf (stderr, "failed to open %s\n", filename); 8 return FALSE; 9 } 10 11 int i; 12 for (i = 0; i < Nstars; i++) { 13 fprintf (f, "%d %f %f : %f %f\n", i, stars[i].measure.Xccd, stars[i].measure.Yccd, L[i], M[i]); 14 } 15 fclose (f); 16 return TRUE; 17 } 2 18 3 19 int fit_fake_stars (Stars *stars, int Nstars, Image *image) { … … 59 75 } 60 76 77 // measure chip corners and find dX,dY 78 { 79 double Lo, Mo; 80 XY_to_LM (&Lo, &Mo, 0.0, 0.0, &image[0].coords); 81 82 double Ls, Ms; 83 XY_to_LM (&Ls, &Ms, 4850.0, 0.0, &image[0].coords); 84 85 double Le, Me; 86 XY_to_LM (&Le, &Me, 0.0, 4850.0, &image[0].coords); 87 88 fprintf (stderr, "%s : (dL,dM)_1 : %f : (dL,dM)_2 : %f\n", image->name, hypot(Le-Lo, Me-Mo), hypot(Ls-Lo, Ms-Mo)); 89 } 90 61 91 if (CHIPMAP) { 62 92 -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/fitpoly.c
r37477 r37527 141 141 } 142 142 143 for (i = 0; FALSE && (i < fit[0].Nelems); i++) { 143 # define DEBUG FALSE 144 for (i = 0; DEBUG && (i < fit[0].Nelems); i++) { 144 145 ix = i % fit[0].Nterms; 145 146 iy = i / fit[0].Nterms; … … 154 155 } 155 156 156 for (i = 0; FALSE&& i < fit[0].Nelems; i++) {157 for (i = 0; DEBUG && i < fit[0].Nelems; i++) { 157 158 ix = i % fit[0].Nterms; 158 159 iy = i / fit[0].Nterms; -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fake_images.c
r37478 r37527 39 39 40 40 if (ix < 4) { 41 fakeImage[N].coords.crpix1 = (ix - 3)* 4900;42 fakeImage[N].coords.crpix2 = (iy - 3)* 4900;41 fakeImage[N].coords.crpix1 = (ix - 3)*5000; 42 fakeImage[N].coords.crpix2 = (iy - 3)*5100; 43 43 fakeImage[N].coords.pc1_1 = 1.0; 44 44 fakeImage[N].coords.pc2_2 = 1.0; 45 45 } else { 46 fakeImage[N].coords.crpix1 = ( 3 - ix)*4900;47 fakeImage[N].coords.crpix2 = (4 - iy)* 4900;46 fakeImage[N].coords.crpix1 = (4 - ix)*5000; 47 fakeImage[N].coords.crpix2 = (4 - iy)*5100; 48 48 fakeImage[N].coords.pc1_1 = -1.0; 49 49 fakeImage[N].coords.pc2_2 = -1.0; -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fakeqsos.c
r37523 r37527 7 7 8 8 // do I want to add in a galaxy obscuration (P(b) ?) 9 10 float dR = UserPatch.Rmax - UserPatch.Rmin; 11 float dPmin = sin(RAD_DEG*UserPatch.Dmin); 12 float dPmax = sin(RAD_DEG*UserPatch.Dmax); 13 float dP = dPmax - dPmin; 9 14 10 15 int i; … … 18 23 int inPatch = FALSE; 19 24 while (!inPatch) { 20 double phi = 2.0 * drand48() - 1.0;21 D = DEG_RAD * asin(phi); 22 R = drand48() * 2 * M_PI;25 double phi = dP * drand48() + dPmin; 26 D = DEG_RAD * asin(phi); // random in degrees 27 R = drand48() * dR + UserPatch.Rmin; // random in degrees 23 28 if (R < UserPatch.Rmin) continue; 24 29 if (R > UserPatch.Rmax) continue; -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/match_fake_stars.c
r37523 r37527 1 1 # include "fakeastro.h" 2 3 // Image *image is only used to set the equiv photcode, which in turn is used to set Nsec, which 4 // is only used to set the average photometry, but is not really needed. 2 5 3 6 int match_fake_stars (Stars *stars, unsigned int NstarsIn, SkyRegion *region, Catalog *catalog, Image *image) {
Note:
See TracChangeset
for help on using the changeset viewer.
