Changeset 1660 in Sophya for trunk/SophyaExt


Ignore:
Timestamp:
Sep 30, 2001, 7:03:59 PM (24 years ago)
Author:
cmv
Message:
  • plus d'options et de possibilites + doc

cmv 30/9/01

Location:
trunk/SophyaExt/FitsIOServer
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/FitsIOServer/Makefile

    r1654 r1660  
    33all: $(LIB)libFitsIOServer.a
    44clean:
    5         rm -f $(OBJ)fabtcolread.o $(OBJ)fabtwriter.o $(OBJ)fbtntintf.o $(OBJ)fitsautoreader.o $(OBJ)fitsbntbllineRW.o $(OBJ)fitsfile.o $(OBJ)fitslocalmap.o $(OBJ)fitsntuple.o $(OBJ)fitsspherehealpix.o $(OBJ)fitstarray.o $(OBJ)fitsxntuple.o
     5        rm -f $(OBJ)fabtcolread.o $(OBJ)fabtwriter.o $(OBJ)fboloread.o $(OBJ)fbtntintf.o $(OBJ)fitsautoreader.o $(OBJ)fitsbntbllineRW.o $(OBJ)fitsfile.o $(OBJ)fitslocalmap.o $(OBJ)fitsntuple.o $(OBJ)fitsspherehealpix.o $(OBJ)fitstarray.o $(OBJ)fitsxntuple.o
    66        rm -f $(LIB)libFitsIOServer.a
    7 $(LIB)libFitsIOServer.a : $(OBJ)fabtcolread.o $(OBJ)fabtwriter.o $(OBJ)fbtntintf.o $(OBJ)fitsautoreader.o $(OBJ)fitsbntbllineRW.o $(OBJ)fitsfile.o $(OBJ)fitslocalmap.o $(OBJ)fitsntuple.o $(OBJ)fitsspherehealpix.o $(OBJ)fitstarray.o $(OBJ)fitsxntuple.o
     7$(LIB)libFitsIOServer.a : $(OBJ)fabtcolread.o $(OBJ)fabtwriter.o $(OBJ)fboloread.o $(OBJ)fbtntintf.o $(OBJ)fitsautoreader.o $(OBJ)fitsbntbllineRW.o $(OBJ)fitsfile.o $(OBJ)fitslocalmap.o $(OBJ)fitsntuple.o $(OBJ)fitsspherehealpix.o $(OBJ)fitstarray.o $(OBJ)fitsxntuple.o
    88        $(ARCXX) $(ARCXXFLAGS) $@ $?
    99ifeq ($(CXX),cxx)
     
    1111endif
    1212 
    13 $(OBJ)fabtcolread.o: fabtcolread.cc \
    14  $(INC)machdefs.h \
    15  $(INC)pexceptions.h \
    16  fabtcolread.h $(INC)anydataobj.h \
    17  $(INC)tvector.h \
    18  $(INC)tmatrix.h \
    19  $(INC)tarray.h \
    20  $(INC)basarr.h \
    21  $(INC)mutyv.h \
    22  $(INC)dvlist.h \
    23  $(INC)objfio.h \
    24  $(INC)ppersist.h \
    25  $(INC)gnumd5.h \
    26  $(INC)ndatablock.h \
    27  $(INC)utilarr.h \
    28  $(EXTINCPATH)FitsIO/fitsio.h \
    29  $(EXTINCPATH)FitsIO/longnam.h
    30 $(OBJ)fabtwriter.o: fabtwriter.cc \
    31  $(INC)machdefs.h \
    32  $(INC)pexceptions.h fabtwriter.h \
    33  $(INC)anydataobj.h \
    34  $(INC)tvector.h \
    35  $(INC)tmatrix.h \
    36  $(INC)tarray.h \
    37  $(INC)basarr.h \
    38  $(INC)mutyv.h \
    39  $(INC)dvlist.h \
    40  $(INC)objfio.h \
    41  $(INC)ppersist.h \
    42  $(INC)gnumd5.h \
    43  $(INC)ndatablock.h \
    44  $(INC)utilarr.h \
    45  $(EXTINCPATH)FitsIO/fitsio.h \
    46  $(EXTINCPATH)FitsIO/longnam.h
    47 $(OBJ)fbtntintf.o: fbtntintf.cc \
    48  $(INC)machdefs.h \
    49  $(INC)pexceptions.h fbtntintf.h \
    50  $(INC)anydataobj.h \
    51  $(INC)ntupintf.h \
    52  $(EXTINCPATH)FitsIO/fitsio.h \
    53  $(EXTINCPATH)FitsIO/longnam.h
     13$(OBJ)fabtcolread.o: fabtcolread.cc $(INC)machdefs.h \
     14  $(INC)pexceptions.h fabtcolread.h \
     15  $(INC)anydataobj.h \
     16  $(INC)tvector.h \
     17  $(INC)tmatrix.h \
     18  $(INC)tarray.h \
     19  $(INC)basarr.h \
     20  $(INC)mutyv.h \
     21  $(INC)dvlist.h \
     22  $(INC)objfio.h \
     23  $(INC)ppersist.h \
     24  $(INC)gnumd5.h \
     25  $(INC)ndatablock.h \
     26  $(INC)utilarr.h \
     27  $(EXTINCPATH)FitsIO/fitsio.h \
     28  $(EXTINCPATH)FitsIO/longnam.h
     29$(OBJ)fabtwriter.o: fabtwriter.cc $(INC)machdefs.h \
     30  $(INC)pexceptions.h fabtwriter.h \
     31  $(INC)anydataobj.h \
     32  $(INC)tvector.h \
     33  $(INC)tmatrix.h \
     34  $(INC)tarray.h \
     35  $(INC)basarr.h \
     36  $(INC)mutyv.h \
     37  $(INC)dvlist.h \
     38  $(INC)objfio.h \
     39  $(INC)ppersist.h \
     40  $(INC)gnumd5.h \
     41  $(INC)ndatablock.h \
     42  $(INC)utilarr.h \
     43  $(EXTINCPATH)FitsIO/fitsio.h \
     44  $(EXTINCPATH)FitsIO/longnam.h
     45$(OBJ)fboloread.o: fboloread.cc $(INC)machdefs.h \
     46  $(INC)pexceptions.h fboloread.h \
     47  $(INC)anydataobj.h \
     48  $(INC)tvector.h \
     49  $(INC)tmatrix.h \
     50  $(INC)tarray.h \
     51  $(INC)basarr.h \
     52  $(INC)mutyv.h \
     53  $(INC)dvlist.h \
     54  $(INC)objfio.h \
     55  $(INC)ppersist.h \
     56  $(INC)gnumd5.h \
     57  $(INC)ndatablock.h \
     58  $(INC)utilarr.h fabtcolread.h \
     59  $(EXTINCPATH)FitsIO/fitsio.h \
     60  $(EXTINCPATH)FitsIO/longnam.h
     61$(OBJ)fbtntintf.o: fbtntintf.cc $(INC)machdefs.h \
     62  $(INC)pexceptions.h fbtntintf.h \
     63  $(INC)anydataobj.h \
     64  $(INC)ntupintf.h \
     65  $(EXTINCPATH)FitsIO/fitsio.h \
     66  $(EXTINCPATH)FitsIO/longnam.h
    5467$(OBJ)fitsautoreader.o: fitsautoreader.cc \
    55  $(INC)pexceptions.h \
    56  $(INC)machdefs.h \
    57  fitsautoreader.h \
    58  $(INC)anydataobj.h fitsfile.h \
    59  $(INC)ndatablock.h \
    60  $(INC)dvlist.h \
    61  $(INC)objfio.h \
    62  $(INC)ppersist.h \
    63  $(INC)gnumd5.h \
    64  $(INC)mutyv.h \
    65  $(EXTINCPATH)FitsIO/fitsio.h \
    66  $(EXTINCPATH)FitsIO/longnam.h fitstarray.h \
    67  $(INC)tarray.h \
    68  $(INC)basarr.h \
    69  $(INC)utilarr.h \
    70  fitsspherehealpix.h \
    71  $(INC)spherehealpix.h \
    72  $(INC)sphericalmap.h \
    73  $(INC)smathconst.h \
    74  $(INC)pixelmap.h \
    75  $(INC)spherepos.h \
    76  $(INC)unitvector.h \
    77  $(INC)vector3d.h \
    78  $(INC)longlat.h \
    79  $(INC)utilgeom.h \
    80  $(INC)tvector.h \
    81  $(INC)tmatrix.h \
    82  $(INC)HEALPixUtils.h \
    83  fitsntuple.h $(INC)ntuple.h \
    84  $(INC)ntupintf.h fitsxntuple.h \
    85  $(INC)xntuple.h fitslocalmap.h \
    86  $(INC)localmap.h
     68  $(INC)pexceptions.h \
     69  $(INC)machdefs.h fitsautoreader.h \
     70  $(INC)anydataobj.h fitsfile.h \
     71  $(INC)ndatablock.h \
     72  $(INC)dvlist.h \
     73  $(INC)objfio.h \
     74  $(INC)ppersist.h \
     75  $(INC)gnumd5.h \
     76  $(INC)mutyv.h \
     77  $(EXTINCPATH)FitsIO/fitsio.h \
     78  $(EXTINCPATH)FitsIO/longnam.h fitstarray.h \
     79  $(INC)tarray.h \
     80  $(INC)basarr.h \
     81  $(INC)utilarr.h fitsspherehealpix.h \
     82  $(INC)spherehealpix.h \
     83  $(INC)sphericalmap.h \
     84  $(INC)smathconst.h \
     85  $(INC)pixelmap.h \
     86  $(INC)spherepos.h \
     87  $(INC)unitvector.h \
     88  $(INC)vector3d.h \
     89  $(INC)longlat.h \
     90  $(INC)utilgeom.h \
     91  $(INC)tvector.h \
     92  $(INC)tmatrix.h \
     93  $(INC)HEALPixUtils.h fitsntuple.h \
     94  $(INC)ntuple.h \
     95  $(INC)ntupintf.h fitsxntuple.h \
     96  $(INC)xntuple.h fitslocalmap.h \
     97  $(INC)localmap.h
    8798$(OBJ)fitsbntbllineRW.o: fitsbntbllineRW.cc \
    88  $(INC)pexceptions.h \
    89  $(INC)machdefs.h \
    90  fitsbntbllineRW.h $(INC)dvlist.h \
    91  $(INC)objfio.h \
    92  $(INC)anydataobj.h \
    93  $(INC)ppersist.h \
    94  $(INC)gnumd5.h \
    95  $(INC)mutyv.h fitsfile.h \
    96  $(INC)ndatablock.h \
    97  $(EXTINCPATH)FitsIO/fitsio.h \
    98  $(EXTINCPATH)FitsIO/longnam.h \
    99  $(INC)utils.h
    100 $(OBJ)fitsfile.o: fitsfile.cc \
    101  $(INC)machdefs.h fitsfile.h \
    102  $(INC)ndatablock.h \
    103  $(INC)anydataobj.h \
    104  $(INC)dvlist.h \
    105  $(INC)objfio.h \
    106  $(INC)ppersist.h \
    107  $(INC)pexceptions.h \
    108  $(INC)gnumd5.h \
    109  $(INC)mutyv.h \
    110  $(EXTINCPATH)FitsIO/fitsio.h \
    111  $(EXTINCPATH)FitsIO/longnam.h \
    112  $(INC)strutil.h \
    113  fitsspherehealpix.h \
    114  $(INC)spherehealpix.h \
    115  $(INC)sphericalmap.h \
    116  $(INC)smathconst.h \
    117  $(INC)pixelmap.h \
    118  $(INC)spherepos.h \
    119  $(INC)unitvector.h \
    120  $(INC)vector3d.h \
    121  $(INC)longlat.h \
    122  $(INC)utilgeom.h \
    123  $(INC)tvector.h \
    124  $(INC)tmatrix.h \
    125  $(INC)tarray.h \
    126  $(INC)basarr.h \
    127  $(INC)utilarr.h \
    128  $(INC)HEALPixUtils.h
     99  $(INC)pexceptions.h \
     100  $(INC)machdefs.h fitsbntbllineRW.h \
     101  $(INC)dvlist.h \
     102  $(INC)objfio.h \
     103  $(INC)anydataobj.h \
     104  $(INC)ppersist.h \
     105  $(INC)gnumd5.h \
     106  $(INC)mutyv.h fitsfile.h \
     107  $(INC)ndatablock.h \
     108  $(EXTINCPATH)FitsIO/fitsio.h \
     109  $(EXTINCPATH)FitsIO/longnam.h \
     110  $(INC)utils.h
     111$(OBJ)fitsfile.o: fitsfile.cc $(INC)machdefs.h \
     112  fitsfile.h $(INC)ndatablock.h \
     113  $(INC)anydataobj.h \
     114  $(INC)dvlist.h \
     115  $(INC)objfio.h \
     116  $(INC)ppersist.h \
     117  $(INC)pexceptions.h \
     118  $(INC)gnumd5.h \
     119  $(INC)mutyv.h \
     120  $(EXTINCPATH)FitsIO/fitsio.h \
     121  $(EXTINCPATH)FitsIO/longnam.h \
     122  $(INC)strutil.h fitsspherehealpix.h \
     123  $(INC)spherehealpix.h \
     124  $(INC)sphericalmap.h \
     125  $(INC)smathconst.h \
     126  $(INC)pixelmap.h \
     127  $(INC)spherepos.h \
     128  $(INC)unitvector.h \
     129  $(INC)vector3d.h \
     130  $(INC)longlat.h \
     131  $(INC)utilgeom.h \
     132  $(INC)tvector.h \
     133  $(INC)tmatrix.h \
     134  $(INC)tarray.h \
     135  $(INC)basarr.h \
     136  $(INC)utilarr.h \
     137  $(INC)HEALPixUtils.h
    129138$(OBJ)fitslocalmap.o: fitslocalmap.cc \
    130  $(INC)machdefs.h fitslocalmap.h \
    131  $(INC)pexceptions.h \
    132  $(INC)localmap.h \
    133  $(INC)pixelmap.h \
    134  $(INC)ppersist.h \
    135  $(INC)gnumd5.h \
    136  $(INC)dvlist.h \
    137  $(INC)objfio.h \
    138  $(INC)anydataobj.h \
    139  $(INC)mutyv.h \
    140  $(INC)spherepos.h \
    141  $(INC)unitvector.h \
    142  $(INC)vector3d.h \
    143  $(INC)longlat.h \
    144  $(INC)utilgeom.h \
    145  $(INC)sphericalmap.h \
    146  $(INC)smathconst.h \
    147  $(INC)tvector.h \
    148  $(INC)tmatrix.h \
    149  $(INC)tarray.h \
    150  $(INC)basarr.h \
    151  $(INC)ndatablock.h \
    152  $(INC)utilarr.h fitsfile.h \
    153  $(EXTINCPATH)FitsIO/fitsio.h \
    154  $(EXTINCPATH)FitsIO/longnam.h
     139  $(INC)machdefs.h fitslocalmap.h \
     140  $(INC)pexceptions.h \
     141  $(INC)localmap.h \
     142  $(INC)pixelmap.h \
     143  $(INC)ppersist.h \
     144  $(INC)gnumd5.h \
     145  $(INC)dvlist.h \
     146  $(INC)objfio.h \
     147  $(INC)anydataobj.h \
     148  $(INC)mutyv.h \
     149  $(INC)spherepos.h \
     150  $(INC)unitvector.h \
     151  $(INC)vector3d.h \
     152  $(INC)longlat.h \
     153  $(INC)utilgeom.h \
     154  $(INC)sphericalmap.h \
     155  $(INC)smathconst.h \
     156  $(INC)tvector.h \
     157  $(INC)tmatrix.h \
     158  $(INC)tarray.h \
     159  $(INC)basarr.h \
     160  $(INC)ndatablock.h \
     161  $(INC)utilarr.h fitsfile.h \
     162  $(EXTINCPATH)FitsIO/fitsio.h \
     163  $(EXTINCPATH)FitsIO/longnam.h
    155164$(OBJ)fitsntuple.o: fitsntuple.cc \
    156  $(INC)pexceptions.h \
    157  $(INC)machdefs.h fitsntuple.h \
    158  $(INC)ntuple.h \
    159  $(INC)objfio.h \
    160  $(INC)anydataobj.h \
    161  $(INC)ppersist.h \
    162  $(INC)gnumd5.h \
    163  $(INC)ntupintf.h \
    164  $(INC)dvlist.h \
    165  $(INC)mutyv.h fitsfile.h \
    166  $(INC)ndatablock.h \
    167  $(EXTINCPATH)FitsIO/fitsio.h \
    168  $(EXTINCPATH)FitsIO/longnam.h
     165  $(INC)pexceptions.h \
     166  $(INC)machdefs.h fitsntuple.h \
     167  $(INC)ntuple.h \
     168  $(INC)objfio.h \
     169  $(INC)anydataobj.h \
     170  $(INC)ppersist.h \
     171  $(INC)gnumd5.h \
     172  $(INC)ntupintf.h \
     173  $(INC)dvlist.h \
     174  $(INC)mutyv.h fitsfile.h \
     175  $(INC)ndatablock.h \
     176  $(EXTINCPATH)FitsIO/fitsio.h \
     177  $(EXTINCPATH)FitsIO/longnam.h
    169178$(OBJ)fitsspherehealpix.o: fitsspherehealpix.cc \
    170  $(INC)pexceptions.h \
    171  $(INC)machdefs.h \
    172  fitsspherehealpix.h \
    173  $(INC)spherehealpix.h \
    174  $(INC)sphericalmap.h \
    175  $(INC)smathconst.h \
    176  $(INC)pixelmap.h \
    177  $(INC)ppersist.h \
    178  $(INC)gnumd5.h \
    179  $(INC)dvlist.h \
    180  $(INC)objfio.h \
    181  $(INC)anydataobj.h \
    182  $(INC)mutyv.h \
    183  $(INC)spherepos.h \
    184  $(INC)unitvector.h \
    185  $(INC)vector3d.h \
    186  $(INC)longlat.h \
    187  $(INC)utilgeom.h \
    188  $(INC)tvector.h \
    189  $(INC)tmatrix.h \
    190  $(INC)tarray.h \
    191  $(INC)basarr.h \
    192  $(INC)ndatablock.h \
    193  $(INC)utilarr.h \
    194  $(INC)HEALPixUtils.h fitsfile.h \
    195  $(EXTINCPATH)FitsIO/fitsio.h \
    196  $(EXTINCPATH)FitsIO/longnam.h fitstarray.h
    197 $(OBJ)fitstarray.o: fitstarray.cc \
    198  $(INC)machdefs.h \
    199  $(INC)pexceptions.h fitstarray.h \
    200  $(INC)tarray.h \
    201  $(INC)basarr.h \
    202  $(INC)anydataobj.h \
    203  $(INC)mutyv.h \
    204  $(INC)dvlist.h \
    205  $(INC)objfio.h \
    206  $(INC)ppersist.h \
    207  $(INC)gnumd5.h \
    208  $(INC)ndatablock.h \
    209  $(INC)utilarr.h fitsfile.h \
    210  $(EXTINCPATH)FitsIO/fitsio.h \
    211  $(EXTINCPATH)FitsIO/longnam.h
     179  $(INC)pexceptions.h \
     180  $(INC)machdefs.h fitsspherehealpix.h \
     181  $(INC)spherehealpix.h \
     182  $(INC)sphericalmap.h \
     183  $(INC)smathconst.h \
     184  $(INC)pixelmap.h \
     185  $(INC)ppersist.h \
     186  $(INC)gnumd5.h \
     187  $(INC)dvlist.h \
     188  $(INC)objfio.h \
     189  $(INC)anydataobj.h \
     190  $(INC)mutyv.h \
     191  $(INC)spherepos.h \
     192  $(INC)unitvector.h \
     193  $(INC)vector3d.h \
     194  $(INC)longlat.h \
     195  $(INC)utilgeom.h \
     196  $(INC)tvector.h \
     197  $(INC)tmatrix.h \
     198  $(INC)tarray.h \
     199  $(INC)basarr.h \
     200  $(INC)ndatablock.h \
     201  $(INC)utilarr.h \
     202  $(INC)HEALPixUtils.h fitsfile.h \
     203  $(EXTINCPATH)FitsIO/fitsio.h \
     204  $(EXTINCPATH)FitsIO/longnam.h fitstarray.h
     205$(OBJ)fitstarray.o: fitstarray.cc $(INC)machdefs.h \
     206  $(INC)pexceptions.h fitstarray.h \
     207  $(INC)tarray.h \
     208  $(INC)basarr.h \
     209  $(INC)anydataobj.h \
     210  $(INC)mutyv.h \
     211  $(INC)dvlist.h \
     212  $(INC)objfio.h \
     213  $(INC)ppersist.h \
     214  $(INC)gnumd5.h \
     215  $(INC)ndatablock.h \
     216  $(INC)utilarr.h fitsfile.h \
     217  $(EXTINCPATH)FitsIO/fitsio.h \
     218  $(EXTINCPATH)FitsIO/longnam.h
    212219$(OBJ)fitsxntuple.o: fitsxntuple.cc \
    213  $(INC)pexceptions.h \
    214  $(INC)machdefs.h fitsxntuple.h \
    215  $(INC)xntuple.h \
    216  $(INC)ntupintf.h \
    217  $(INC)ppersist.h \
    218  $(INC)gnumd5.h \
    219  $(INC)dvlist.h \
    220  $(INC)objfio.h \
    221  $(INC)anydataobj.h \
    222  $(INC)mutyv.h fitsfile.h \
    223  $(INC)ndatablock.h \
    224  $(EXTINCPATH)FitsIO/fitsio.h \
    225  $(EXTINCPATH)FitsIO/longnam.h
     220  $(INC)pexceptions.h \
     221  $(INC)machdefs.h fitsxntuple.h \
     222  $(INC)xntuple.h \
     223  $(INC)ntupintf.h \
     224  $(INC)ppersist.h \
     225  $(INC)gnumd5.h \
     226  $(INC)dvlist.h \
     227  $(INC)objfio.h \
     228  $(INC)anydataobj.h \
     229  $(INC)mutyv.h fitsfile.h \
     230  $(INC)ndatablock.h \
     231  $(EXTINCPATH)FitsIO/fitsio.h \
     232  $(EXTINCPATH)FitsIO/longnam.h
  • trunk/SophyaExt/FitsIOServer/fabtcolread.cc

    r1659 r1660  
    187187
    188188 // Get column number
    189  char labelcol[256];
     189 char labelcol[128];
    190190 if(ColLabel.size() > 0) {
    191191   strcpy(labelcol,ColLabel.c_str());
     
    209209 }
    210210 if(DbgLevel>1) cout<<"...Init ColTypeCode="<<ColTypeCode<<endl;
    211  if(ColTypeCode==TSTRING || ColTypeCode==TCOMPLEX ||  ColTypeCode==TDBLCOMPLEX) {
     211 if(ColTypeCode==TSTRING || ColTypeCode==TCOMPLEX ||  ColTypeCode==TDBLCOMPLEX
     212                         || ColTypeCode<0 ) {
    212213   Delete();
    213214   throw ParmError("FitsABTColRead::Init: Selected column is not Numerical\n");
  • trunk/SophyaExt/FitsIOServer/fabtwriter.cc

    r1659 r1660  
    1515  FitsABTWriter fbtw(fitswrit,BINARY_TBL);
    1616  fbtw.SetExtName("MY_OWN_EXTENSION");
    17   fbtw.AddCol("vars",TSHORT,"","km");       // col=0
    18   fbtw.AddCol("vars2",TSHORT,"","km");      // col=1
    19   fbtw.AddCol("varl",TINT32BIT,"","Degre"); // col=2
    20   fbtw.AddCol("varf",TFLOAT,"","");         // col=3
    21   fbtw.AddCol("vard",TDOUBLE,"","arcmin");  // col=4
     17  fbtw.AddCol("vars",NULL,"km",TSHORT);       // col=0
     18  fbtw.AddCol("vars2",NULL,"km",TSHORT);      // col=1
     19  fbtw.AddCol("varl",NULL,"Degre",TINT32BIT); // col=2
     20  fbtw.AddCol("varf",NULL,"",TFLOAT);         // col=3
     21  fbtw.AddCol("vard","","arcmin",TDOUBLE);    // col=4
    2222  fbtw.SetDebug(3);
    2323  for(long i=0;i<1000;i++) {
     
    119119  Add a new column to the FITS table
    120120  \param label : column label
    121   \param datatype : TSHORT TINT32BIT TFLOAT or TDOUBLE
    122   \param tform : fits tform definition
    123          (can be automatically set if BINARY_TBL and tform="")
     121  \param tform : fits tform definition ("1I","1J","1E","1J",...)
     122         (can be automatically set as "datatype"
     123          if BINARY_TBL and tform="" or tform=NULL)
    124124  \param tunit : fits tunit definition (optional)
     125  \param datatype : TBYTE TSHORT TINT32BIT TLONG TFLOAT TDOUBLE
     126                    TUSHORT TULONG. That parameter is only use in case
     127                    of a BINARY_TBL table when tform is not defined).
    125128  \return The number of the new added column in the table.
    126129  \warning col = [0,ncol-1]
    127130*/
    128 int FitsABTWriter::addcol(const char* label,int datatype
    129                          ,const char* tform,const char* tunit)
     131int FitsABTWriter::addcol(const char* label,const char* tform
     132                         ,const char* tunit,int datatype)
    130133{
    131134  if(!FirstTime)
    132135    throw AllocationError("FitsABTWriter::addcol: table already created\n");
    133 
    134  if(  datatype!=TSHORT && datatype!=TINT32BIT
    135    && datatype!=TFLOAT && datatype!=TDOUBLE )
    136    throw ParmError("FitsABTWriter::addcol: datatype not allowed\n");
    137136 
    138  Label.push_back(label);
    139  DataType.push_back(datatype);
    140  // Gestion auto du tform par defaut pour les tables binaires
    141  if(HduType==BINARY_TBL && strlen(tform)<=0) {
    142    char str[16];
    143    if(datatype==TSHORT)         strcpy(str,"1I");
     137 // Gestion auto du tform pour les tables binaires avec le datatype (si non-definie)
     138 bool tformauto = false;
     139 if(HduType==BINARY_TBL) {
     140   if(tform==NULL)      tformauto = true;
     141   if(strlen(tform)<=0) tformauto = true;
     142 }
     143 if(tformauto) {
     144   char str[8];
     145   if(datatype==TBYTE)          strcpy(str,"1B");
     146   else if(datatype==TSHORT)    strcpy(str,"1I");
    144147   else if(datatype==TINT32BIT) strcpy(str,"1J");
     148   else if(datatype==TLONG)     strcpy(str,"1J");
    145149   else if(datatype==TFLOAT)    strcpy(str,"1E");
    146150   else if(datatype==TDOUBLE)   strcpy(str,"1D");
     151   else if(datatype==TUSHORT)   strcpy(str,"1U");
     152   else if(datatype==TULONG)    strcpy(str,"1V");
     153   else
     154     throw ParmError("FitsABTWriter::addcol: datatype not allowed\n");
    147155   TForm.push_back(str);
    148  } else TForm.push_back(tform);
    149  TUnit.push_back(tunit);
     156 } else {
     157   if(tform) TForm.push_back(tform); else TForm.push_back("");
     158   datatype = 0;
     159 }
     160 Label.push_back(label);
     161 if(tunit) TUnit.push_back(tunit); else TUnit.push_back("");
    150162
    151163 int n = (int) Label.size() -1;
     
    153165 if(DbgLevel)
    154166   cout<<"FitsABTWriter::addcol["<<n<<"] Label="<<Label[n]
    155        <<" datatype="<<datatype
    156167       <<" TForm="<<TForm[n]
    157        <<" TUnit="<<TUnit[n]<<endl;
     168       <<" TUnit="<<TUnit[n]
     169       <<" datatype="<<datatype<<endl;
    158170
    159171 return n;
     
    220232  \verbatim
    221233  WARNING: suppose that the column has be defined to be TSHORT
    222            and suppose that you wanted to write a double value
    223    - If you write dummy.Write(col,row,(short(val))
    224        you call the Write(int,long,short) routine and
     234           and suppose that you wanted to write a double value "val"
     235   - If you write dummy.Write(col,row,(short)(val))
     236       the Write(int,long,short) routine is called and
    225237       the cast is performed by the C++ language.
    226238   - If you write dummy.Write(col,row,val) where val is double
    227        you call theWrite(int,long,double) routine and
     239       the Write(int,long,double) routine is called and
    228240       the cast is performed by the cfistio package.
    229241  \endverbatim
     
    311323
    312324//////////////////////////////////////////////////////////////
    313 void FitsABTWriter::printerrorwrite(char* type,int col,long row,int sta)
     325void FitsABTWriter::printerrorwrite(const char* type,int col,long row,int sta)
    314326{
    315327 if(sta==NUM_OVERFLOW) {NOverFlow++; return;}
  • trunk/SophyaExt/FitsIOServer/fabtwriter.h

    r1657 r1660  
    2424
    2525  //! Add a new column to the FITS table and return its number (see addcol).
    26   inline int AddCol(string label,int datatype=TDOUBLE
    27                    ,string tform=string(""),string tunit=string(""))
    28      {return addcol(label.c_str(),datatype,tform.c_str(),tunit.c_str());}
     26  inline int AddCol(string label,string tform=string("")
     27                   ,string tunit=string(""),int datatype=TDOUBLE)
     28     {return addcol(label.c_str(),tform.c_str(),tunit.c_str(),datatype);}
    2929  //! Add a new column to the FITS table and return its number (see addcol).
    30   inline int AddCol(const char* label,int datatype=TDOUBLE
    31                    ,const char* tform="",const char* tunit="")
    32      {return addcol(label,datatype,tform,tunit);}
     30  inline int AddCol(const char* label,const char* tform=""
     31                   ,const char* tunit="",int datatype=TDOUBLE)
     32     {return addcol(label,tform,tunit,datatype);}
    3333
    3434  //! Set the FITS table extension name
     
    5151protected:
    5252  void createfits(const char *cfname,int hdutype,int lp);
    53   int addcol(const char* label,int datatype
    54             ,const char* tform,const char* tunit);
     53  int addcol(const char* label,const char* tform
     54            ,const char* tunit,int datatype);
    5555  void createtbl(void);
    56   void printerrorwrite(char* type,int col,long row,int sta);
     56  void printerrorwrite(const char* type,int col,long row,int sta);
    5757  void printerror(int sta) const;
    5858
     
    6363  bool FirstTime;
    6464  vector<string> Label;
    65   vector<int> DataType;
    6665  vector<string> TForm;
    6766  vector<string> TUnit;
  • trunk/SophyaExt/FitsIOServer/objlist.list

    r1654 r1660  
    11fabtcolread.o
    22fabtwriter.o
     3fboloread.o
    34fbtntintf.o
    45fitsautoreader.o
Note: See TracChangeset for help on using the changeset viewer.