IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19185


Ignore:
Timestamp:
Aug 25, 2008, 11:45:29 AM (18 years ago)
Author:
eugene
Message:

extending image name to 128 bytes; updating conversion routines

Location:
trunk/Ohana/src
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libautocode/Makefile.Targets

    r17189 r19185  
    3636$(ASRC)/image-ps1-dev-1.$(ARCH).o \
    3737$(ASRC)/image-ps1-dev-2.$(ARCH).o \
     38$(ASRC)/image-ps1-dev-3.$(ARCH).o \
    3839$(ASRC)/regimage.$(ARCH).o \
    3940$(ASRC)/detreg.$(ARCH).o \
     
    8990$(AINC)/image-ps1-dev-1.h \
    9091$(AINC)/image-ps1-dev-2.h \
     92$(AINC)/image-ps1-dev-3.h \
    9193$(AINC)/regimage.h \
    9294$(AINC)/detreg.h \
  • trunk/Ohana/src/libautocode/def/image.d

    r16971 r19185  
    22EXTNAME      DVO_IMAGE
    33TYPE         BINTABLE
    4 SIZE         280
     4SIZE         344
    55DESCRIPTION  DVO Image Table
    66
     
    4040# 40 bytes
    4141
    42 FIELD     name,             NAME,                 char[64],       name of original image
     42FIELD     name,             NAME,                 char[128],      name of original image
    4343FIELD     detection_limit,  DETECTION_LIMIT,      unsigned char,  detection limit,           10*mag
    4444FIELD     saturation_limit, SATURATION_LIMIT,     unsigned char,  saturation limit,          10*mag
  • trunk/Ohana/src/libdvo/src/dvo_convert.c

    r16810 r19185  
    288288  CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_1",       PS1_DEV_1,       PS1_DEV_1);
    289289  CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_2",       PS1_DEV_2,       PS1_DEV_2);
     290  CONVERT_FORMAT ("DVO_IMAGE_PS1_DEV_3",       PS1_DEV_3,       PS1_DEV_3);
    290291# undef CONVERT_FORMAT
    291292
     
    321322      FORMAT_CASE (PS1_DEV_1,       PS1_DEV_1);
    322323      FORMAT_CASE (PS1_DEV_2,       PS1_DEV_2);
     324      FORMAT_CASE (PS1_DEV_3,       PS1_DEV_3);
    323325# undef FORMAT_CASE
    324326
     
    370372      FORMAT_CASE (PS1_DEV_1,       PS1_DEV_1);
    371373      FORMAT_CASE (PS1_DEV_2,       PS1_DEV_2);
     374      FORMAT_CASE (PS1_DEV_3,       PS1_DEV_3);
    372375# undef FORMAT_CASE
    373376
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_1.c

    r17190 r19185  
    194194  for (i = 0; i < Nvalues; i++) {
    195195    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    196     strcpy (out[i].name, in[i].name);
     196
     197    strncpy (out[i].name, in[i].name, 63); // out[128], in[64]
     198    out[i].name[63] = 0; // force termination
    197199
    198200    out[i].tzero            = in[i].tzero;
     
    249251  for (i = 0; i < Nvalues; i++) {
    250252    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    251     strcpy (out[i].name, in[i].name);
     253
     254    strncpy (out[i].name, in[i].name, 63); // out[128], in[64]
     255    out[i].name[63] = 0; // force termination
    252256
    253257    out[i].tzero            = in[i].tzero;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_2.c

    r17190 r19185  
    200200  for (i = 0; i < Nvalues; i++) {
    201201    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    202     strcpy (out[i].name, in[i].name);
     202
     203    strncpy (out[i].name, in[i].name, 63); // out[128], int[64]
     204    out[i].name[63] = 0; // force termination
    203205
    204206    out[i].tzero            = in[i].tzero;
     
    256258  for (i = 0; i < Nvalues; i++) {
    257259    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    258     strcpy (out[i].name, in[i].name);
     260
     261    strncpy (out[i].name, in[i].name, 63); // in[128], out[64]
     262    out[i].name[63] = 0; // force termination
    259263
    260264    out[i].tzero            = in[i].tzero;
  • trunk/Ohana/src/libdvo/src/dvo_convert_PS1_DEV_3.c

    r17190 r19185  
    33/* convert PS1_DEV_3 formats to internal formats */
    44
    5 // XXX I am not yet ready to commit to a full PS1_DEV_3 release, but we can add photcode here for now
     5// XXX EAM I am not yet ready to commit to a full PS1_DEV_3 release, but I am providing image and photcode conversion
     6
     7Image *Image_PS1_DEV_3_ToInternal (Image_PS1_DEV_3 *in, int Nvalues) {
     8
     9  int i;
     10  Image *out;
     11
     12  ALLOCATE (out, Image, Nvalues);
     13
     14  for (i = 0; i < Nvalues; i++) {
     15    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
     16
     17    strncpy (out[i].name, in[i].name, 127); // out[128], in[128]
     18    out[i].name[127] = 0; // force termination
     19
     20    out[i].tzero            = in[i].tzero;
     21    out[i].nstar            = in[i].nstar;
     22    out[i].secz             = in[i].secz;
     23    out[i].NX               = in[i].NX;
     24    out[i].NY               = in[i].NY;
     25    out[i].apmifit          = in[i].apmifit;
     26    out[i].dapmifit         = in[i].dapmifit;
     27    out[i].Mcal             = in[i].Mcal;
     28    out[i].dMcal            = in[i].dMcal;
     29    out[i].Xm               = in[i].Xm;
     30    out[i].photcode         = in[i].photcode;
     31    out[i].exptime          = in[i].exptime;
     32    out[i].sidtime          = in[i].sidtime;
     33    out[i].latitude         = in[i].latitude;
     34    out[i].detection_limit  = in[i].detection_limit;
     35    out[i].saturation_limit = in[i].saturation_limit;
     36    out[i].cerror           = in[i].cerror;
     37    out[i].fwhm_x           = in[i].fwhm_x;
     38    out[i].fwhm_y           = in[i].fwhm_y;
     39    out[i].trate            = in[i].trate;
     40    out[i].code             = in[i].code;
     41    out[i].ccdnum           = in[i].ccdnum;
     42    out[i].imageID          = in[i].imageID;
     43    out[i].externID         = in[i].externID;
     44    out[i].sourceID         = in[i].sourceID;
     45
     46    out[i].order            = in[i].order;
     47    out[i].Mx               = in[i].Mx;
     48    out[i].My               = in[i].My;
     49    out[i].Mxx              = in[i].Mxx;
     50    out[i].Mxy              = in[i].Mxy;
     51    out[i].Myy              = in[i].Myy;
     52    out[i].Mxxx             = in[i].Mxxx;
     53    out[i].Mxxy             = in[i].Mxxy;
     54    out[i].Mxyy             = in[i].Mxyy;
     55    out[i].Myyy             = in[i].Myyy;
     56    out[i].Mxxxx            = in[i].Mxxxx;
     57    out[i].Mxxxy            = in[i].Mxxxy;
     58    out[i].Mxxyy            = in[i].Mxxyy;
     59    out[i].Mxyyy            = in[i].Mxyyy;
     60    out[i].Myyyy            = in[i].Myyyy;
     61  }
     62  return (out);
     63}
     64
     65Image_PS1_DEV_3 *ImageInternalTo_PS1_DEV_3 (Image *in, int Nvalues) {
     66
     67  int i;
     68  Image_PS1_DEV_3 *out;
     69
     70  ALLOCATE (out, Image_PS1_DEV_3, Nvalues);
     71
     72  for (i = 0; i < Nvalues; i++) {
     73    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
     74
     75    strncpy (out[i].name, in[i].name, 127); // out[128], in[128]
     76    out[i].name[127] = 0; // force termination
     77
     78    out[i].tzero            = in[i].tzero;
     79    out[i].nstar            = in[i].nstar;
     80    out[i].secz             = in[i].secz;
     81    out[i].NX               = in[i].NX;
     82    out[i].NY               = in[i].NY;
     83    out[i].apmifit          = in[i].apmifit;
     84    out[i].dapmifit         = in[i].dapmifit;
     85    out[i].Mcal             = in[i].Mcal;
     86    out[i].dMcal            = in[i].dMcal;
     87    out[i].Xm               = in[i].Xm;
     88    out[i].photcode         = in[i].photcode;
     89    out[i].exptime          = in[i].exptime;
     90    out[i].sidtime          = in[i].sidtime;
     91    out[i].latitude         = in[i].latitude;
     92    out[i].detection_limit  = in[i].detection_limit;
     93    out[i].saturation_limit = in[i].saturation_limit;
     94    out[i].cerror           = in[i].cerror;
     95    out[i].fwhm_x           = in[i].fwhm_x;
     96    out[i].fwhm_y           = in[i].fwhm_y;
     97    out[i].trate            = in[i].trate;
     98    out[i].code             = in[i].code;
     99    out[i].ccdnum           = in[i].ccdnum;
     100    out[i].imageID          = in[i].imageID;
     101    out[i].externID         = in[i].externID;
     102    out[i].sourceID         = in[i].sourceID;
     103
     104    out[i].order            = in[i].order;
     105    out[i].Mx               = in[i].Mx;
     106    out[i].My               = in[i].My;
     107    out[i].Mxx              = in[i].Mxx;
     108    out[i].Mxy              = in[i].Mxy;
     109    out[i].Myy              = in[i].Myy;
     110    out[i].Mxxx             = in[i].Mxxx;
     111    out[i].Mxxy             = in[i].Mxxy;
     112    out[i].Mxyy             = in[i].Mxyy;
     113    out[i].Myyy             = in[i].Myyy;
     114    out[i].Mxxxx            = in[i].Mxxxx;
     115    out[i].Mxxxy            = in[i].Mxxxy;
     116    out[i].Mxxyy            = in[i].Mxxyy;
     117    out[i].Mxyyy            = in[i].Mxyyy;
     118    out[i].Myyyy            = in[i].Myyyy;
     119  }
     120  return (out);
     121}
    6122
    7123PhotCode_PS1_DEV_3 *PhotCode_Internal_To_PS1_DEV_3 (PhotCode *in, int Nvalues) {
  • trunk/Ohana/src/libdvo/src/dvo_convert_elixir.c

    r17190 r19185  
    199199  for (i = 0; i < Nvalues; i++) {
    200200    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    201     strcpy (out[i].name, in[i].name); // out[64], in[32]
     201
     202    strncpy (out[i].name, in[i].name, 31); // in[32], out[128]
     203    out[i].name[31] = 0; // force termination
    202204
    203205    out[i].tzero            = in[i].tzero;
     
    258260  for (i = 0; i < Nvalues; i++) {
    259261    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    260     strncpy (out[i].name, in[i].name, 31); // out[32], in[64]
     262
     263    strncpy (out[i].name, in[i].name, 31); // out[32], in[128]
    261264    out[i].name[31] = 0; // force termination
    262265
  • trunk/Ohana/src/libdvo/src/dvo_convert_loneos.c

    r16810 r19185  
    189189  for (i = 0; i < Nvalues; i++) {
    190190    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    191     strcpy (out[i].name, in[i].name); // out[64], in[32]
     191
     192    strncpy (out[i].name, in[i].name, 31); // in[32], out[128]
     193    out[i].name[31] = 0; // force termination
    192194
    193195    out[i].tzero            = in[i].tzero;
     
    245247  for (i = 0; i < Nvalues; i++) {
    246248    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    247     strncpy (out[i].name, in[i].name, 31); // out[32], in[64]
     249
     250    strncpy (out[i].name, in[i].name, 31); // out[32], in[128]
    248251    out[i].name[31] = 0; // force termination
    249252
  • trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_0.c

    r16810 r19185  
    202202  for (i = 0; i < Nvalues; i++) {
    203203    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    204     strcpy (out[i].name, in[i].name); // out[64], in[32]
     204
     205    strncpy (out[i].name, in[i].name, 31); // out[128], in[32]
     206    out[i].name[31] = 0; // force termination
    205207
    206208    out[i].tzero            = in[i].tzero;
     
    257259  for (i = 0; i < Nvalues; i++) {
    258260    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    259     strncpy (out[i].name, in[i].name, 31); // out[32], in[64]
     261
     262    strncpy (out[i].name, in[i].name, 31); // out[32], in[128]
    260263    out[i].name[31] = 0; // force termination
    261264
  • trunk/Ohana/src/libdvo/src/dvo_convert_panstarrs_DEV_1.c

    r16810 r19185  
    202202  for (i = 0; i < Nvalues; i++) {
    203203    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    204     strcpy (out[i].name, in[i].name);
     204
     205    strncpy (out[i].name, in[i].name, 63); // in[64], out[128]
     206    out[i].name[63] = 0; // force termination
    205207
    206208    out[i].tzero            = in[i].tzero;
     
    257259  for (i = 0; i < Nvalues; i++) {
    258260    memcpy (&out[i].coords, &in[i].coords, sizeof(Coords));
    259     strcpy (out[i].name, in[i].name);
     261
     262    strncpy (out[i].name, in[i].name, 63); // in[128], out[64]
     263    out[i].name[63] = 0; // force termination
    260264
    261265    out[i].tzero            = in[i].tzero;
  • trunk/Ohana/src/libdvo/src/dvo_image.c

    r16810 r19185  
    195195  if (db[0].format == DVO_FORMAT_PS1_DEV_1)       gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_DEV_1");
    196196  if (db[0].format == DVO_FORMAT_PS1_DEV_2)       gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_DEV_2");
     197  if (db[0].format == DVO_FORMAT_PS1_DEV_3)       gfits_modify (&db[0].header, "FORMAT", "%s", 1, "PS1_DEV_3");
    197198 
    198199  return;
Note: See TracChangeset for help on using the changeset viewer.