Changeset 37471
- Timestamp:
- Oct 8, 2014, 4:39:01 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/fakeastro
- Files:
-
- 1 added
- 8 edited
-
Makefile (modified) (1 diff)
-
include/fakeastro.h (modified) (2 diffs)
-
src/airmass.c (added)
-
src/fakeastro_images.c (modified) (1 diff)
-
src/insert_fakestar.c (modified) (1 diff)
-
src/load_template_images.c (modified) (3 diffs)
-
src/make_fake_images.c (modified) (3 diffs)
-
src/make_fake_stars_catalog.c (modified) (1 diff)
-
src/make_fakestars.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/Makefile
r37464 r37471 42 42 $(SRC)/load_template_images.$(ARCH).o \ 43 43 $(SRC)/make_fake_images.$(ARCH).o \ 44 $(SRC)/airmass.$(ARCH).o \ 44 45 $(SRC)/get_image_patch.$(ARCH).o \ 45 46 $(SRC)/load_fake_stars.$(ARCH).o \ -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/include/fakeastro.h
r37464 r37471 47 47 char *CPT_FILE; 48 48 char *INPUT; 49 50 int IMAGE_ID; 49 51 50 52 char *IMAGES_INPUT; … … 130 132 131 133 int InitStar (Stars *star); 134 135 float airmass (float secz_image, double ra, double dec, double st, double latitude); 136 float azimuth (double ha, double dec, double latitude); -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/fakeastro_images.c
r37464 r37471 32 32 33 33 // subset out the DIS exposures here: 34 35 IMAGE_ID = 1; 34 36 35 37 int NrefImage; -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/insert_fakestar.c
r37453 r37471 52 52 } 53 53 54 // Mr vs r-i, Mr vs r-z: linear fit from Bochanski et al 2010 Fig 7 & Fig 9 55 // http://iopscience.iop.org/1538-3881/139/6/2679/pdf/aj_139_6_2679.pdf 56 // gr, zy relations from Magnier et al 2012 Fig 3 57 58 double M_r = stars[i].starpar.M_r; 59 double m_r = M_r + stars[i].starpar.DistMag; 60 double ri = 0.215*M_r - 1.05; 61 double rz = 0.350*M_r - 1.82; 62 double gr = 2.27*ri + 0.09; 63 double zy = 0.37*(rz - ri) + 0.03; // zy vs iz 64 65 double m_g = m_r + gr; 66 double m_i = m_r - ri; 67 double m_z = m_r - rz; 68 double m_y = m_z - zy; 69 54 70 // I need a photcode for r-band 55 catalog[0].secfilt[Nave*Nsecfilt+1].M = stars[i].starpar.M_r + stars[i].starpar.DistMag; 71 catalog[0].secfilt[Nave*Nsecfilt+0].M = m_g; 72 catalog[0].secfilt[Nave*Nsecfilt+1].M = m_r; 73 catalog[0].secfilt[Nave*Nsecfilt+2].M = m_i; 74 catalog[0].secfilt[Nave*Nsecfilt+3].M = m_z; 75 catalog[0].secfilt[Nave*Nsecfilt+4].M = m_y; 56 76 57 77 catalog[0].starpar[Nstarpar] = stars[i].starpar; -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/load_template_images.c
r37464 r37471 30 30 } 31 31 32 BuildChipMatch (image, Nimage); 33 32 34 int NREFIMAGE = 1000; 33 35 int Nrefimage = 0; … … 35 37 ALLOCATE (refimage, Image, NREFIMAGE); 36 38 37 int i ;39 int i, j; 38 40 for (i = 0; i < Nimage; i++) { 39 41 … … 42 44 43 45 refimage[Nrefimage] = image[i]; 46 47 // find a corresponding chip image: 48 Image *childImage = NULL; 49 for (j = i + 1; j < i + 65; j++) { 50 if (image[j].parent == &image[i]) { 51 childImage = &image[j]; 52 break; 53 } 54 } 55 if (!childImage) { 56 fprintf (stderr, "!"); 57 // skip this one? 58 continue; 59 } 60 61 refimage[Nrefimage].secz = childImage->secz; 62 refimage[Nrefimage].Mcal = childImage->Mcal; 63 refimage[Nrefimage].dMcal = childImage->dMcal; 64 refimage[Nrefimage].exptime = childImage->exptime; 65 refimage[Nrefimage].sidtime = childImage->sidtime; 66 refimage[Nrefimage].latitude = childImage->latitude; 67 refimage[Nrefimage].fwhm_x = childImage->fwhm_x; 68 refimage[Nrefimage].fwhm_y = childImage->fwhm_y; 69 70 // this is a bit of a hack, but not too bad (very gpc1 specific): 71 refimage[Nrefimage].photcode = 100 * (int) (childImage->photcode / 100); 44 72 45 73 Nrefimage ++; -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fake_images.c
r37467 r37471 1 1 # include "fakeastro.h" 2 3 // fields I need to inherit from (one of) the WRP images: 4 // secz, Mcal (ensure measure.M is set right), exptime (if not hardwired), sidtime (or calculate from jd, longitude), 5 // extern_id, source_id?, name (is this used in relastro?, NO: stack names are used in relphot to set the tess_id) 2 6 3 7 Image *make_fake_images (Image *image, int *nfakeImage) { … … 14 18 15 19 fakeImage[0] = image[0]; 16 20 fakeImage[0].imageID = IMAGE_ID; 21 IMAGE_ID ++; 22 17 23 int N = 1; 18 24 … … 58 64 fakeImage[N].NY = 4850; 59 65 60 // XXX need a way to choose this better... 61 fakeImage[N].photcode = 10100 + iy*10 + ix; 62 fakeImage[N].exptime = 45.0; 66 fakeImage[N].imageID = IMAGE_ID; 67 IMAGE_ID ++; 68 69 // gpc1-specific (assumes grizy map to 10101, etc) 70 fakeImage[N].photcode = fakeImage[0].photcode + iy*10 + ix; 63 71 N++; 64 72 } 65 73 } 66 74 67 *nfakeImage = NfakeImage; 75 // the PHU needs to have photcode of 0 for relphot 76 fakeImage[0].photcode = 0; 77 78 *nfakeImage = N; 68 79 return fakeImage; 69 80 } -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fake_stars_catalog.c
r37467 r37471 122 122 stars[Nstars].average.D = Dobs; 123 123 124 /* 125 XXX need to set these? 126 stars[N].measure.airmass = airmass (image[0].secz, stars[N].average.R, stars[N].average.D, image[0].sidtime, image[0].latitude); 127 stars[N].measure.az = azimuth (15.0*image[0].sidtime - stars[N].average.R, stars[N].average.D, image[0].latitude); 128 stars[N].measure.Mcal = image[0].Mcal; 129 stars[N].measure.t = image[0].tzero + 1e-4*stars[N].measure.Yccd*image[0].trate; // trate is in 0.1 msec / row 130 stars[N].measure.dt = MTIME; 131 */ 124 stars[Nstars].measure.airmass = airmass (image->secz, stars[Nstars].average.R, stars[Nstars].average.D, image->sidtime, image->latitude); 125 stars[Nstars].measure.az = azimuth (15.0*image->sidtime - stars[Nstars].average.R, stars[Nstars].average.D, image->latitude); 126 stars[Nstars].measure.Mcal = image->Mcal; 127 stars[Nstars].measure.t = image->tzero + 1e-4*stars[Nstars].measure.Yccd*image->trate; // trate is in 0.1 msec / row 128 stars[Nstars].measure.dt = Mtime; 132 129 133 // this is may optionally be replaced by the internal sequence (see FilterStars.c) 130 stars[Nstars].measure.imageID = image->imageID; 131 132 // This is may optionally be replaced by the internal sequence (see FilterStars.c) 134 133 stars[Nstars].measure.detID = Nstars + 1; 135 134 Nstars ++; -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fakestars.c
r37467 r37471 71 71 double uB = uB_gal + uB_sol; 72 72 73 // crude Mr distribution from 73 // crude Mr distribution from Bochanski et al 2010 74 74 // http://iopscience.iop.org/1538-3881/139/6/2679/pdf/aj_139_6_2679.pdf 75 75
Note:
See TracChangeset
for help on using the changeset viewer.
