Changeset 37600
- Timestamp:
- Nov 14, 2014, 8:38:21 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src
- Files:
-
- 3 edited
-
initialize.c (modified) (2 diffs)
-
load_template_images.c (modified) (1 diff)
-
make_fakestars.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/initialize.c
r37463 r37600 16 16 if (argc != 1) usage (); 17 17 18 // XXX add to config? 19 if (!InitGalaxyModel ("ROESER")) { 20 fprintf (stderr, "failed to init galaxy model\n"); 21 exit (2); 22 } 18 23 } 19 24 … … 23 28 ConfigInit (&argc, argv); 24 29 if (argc != 1) usage_client (); 30 31 // XXX add to config? 32 if (!InitGalaxyModel ("ROESER")) { 33 fprintf (stderr, "failed to init galaxy model\n"); 34 exit (2); 35 } 25 36 } 26 37 -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/load_template_images.c
r37576 r37600 59 59 } 60 60 // XXX hard=wire the photcode range for now (just i-band) 61 if (childImage->photcode < 10200) continue;62 if (childImage->photcode < 10277) continue;61 // if (childImage->photcode < 10200) continue; 62 // if (childImage->photcode < 10277) continue; 63 63 64 64 refimage[Nrefimage].secz = childImage->secz; -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fakestars.c
r37564 r37600 1 1 # include "fakeastro.h" 2 3 static double iFkap = 0.001 / 4.74047; // (km/sec/kpc) / (arcsec/ year)4 static double A_oort = +14.5; // km/sec/kpc5 static double B_oort = -13.0; // km/sec/kpc6 7 static double U_sol = 9.44; // km/sec8 static double V_sol = 11.90; // km/sec9 static double W_sol = 7.20; // km/sec10 2 11 3 FakeAstro_Stars *make_fakestars (int Nstars) { … … 78 70 double distance = sqrt (SQ(r) + SQ(z)); 79 71 80 double uL_gal = (A_oort * cos(2.0*Lrad) + B_oort) * cos(Brad) * iFkap;81 double uB_gal = -0.5*A_oort * sin(2.0*Lrad) * sin(2.0*Brad) * iFkap;72 double uL_gal, uB_gal; 73 GalaxyMotionModel_radians(&uL_gal, &uB_gal, Lrad, Brad); 82 74 83 double uL_sol = (U_sol * sin(Lrad) - V_sol * cos(Lrad)) * iFkap / distance;84 double uB_sol = ((U_sol * cos(Lrad) + V_sol * sin(Lrad))*sin(Brad) - W_sol*cos(Brad)) * iFkap / distance;75 double uL_sol, uB_sol; 76 SolarMotionModel_radians(&uL_sol, &uB_sol, Lrad, Brad, distance); 85 77 86 78 double uL = uL_gal + uL_sol; … … 93 85 } 94 86 87 double uR, uD; 88 TransformProperMotion (&uR, &uD, uL, uB, R, D, transback); 89 95 90 // crude Mr distribution from Bochanski et al 2010 96 91 // http://iopscience.iop.org/1538-3881/139/6/2679/pdf/aj_139_6_2679.pdf … … 108 103 } 109 104 110 // C1, C2 are from http://arxiv.org/pdf/1306.2945v2.pdf111 double Rrad = R*RAD_DEG;112 double Drad = D*RAD_DEG;113 114 double C1 =115 cos(Drad)*transback->cos_phi +116 sin(Drad)*cos(Rrad)*transback->sin_phi_sin_Xo -117 sin(Drad)*sin(Rrad)*transback->sin_phi_cos_Xo;118 119 double C2 =120 - cos(Rrad)*transback->sin_phi_cos_Xo121 - sin(Rrad)*transback->sin_phi_sin_Xo;122 123 double cosBinv = 1.0 / sqrt(C1*C1 + C2*C2);124 125 // XXX add errors : I need to be able to choose the stars based on the error distribution126 double uR = cosBinv * (C1 * uL - C2 * uB);127 double uD = cosBinv * (C1 * uB + C2 * uL);128 129 105 stars[i].R = R; 130 106 stars[i].D = D;
Note:
See TracChangeset
for help on using the changeset viewer.
