IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31440


Ignore:
Timestamp:
May 5, 2011, 10:07:46 AM (15 years ago)
Author:
eugene
Message:

merging updates from trunk

Location:
branches/eam_branches/ipp-20110404/Ohana/src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110404/Ohana/src/addstar/include/skycells.h

    r31027 r31440  
    6565int    NMAX;
    6666int    NX_SUB, NY_SUB;
     67int    X_PARITY;
    6768double SCALE;
    6869double PADDING;
  • branches/eam_branches/ipp-20110404/Ohana/src/addstar/src/GetFileMode.c

    r27435 r31440  
    44int GetFileMode (Header *header) {
    55
    6   char ctype[80], ctmp;
     6  char ctype[81], ctmp[80];
    77  int Naxis;
    88  int simple, extend, haveNaxis, haveCTYPE;
     
    1717  // SDSS tsObj files have a version number for the PHOTO and
    1818  // TS (target selection) pipelines present as header keywords
    19   havePHOT_VER = gfits_scan (header, "PHOT_VER", "%s", 1, &ctmp);
    20   haveTARG_VER = gfits_scan (header, "TARG_VER", "%s", 1, &ctmp);
     19  havePHOT_VER = gfits_scan (header, "PHOT_VER", "%s", 1, ctmp);
     20  haveTARG_VER = gfits_scan (header, "TARG_VER", "%s", 1, ctmp);
    2121  if (havePHOT_VER && haveTARG_VER) return SDSS_OBJ;
    2222
  • branches/eam_branches/ipp-20110404/Ohana/src/addstar/src/ReadImageHeader.c

    r29132 r31440  
    66
    77  int Nastro, hour, min, Nx, Ny, haveNx, haveNy, sourceID;
    8   double tmp, sec, Cerror, ZeroPt, FWHM_X, FWHM_Y;
     8  double tmp, sec, Cerror, FWHM_X, FWHM_Y;
    99  char *c, photname[64], line[80], ccdnum[64];
    1010  PhotCode *photcodeData = NULL;
     
    205205  }
    206206
     207#ifdef notdef
    207208  // XXX this is archaic: we used to set a fixed zero point of 25 to shift data into the range
    208209  // 0 - 32 so it would fit in an unsigned int.  This is also needed because some programs like
    209210  // sextractor will put in an arbitrary zero point that we need to understand to get back to
    210211  // instrumental mags.
     212  double ZeroPt;
    211213  gfits_scan (header, "ZERO_PT", "%lf", 1, &ZeroPt);
    212214  if (ZeroPt != GetZeroPoint()) {
    213215      fprintf (stderr, "WARNING: inconsistent zero point values: image: %f, config: %f\n", ZeroPt, GetZeroPoint());
    214216  }
     217#endif
    215218
    216219  // in this case, lookup and apply the zero point measured for this chip
  • branches/eam_branches/ipp-20110404/Ohana/src/addstar/src/args_skycells.c

    r31027 r31440  
    8585      fprintf (stderr, "missing -size dRA dDEC for LOCAL mode\n");
    8686      help ();
    87     }
    88     OVERLAP_RA = 0;
    89     OVERLAP_DEC = 0;
    90     if ((N = get_argument (argc, argv, "-overlap"))) {
    91       remove_argument (N, &argc, argv);
    92       OVERLAP_RA  = atof (argv[N]);
    93       remove_argument (N, &argc, argv);
    94       OVERLAP_DEC  = atof (argv[N]);
    95       remove_argument (N, &argc, argv);
    9687    }
    9788    PROJECTION_NUMBER[0] = 0;
     
    187178      help ();
    188179    } 
     180    remove_argument (N, &argc, argv);
     181  }
     182
     183  OVERLAP_RA = 0;
     184  OVERLAP_DEC = 0;
     185  if ((N = get_argument (argc, argv, "-overlap"))) {
     186    remove_argument (N, &argc, argv);
     187    OVERLAP_RA  = atof (argv[N]);
     188    remove_argument (N, &argc, argv);
     189    OVERLAP_DEC  = atof (argv[N]);
     190    remove_argument (N, &argc, argv);
     191  }
     192  X_PARITY = 1;
     193  if ((N = get_argument (argc, argv, "-skyparity"))) {
     194    X_PARITY = -1;
    189195    remove_argument (N, &argc, argv);
    190196  }
     
    223229  fprintf (stderr, "  -nx Nx                      : subdivide skycell projection in x by Nx\n");
    224230  fprintf (stderr, "  -ny Ny                      : subdivide skycell projection in y by Ny\n");
     231  fprintf (stderr, "  -overlap Or Od              : overlap between skycells (arcseconds)\n");
    225232  fprintf (stderr, "  -projection-number Np       : set projection-number (local mode only)\n");
     233  fprintf (stderr, "  -skyparity                  : set wcs for skycells so that east is to the left\n");
    226234  fprintf (stderr, "  -help                       : this list\n");
    227235  fprintf (stderr, "  -h                          : this list\n\n");
  • branches/eam_branches/ipp-20110404/Ohana/src/addstar/src/sky_tessalation.c

    r31027 r31440  
    318318  memset (image, 0, sizeof(Image));
    319319  image[0].coords = *refcoords;
    320   image[0].coords.pc1_1 = image[0].coords.pc2_2 = 1.0;
     320  image[0].coords.pc1_1 = 1.0 * X_PARITY;
     321  image[0].coords.pc2_2 = 1.0;
    321322  image[0].coords.pc1_2 = image[0].coords.pc2_1 = 0.0;
    322323
     
    468469
    469470  if (FIX_NS) {
    470     rectangle[0].coords.pc1_1 = +1.0;
     471    rectangle[0].coords.pc1_1 = +1.0 * X_PARITY;
    471472    rectangle[0].coords.pc1_2 = +0.0;
    472473    rectangle[0].coords.pc2_1 = -0.0;
     
    475476    ycr = yc*cos(angle) + xc*sin(angle);
    476477  } else {
    477     rectangle[0].coords.pc1_1 = +cos(angle);
     478    rectangle[0].coords.pc1_1 = +cos(angle) * X_PARITY;
    478479    rectangle[0].coords.pc1_2 = +sin(angle);
    479     rectangle[0].coords.pc2_1 = -sin(angle);
     480    rectangle[0].coords.pc2_1 = -sin(angle) * X_PARITY;
    480481    rectangle[0].coords.pc2_2 = +cos(angle);
    481482    xcr = xc;
     
    514515  angle = 0.0;
    515516  if (FIX_NS) {
    516     rectangle[0].coords.pc1_1 = +1.0;
     517    rectangle[0].coords.pc1_1 = +1.0 * X_PARITY;
    517518    rectangle[0].coords.pc1_2 = +0.0;
    518519    rectangle[0].coords.pc2_1 = -0.0;
    519520    rectangle[0].coords.pc2_2 = +1.0;
    520521  } else {
    521     rectangle[0].coords.pc1_1 = +cos(angle);
     522    rectangle[0].coords.pc1_1 = +cos(angle) * X_PARITY;
    522523    rectangle[0].coords.pc1_2 = +sin(angle);
    523     rectangle[0].coords.pc2_1 = -sin(angle);
     524    rectangle[0].coords.pc2_1 = -sin(angle) * X_PARITY;
    524525    rectangle[0].coords.pc2_2 = +cos(angle);
    525526  }
     
    626627    ring[i].coords.crval2 = dec;
    627628
    628     ring[i].coords.pc1_1 = +1.0;
     629    ring[i].coords.pc1_1 = +1.0 * X_PARITY;
    629630    ring[i].coords.pc1_2 = +0.0;
    630631    ring[i].coords.pc2_1 = -0.0;
  • branches/eam_branches/ipp-20110404/Ohana/src/dvomerge/src/dvomergeCreate.c

    r29938 r31440  
    9393
    9494  // save the output photcodes in the output catdir
    95   // SetPhotcodeTable(outputPhotcodes);
     95  SetPhotcodeTable(outputPhotcodes);
    9696  sprintf (filename, "%s/Photcodes.dat", output);
    9797  if (!check_file_access (filename, TRUE, TRUE, VERBOSE)) {
     
    129129    if (VERBOSE) fprintf (stderr, "output: %s\n", outsky[0].regions[i].name);
    130130
    131     // if (outputPhotcodes) {
    132     //     SetPhotcodeTable(outputPhotcodes);
    133     // }
    134131    // load / create output catalog
    135132    LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], "w", NsecfiltOutput);
    136133
    137     // if (input1Photcodes) {
    138     // SetPhotcodeTable(input1Photcodes);
    139     // }
    140134    // combine only tables at equal or larger depth
    141135     
     
    161155    SkyListFree (inlist);
    162156
    163     // if (input2Photcodes) {
    164     //   SetPhotcodeTable(input2Photcodes);
    165     // }
    166 
    167157    // load in all of the tables from input2 for this region
    168158    inlist = SkyListByBounds (insky2, depth2, outsky[0].regions[i].Rmin, outsky[0].regions[i].Rmax, outsky[0].regions[i].Dmin, outsky[0].regions[i].Dmax);
  • branches/eam_branches/ipp-20110404/Ohana/src/getstar/include/dvoImagesAtCoords.h

    r27435 r31440  
    77
    88int       VERBOSE;
     9int       LISTCHIPCOORDS;
    910
    1011char OUTPUT[256];
     
    1920
    2021typedef struct {
     22    int     n;
     23    double  x;
     24    double  y;
     25} Match;
     26
     27typedef struct {
    2128    int     id;
    2229    double  ra;
    2330    double  dec;
    2431    int     Nmatches;
    25     int     *matches;
     32    Match   *matches;
    2633    int     arrayLength;
    2734} Point;
  • branches/eam_branches/ipp-20110404/Ohana/src/getstar/src/MatchCoords.c

    r30791 r31440  
    9393            totalMatches++;
    9494
    95             pt->matches[pt->Nmatches] = i;
     95            pt->matches[pt->Nmatches].n = i;
     96            pt->matches[pt->Nmatches].x = x;
     97            pt->matches[pt->Nmatches].y = y;
    9698            pt->Nmatches ++;
    9799
    98100            if (pt->Nmatches == pt->arrayLength) {
    99101                pt->arrayLength += 20;
    100                 REALLOCATE (pt->matches, int, pt->arrayLength);
     102                REALLOCATE (pt->matches, Match, pt->arrayLength);
    101103            }
    102104        }
  • branches/eam_branches/ipp-20110404/Ohana/src/getstar/src/args_coords.c

    r26288 r31440  
    4141
    4242  /* check for command line options */
     43  LISTCHIPCOORDS = FALSE;
     44  if ((N = get_argument (argc, argv, "-listchipcoords"))) {
     45    LISTCHIPCOORDS = TRUE;
     46    remove_argument (N, &argc, argv);
     47  }
    4348  WITH_PHU = FALSE;
    4449  if ((N = get_argument (argc, argv, "+phu"))) {
  • branches/eam_branches/ipp-20110404/Ohana/src/getstar/src/dvoImagesAtCoords.c

    r29001 r31440  
    9191    while ((Nread = fscanf(f, "%d %lf %lf\n", &pts[Npoints].id, &pts[Npoints].ra, &pts[Npoints].dec)) == 3) {
    9292        pts[Npoints].Nmatches = 0;
    93         ALLOCATE(pts[Npoints].matches, int, 20);
     93        ALLOCATE(pts[Npoints].matches, Match, 20);
    9494        pts[Npoints].arrayLength = 20;
    9595
     
    118118    pts[0].dec = dec;
    119119    pts[0].Nmatches = 0;
    120     ALLOCATE(pts[0].matches, int, 20);
     120    ALLOCATE(pts[0].matches, Match, 20);
    121121    pts[0].arrayLength = 20;
    122122
     
    133133      Point *pt = points + j;
    134134      for (i = 0; i < pt->Nmatches; i++) {
    135         int N = pt->matches[i];
     135        int N = pt->matches[i].n;
     136        double x = pt->matches[i].x;
     137        double y = pt->matches[i].y;
    136138
    137139        char *name;
     
    150152            name = dbImages[N].name;
    151153        }
    152         fprintf (stdout, "%d %lf %lf %s\n", pt->id, pt->ra, pt->dec, name);
     154        if (LISTCHIPCOORDS) {
     155            fprintf (stdout, "%d %lf %lf %s %8.2lf %8.2lf\n", pt->id, pt->ra, pt->dec, name, x, y);
     156        } else {
     157            fprintf (stdout, "%d %lf %lf %s\n", pt->id, pt->ra, pt->dec, name);
     158        }
    153159        if  (copy) {
    154160            free(copy);
  • branches/eam_branches/ipp-20110404/Ohana/src/libfits/table/F_get_column.c

    r28241 r31440  
    3030  tlabel[0] = 0;
    3131  if (!gfits_scan (header, "TFIELDS", "%d", 1, &Nfields)) return (NULL);
    32   for (i = 1; strcmp (label, tlabel) && (i < Nfields + 1); i++) {
     32  for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) {
    3333    sprintf (field, "TTYPE%d", i);
    3434    gfits_scan (header, field, "%s", 1, tlabel);
    3535  }
    36   if (strcmp (label, tlabel)) return (NULL);
     36  if (strcasecmp (label, tlabel)) return (NULL);
    3737  N = i - 1;
    3838
     
    137137  tlabel[0] = 0;
    138138  gfits_scan (header, "TFIELDS", "%d", 1, &Nfields);
    139   for (i = 1; strcmp (label, tlabel) && (i < Nfields + 1); i++) {
     139  for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) {
    140140    sprintf (field, "TTYPE%d", i);
    141141    gfits_scan (header, field, "%s", 1, tlabel);
    142142  }
    143   if (strcmp (label, tlabel)) return (FALSE);
     143  if (strcasecmp (label, tlabel)) return (FALSE);
    144144  N = i - 1;
    145145
     
    166166  tlabel[0] = 0;
    167167  gfits_scan (header, "TFIELDS", "%d", 1, &Nfields);
    168   for (i = 1; strcmp (label, tlabel) && (i < Nfields + 1); i++) {
     168  for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) {
    169169    sprintf (field, "TTYPE%d", i);
    170170    gfits_scan (header, field, "%s", 1, tlabel);
    171171  }
    172   if (strcmp (label, tlabel)) return (FALSE);
     172  if (strcasecmp (label, tlabel)) return (FALSE);
    173173  N = i - 1;
    174174
     
    291291  tlabel[0] = 0;
    292292  gfits_scan (header, "TFIELDS", "%d", 1, &Nfields);
    293   for (i = 1; strcmp (label, tlabel) && (i < Nfields + 1); i++) {
     293  for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) {
    294294    sprintf (field, "TTYPE%d", i);
    295295    gfits_scan (header, field, "%s", 1, tlabel);
    296296  }
    297   if (strcmp (label, tlabel)) return (FALSE);
     297  if (strcasecmp (label, tlabel)) return (FALSE);
    298298  N = i - 1;
    299299
     
    321321  tlabel[0] = 0;
    322322  gfits_scan (header, "TFIELDS", "%d", 1, &Nfields);
    323   for (i = 1; strcmp (label, tlabel) && (i < Nfields + 1); i++) {
     323  for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) {
    324324    sprintf (field, "TTYPE%d", i);
    325325    gfits_scan (header, field, "%s", 1, tlabel);
    326326  }
    327   if (strcmp (label, tlabel)) return (FALSE);
     327  if (strcasecmp (label, tlabel)) return (FALSE);
    328328  N = i - 1;
    329329
  • branches/eam_branches/ipp-20110404/Ohana/src/libfits/table/F_set_column.c

    r28241 r31440  
    3131  tlabel[0] = 0;
    3232  gfits_scan (header, "TFIELDS", "%d", 1, &Nfields);
    33   for (i = 1; strcmp (label, tlabel) && (i < Nfields + 1); i++) {
     33  for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) {
    3434    sprintf (field, "TTYPE%d", i);
    3535    gfits_scan (header, field, "%s", 1, tlabel);
    3636  }
    37   if (strcmp (label, tlabel)) return (FALSE);
     37  if (strcasecmp (label, tlabel)) return (FALSE);
    3838  N = i - 1;
    3939
Note: See TracChangeset for help on using the changeset viewer.