"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "getcolb.c" between
cfitsio-3.49.tar.gz and cfitsio-4.0.0.tar.gz

About: CFITSIO is a library of C and Fortran subroutines for reading and writing data files in the FITS (Flexible Image Transport System) data format.

getcolb.c  (cfitsio-3.49):getcolb.c  (cfitsio-4.0.0)
skipping to change at line 665 skipping to change at line 665
images. images.
The output array of values will be converted from the datatype of the column The output array of values will be converted from the datatype of the column
and will be scaled by the FITS TSCALn and TZEROn values if necessary. and will be scaled by the FITS TSCALn and TZEROn values if necessary.
*/ */
{ {
double scale, zero, power = 1., dtemp; double scale, zero, power = 1., dtemp;
int tcode, maxelem2, hdutype, xcode, decimals; int tcode, maxelem2, hdutype, xcode, decimals;
long twidth, incre, ntodo; long twidth, incre, ntodo;
long ii, xwidth; long ii, xwidth;
int convert, nulcheck, readcheck = 0; int convert, nulcheck, readcheck = 16; /* see note below on readcheck */
LONGLONG repeat, startpos, elemnum, readptr, tnull; LONGLONG repeat, startpos, elemnum, readptr, tnull;
LONGLONG rowlen, rownum, remain, next, rowincre, maxelem; LONGLONG rowlen, rownum, remain, next, rowincre, maxelem;
char tform[20]; char tform[20];
char message[FLEN_ERRMSG]; char message[FLEN_ERRMSG];
char snull[20]; /* the FITS null value if reading from ASCII table */ char snull[20]; /* the FITS null value if reading from ASCII table */
double cbuff[DBUFFSIZE / sizeof(double)]; /* align cbuff on word boundary */ double cbuff[DBUFFSIZE / sizeof(double)]; /* align cbuff on word boundary */
void *buffer; void *buffer;
union u_tag { union u_tag {
skipping to change at line 695 skipping to change at line 695
if (anynul) if (anynul)
*anynul = 0; *anynul = 0;
if (nultyp == 2) if (nultyp == 2)
memset(nularray, 0, (size_t) nelem); /* initialize nullarray */ memset(nularray, 0, (size_t) nelem); /* initialize nullarray */
/*---------------------------------------------------*/ /*---------------------------------------------------*/
/* Check input and get parameters about the column: */ /* Check input and get parameters about the column: */
/*---------------------------------------------------*/ /*---------------------------------------------------*/
if (elemincre < 0) if (elemincre < 0)
readcheck = -1; /* don't do range checking in this case */ readcheck -= 1; /* don't do range checking in this case */
/* IMPORTANT NOTE: that the special case of using this subroutine
to read bytes from a character column are handled internally
by the call to ffgcprll() below. It will adjust the effective
*tcode, repeats, etc, to appear as a TBYTE column. */
/* Note that readcheck = 16 is equivalent to readcheck = 0
and readcheck = 15 is equivalent to readcheck = -1,
but either of those settings allow TSTRINGS to be
treated as TBYTE vectors, but with full error checking */
ffgcprll( fptr, colnum, firstrow, firstelem, nelem, readcheck, &scale, &zero , ffgcprll( fptr, colnum, firstrow, firstelem, nelem, readcheck, &scale, &zero ,
tform, &twidth, &tcode, &maxelem2, &startpos, &elemnum, &incre, tform, &twidth, &tcode, &maxelem2, &startpos, &elemnum, &incre,
&repeat, &rowlen, &hdutype, &tnull, snull, status); &repeat, &rowlen, &hdutype, &tnull, snull, status);
maxelem = maxelem2; maxelem = maxelem2;
/* special case */ /* special case */
if (tcode == TLOGICAL && elemincre == 1) if (tcode == TLOGICAL && elemincre == 1)
{ {
u.ucharval = nulval; u.ucharval = nulval;
ffgcll(fptr, colnum, firstrow, firstelem, nelem, nultyp, ffgcll(fptr, colnum, firstrow, firstelem, nelem, nultyp,
u.charval, (char *) array, nularray, anynul, status); u.charval, (char *) array, nularray, anynul, status);
return(*status); return(*status);
} }
if (strchr(tform,'A') != NULL)
{
if (*status == BAD_ELEM_NUM)
{
/* ignore this error message */
*status = 0;
ffcmsg(); /* clear error stack */
}
/* interpret a 'A' ASCII column as a 'B' byte column ('8A' == '8B') */
/* This is an undocumented 'feature' in CFITSIO */
/* we have to reset some of the values returned by ffgcpr */
tcode = TBYTE;
incre = 1; /* each element is 1 byte wide */
repeat = twidth; /* total no. of chars in the col */
twidth = 1; /* width of each element */
scale = 1.0; /* no scaling */
zero = 0.0;
tnull = NULL_UNDEFINED; /* don't test for nulls */
maxelem = DBUFFSIZE;
}
if (*status > 0) if (*status > 0)
return(*status); return(*status);
incre *= elemincre; /* multiply incre to just get every nth pixel */ incre *= elemincre; /* multiply incre to just get every nth pixel */
if (tcode == TSTRING && hdutype == ASCII_TBL) /* setup for ASCII tables */ if (tcode == TSTRING && hdutype == ASCII_TBL) /* setup for ASCII tables */
{ {
/* get the number of implied decimal places if no explicit decmal point */ /* get the number of implied decimal places if no explicit decmal point */
ffasfm(tform, &xcode, &xwidth, &decimals, status); ffasfm(tform, &xcode, &xwidth, &decimals, status);
for(ii = 0; ii < decimals; ii++) for(ii = 0; ii < decimals; ii++)
 End of changes. 3 change blocks. 
26 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)