Art's archive


10-09-2008

for (1 to n) {

}

fits_get_img_param() wants to read a couple of keywords from the header. fits_write_img() wants to see and write data. On each iteration, the fits_get_img_param() call will cause a read miss - the data that you want aren't in a buffer because cfitsio has already flushed that buffer. So there must be a file seek followed by a read. The fits_write_img() call will use up all the buffers so that the next fits_get_img_param() call will be a miss again. BTW, fits_write_img() does some reading as well as writing, presumably for the same reason that it needs more buffers than are available. Unlike the fits_get_img_param() call, I haven't traced exactly when this happens - doing that would be a bit time consuming, and I think the issue is the same as with the fits_get_img_param() call. To verify my suspicions, I did the first call 2x in a row:

fits_get_img_param(fileptr, ...); fits_get_img_param(fileptr, ...);

The first time, there was a read miss (and hence disk read). But the second time, there wasn't. That is because with these calls, not all buffers get used up (all the data needed by this call lives in one record, and that is easily contained in a buffer, whereas with fits_write_img(), a large number of buffers needs to be used, even on my test which was 192 x 192 images).


10-02-2008


09-25-2008


09-18-2008


09-11-2008


09-04-2008


08-28-2008


08-21-2008


08-14-2008


08-07-2008


07-31-2008


07-24-2008


07-17-2008


07-10-2008


07-03-2008


06-26-2008


06-19-2008


06-12-2008


06-05-2008


05-29-2008


05-22-2008


05-15-2008


05-08-2008


05-01-2008


04-24-2008


04-17-2008


04-10-2008


04-03-2008


03-27-2008






JsocWiki: ArtsProgress (last edited 2008-10-09 08:19:17 by ArtAmezcua)