IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37527


Ignore:
Timestamp:
Oct 23, 2014, 4:47:26 PM (12 years ago)
Author:
eugene
Message:

tweak the chip sizes / positions; testing to find the astrom failures

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/fit_fake_stars.c

    r37523 r37527  
    11# include "fakeastro.h"
     2
     3int 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}
    218
    319int fit_fake_stars (Stars *stars, int Nstars, Image *image) {
     
    5975  }
    6076
     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
    6191  if (CHIPMAP) {
    6292
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/fitpoly.c

    r37477 r37527  
    141141  }
    142142
    143   for (i = 0; FALSE && (i < fit[0].Nelems); i++) {
     143# define DEBUG FALSE
     144  for (i = 0; DEBUG && (i < fit[0].Nelems); i++) {
    144145    ix = i % fit[0].Nterms;
    145146    iy = i / fit[0].Nterms;
     
    154155  }
    155156
    156   for (i = 0; FALSE && i < fit[0].Nelems; i++) {
     157  for (i = 0; DEBUG && i < fit[0].Nelems; i++) {
    157158    ix = i % fit[0].Nterms;
    158159    iy = i / fit[0].Nterms;
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fake_images.c

    r37478 r37527  
    3939
    4040      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;
    4343        fakeImage[N].coords.pc1_1 = 1.0;
    4444        fakeImage[N].coords.pc2_2 = 1.0;
    4545      } 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;
    4848        fakeImage[N].coords.pc1_1 = -1.0;
    4949        fakeImage[N].coords.pc2_2 = -1.0;
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fakeqsos.c

    r37523 r37527  
    77
    88  // 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;
    914
    1015  int i;
     
    1823    int inPatch = FALSE;
    1924    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
    2328      if (R < UserPatch.Rmin) continue;
    2429      if (R > UserPatch.Rmax) continue;
  • branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/match_fake_stars.c

    r37523 r37527  
    11# 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.
    25
    36int match_fake_stars (Stars *stars, unsigned int NstarsIn, SkyRegion *region, Catalog *catalog, Image *image) {
Note: See TracChangeset for help on using the changeset viewer.