Open sbailey opened 4 years ago
I don't think this particular things works (io.BytesIO(data)) , but I think cfitsio can read from memory. There may be a way to make it happen
Do we need to pass down some emulated interface to a C file? That might be a tall order.
Yeah, I'm not saying I know how to do it.
https://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/node91.html
This looks annoying and not fun.
there is also mem://
here: https://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/node85.html
Thanks. My interest for this in-memory reading isn't urgent, but I just wanted to check if I was missing some pre-existing mem:// like trick to make it work analogous to the writing case. FWIW, use cases I was considering:
working on a filesystem with good bandwidth but poor/variable latency on individual I/O operations such that doing a single big read and then doing the parsing / seek / etc. in memory might be better performance. Maybe
So cfitsio does a lot of buffering internally. For this specific purpose, you may find that you don't need to buffer in memory yourself as well.
Does fitsio support the ability to read from memory instead of disk?
This question is the inverse of #270, which documents how to write to memory instead of disk.
e.g. I'm looking for something like
equivalent to
Is this possible with fitsio?