IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37467


Ignore:
Timestamp:
Oct 8, 2014, 1:24:42 PM (12 years ago)
Author:
eugene
Message:

fakeastro -images basically works (images and stars are generated, reasonably correctly); still need to get some of the details right

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

Legend:

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

    r37463 r37467  
    3030
    3131  int Nloop = 1;
    32   int Nstars = 2000000;
     32  int Nstars = 5000000;
    3333
    3434  for (n = 0; n < Nloop; n++) {
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/get_image_patch.c

    r37464 r37467  
    3636}
    3737
     38// region has region of Rmin <= R < Rmax, Dmin <= D < Dmax
    3839int SkyRegionHasPoint (SkyRegion *region, double R, double D) {
    3940
    40   if (D >= region->Dmin) return FALSE;
    41   if (D < region->Dmax) return FALSE;
    42   if (R >= region->Rmin) return FALSE;
    43   if (R < region->Rmax) return FALSE;
     41  if (D < region->Dmin) return FALSE;
     42  if (D >= region->Dmax) return FALSE;
     43  if (R < region->Rmin) return FALSE;
     44  if (R >= region->Rmax) return FALSE;
    4445  return TRUE;
    4546}
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fake_images.c

    r37463 r37467  
    4848
    4949      fakeImage[N].coords.pc1_2 = 0.0;
    50       fakeImage[N].coords.pc1_2 = 0.0;
     50      fakeImage[N].coords.pc2_1 = 0.0;
    5151
    5252      strcpy (fakeImage[N].coords.ctype, "DEC--WRP");
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fake_stars_catalog.c

    r37464 r37467  
    1111
    1212/* used in find_matches, find_matches_refstars */
    13 # define IN_PATCH(REGION,R,D) (                      \
    14 ((D) >= REGION[0].Dmin) && ((D) < REGION[0].Dmax) && \
    15 ((R) >= REGION[0].Rmin) && ((R) < REGION[0].Rmax))
     13# define IN_PATCH(REGION,R,D) (                                 \
     14    ((D) >= REGION[0].Dmin) && ((D) < REGION[0].Dmax) &&        \
     15    ((R) >= REGION[0].Rmin) && ((R) < REGION[0].Rmax))
    1616
    1717// region corresponds to the catalog
     
    1919
    2020  int Nstars = *nstars;
    21 
     21 
    2222  time_t timeRef = ohana_date_to_sec("2011/05/11,00:00:00");
    23 
     23 
    2424  if (!stars) {
    2525    ALLOCATE (stars, Stars, catalog->Naverage);
     
    2727    REALLOCATE (stars, Stars, Nstars + catalog->Naverage);
    2828  }
    29 
     29 
    3030  int Nsecfilt = GetPhotcodeNsecfilt ();
    31 
     31 
    3232  // use photcode to get zero point
    3333  PhotCode *code = GetPhotcodebyCode (image->photcode);
    3434  int Nsec = GetPhotcodeNsec (code->equiv);
    3535  myAssert (Nsec >= 0, "undefined Nsec?");
    36 
     36 
    3737  float Mtime = 2.5*log10(image->exptime);
    38 
     38 
    3939  // XXX fix this!!
    4040  double plateScale = 0.257;
     
    4343  float ZP = SCALE*code->C - image->Mcal + Mtime;
    4444  // float ZP = code[0].K*(measure[0].airmass - 1.000) + SCALE*code[0].C - measure[0].Mcal;
    45 
     45 
    4646  // generate a set of measurements for each star entry
    4747
     
    4949  SecFilt *secfilt = catalog->secfilt;
    5050  StarPar *starpar = catalog->starpar;
    51 
     51 
    5252  int i;
    5353  for (i = 0; i < catalog->Naverage; i++) {
     
    7474    // * proper motion
    7575    // * gaussian scatter (~ seeing)
    76     double uR = starpar[nStar].uRA / 1000.0; // starpar are (currently) in mas / year
    77     double uD = starpar[nStar].uDEC / 1000.0;
     76    double uR = starpar[nStar].uRA; // starpar are in arcsec / year
     77    double uD = starpar[nStar].uDEC;
    7878   
    7979    // tzero, timeRef are in UNIX seconds, Toffset should be in years
     
    9191    double dDoff = (dDpm + dDsee) / 3600.0;
    9292
    93     double Robs = Rtru + dRoff / cos(Dtru*DEG_RAD);
     93    double Robs = Rtru + dRoff / cos(Dtru*RAD_DEG);
    9494    double Dobs = Dtru + dDoff;
    9595
     
    119119    stars[Nstars].measure.photFlags2 = 0;
    120120
     121    stars[Nstars].average.R = Robs;
     122    stars[Nstars].average.D = Dobs;
     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    */
     132
    121133    // this is may optionally be replaced by the internal sequence (see FilterStars.c)
    122134    stars[Nstars].measure.detID      = Nstars + 1;
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fakestars.c

    r37463 r37467  
    11# include "fakeastro.h"
    22
    3 # define Z_GAL 500.0
     3// # define Z_GAL 500.0
     4# define Z_GAL 2000.0
    45# define R_GAL 2000.0
    56
    6 static double iFkap = 1.0 / 4.74047; // (km/sec/kpc) / (milli-arcsec/ year)
     7static double iFkap = 0.001 / 4.74047; // (km/sec/kpc) / (arcsec/ year)
    78static double A_oort = +14.5;  // km/sec/kpc
    89static double B_oort = -13.0;  // km/sec/kpc
Note: See TracChangeset for help on using the changeset viewer.