IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37600


Ignore:
Timestamp:
Nov 14, 2014, 8:38:21 PM (12 years ago)
Author:
eugene
Message:

move galaxy model functions to libdvo

Location:
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/initialize.c

    r37463 r37600  
    1616  if (argc != 1) usage ();
    1717
     18  // XXX add to config?
     19  if (!InitGalaxyModel ("ROESER")) {
     20    fprintf (stderr, "failed to init galaxy model\n");
     21    exit (2);
     22  }
    1823}
    1924
     
    2328  ConfigInit (&argc, argv);
    2429  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  }
    2536}
    2637
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/load_template_images.c

    r37576 r37600  
    5959    }
    6060    // 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;
    6363
    6464    refimage[Nrefimage].secz     = childImage->secz;
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fakestars.c

    r37564 r37600  
    11# 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/kpc
    5 static double B_oort = -13.0;  // km/sec/kpc
    6 
    7 static double U_sol  =  9.44; // km/sec
    8 static double V_sol  = 11.90; // km/sec
    9 static double W_sol  =  7.20; // km/sec
    102
    113FakeAstro_Stars *make_fakestars (int Nstars) {
     
    7870    double distance = sqrt (SQ(r) + SQ(z));
    7971
    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);
    8274
    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);
    8577
    8678    double uL = uL_gal + uL_sol;
     
    9385    }
    9486   
     87    double uR, uD;
     88    TransformProperMotion (&uR, &uD, uL, uB, R, D, transback);
     89
    9590    // crude Mr distribution from Bochanski et al 2010
    9691    // http://iopscience.iop.org/1538-3881/139/6/2679/pdf/aj_139_6_2679.pdf
     
    108103    }
    109104   
    110     // C1, C2 are from http://arxiv.org/pdf/1306.2945v2.pdf
    111     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_Xo
    121       - 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 distribution
    126     double uR = cosBinv * (C1 * uL - C2 * uB);
    127     double uD = cosBinv * (C1 * uB + C2 * uL);
    128 
    129105    stars[i].R = R;
    130106    stars[i].D = D;
Note: See TracChangeset for help on using the changeset viewer.