Commit ad67010b authored by Emmanuel Bertin's avatar Emmanuel Bertin
Browse files

Included Chiara's MissFITS fix in fitspick().

parent 2e1330bb
...@@ -181,7 +181,7 @@ OUTPUT RETURN_OK if something was found, RETURN_ERROR otherwise. ...@@ -181,7 +181,7 @@ OUTPUT RETURN_OK if something was found, RETURN_ERROR otherwise.
NOTES -. NOTES -.
AUTHOR E. Bertin (IAP), AUTHOR E. Bertin (IAP),
E.R. Deul - Handling of NaN E.R. Deul - Handling of NaN
VERSION 04/06/2007 VERSION 18/05/2009
***/ ***/
int fitspick(char *fitsline, char *keyword, void *ptr, h_type *htype, int fitspick(char *fitsline, char *keyword, void *ptr, h_type *htype,
t_type *ttype, char *comment) t_type *ttype, char *comment)
...@@ -252,20 +252,20 @@ int fitspick(char *fitsline, char *keyword, void *ptr, h_type *htype, ...@@ -252,20 +252,20 @@ int fitspick(char *fitsline, char *keyword, void *ptr, h_type *htype,
{ {
for (i=j; i<80 && fitsline[i]!=(char)'/' && fitsline[i]!=(char)'.'; i++); for (i=j; i<80 && fitsline[i]!=(char)'/' && fitsline[i]!=(char)'.'; i++);
/*-- Handle floats*/ /*-- Handle floats*/
if (fitsline[i]==(char)'.') if (i==80 || fitsline[i]!=(char)'.')
{
fixexponent(fitsline);
*((double *)ptr) = atof(fitsline+j);
*htype = H_EXPO;
*ttype = T_DOUBLE;
}
else
/*---- Handle ints*/ /*---- Handle ints*/
{ {
*((int *)ptr) = atoi(fitsline+j); *((int *)ptr) = atoi(fitsline+j);
*htype = H_INT; *htype = H_INT;
*ttype = T_LONG; *ttype = T_LONG;
} }
else
{
fixexponent(fitsline);
*((double *)ptr) = atof(fitsline+j);
*htype = H_EXPO;
*ttype = T_DOUBLE;
}
} }
/*Store comment if it is found*/ /*Store comment if it is found*/
...@@ -340,7 +340,6 @@ int fitsread(char *fitsbuf, char *keyword, void *ptr, h_type htype, ...@@ -340,7 +340,6 @@ int fitsread(char *fitsbuf, char *keyword, void *ptr, h_type htype,
sscanf(str+10, " %lf", (double *)ptr); sscanf(str+10, " %lf", (double *)ptr);
else else
sscanf(str+10, " %f", (float *)ptr); sscanf(str+10, " %f", (float *)ptr);
printf("%80s\n", str);
break; break;
case H_BOOL: sscanf(str+10, "%1s", s); case H_BOOL: sscanf(str+10, "%1s", s);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment