IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37457


Ignore:
Timestamp:
Oct 2, 2014, 2:19:23 PM (12 years ago)
Author:
eugene
Message:

adding fake images and stars

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

Legend:

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

    r37453 r37457  
    11# include "fakeastro.h"
    22
    3 Images *make_boresites (Images *images, int Nimages; int *nbores) {
     3Image *make_fake_images (Image *image, int *nfakeImage) {
    44
     5  // given an image (really, the WCS) which defines an exposure, generate the image
     6  // parameters for a full set of chips in an exposure
    57 
     8  int NfakeImage = 65;
     9  Image *fakeImage = NULL;
    610
     11  ALLOCATE (fakeImage, Image, NfakeImage);
     12
     13  // first image is the PHU, copy basic data:
     14
     15  fakeImage[0] = image[0];
     16
     17  int N = 1;
     18
     19  int ix, iy;
     20  for (ix = 0; ix < 8; ix++) {
     21    for (iy = 0; iy < 8; iy++) {
     22     
     23      fakeImage[N] = fakeImage[0];
     24
     25      // coords map relative to image center:
     26      fakeImage[N].coords.crval1 = 0.0;
     27      fakeImage[N].coords.crval2 = 0.0;
     28
     29      if (ix < 4) {
     30        fakeImage[N].coords.crpix1 = (ix - 3)*4900;
     31        fakeImage[N].coords.crpix2 = (iy - 3)*4900;
     32        fakeImage[N].coords.pc1_1 = 1.0
     33        fakeImage[N].coords.pc2_2 = 1.0
     34      } else {
     35        fakeImage[N].coords.crpix1 = (3 - ix)*4900;
     36        fakeImage[N].coords.crpix2 = (4 - iy)*4900;
     37        fakeImage[N].coords.pc1_1 = -1.0
     38        fakeImage[N].coords.pc2_2 = -1.0
     39      }
     40
     41      fakeImage[N].coords.cdelt1 = 1.0;
     42      fakeImage[N].coords.cdelt2 = 1.0;
     43
     44      fakeImage[N].coords.pc1_2 = 0.0;
     45      fakeImage[N].coords.pc1_2 = 0.0;
     46
     47      strcpy (fakeImage[N].coords.ctype, "DEC--WRP");
     48      fakeImage[N].coords.Npolyterms = 1;
     49
     50      fakeImage[N].coords.mosaic = &fakeImage[0].coords;
     51
     52      fakeImage[N].NX = 4850;
     53      fakeImage[N].NY = 4850;
     54
     55      fakeImage[N].photcode = 10000 + iy*10 + ix;
     56      fakeImage[N].exptime = 45.0;
     57      N++;
     58    }
     59  }
     60
     61  *nfakeImage = NfakeImage;
     62  return fakeImage;
    763}
     64
Note: See TracChangeset for help on using the changeset viewer.