You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There doesn't appear to be any way to cause AstroData to close a file that was opened with astrodata.open(). It seems that in many cases the file ends up getting closed when the ad object goes out of scope or has zero refcount or something, but it also seems like we shouldn't be relying on this.
The text was updated successfully, but these errors were encountered:
And on top of that, when using memmap, each .data array also needs a file handle to load the data when needed.
So I guess adding a .close() method would be a good idea, but currently the ad object doesn't keep a reference to the HDUList to close it. I'm not completely sure what would happen when accessing ad.data after the fie is closed though, it may depend on whether ad.data had been used or not (astropy will closes the memmap handles if there are not references to hdu.data, and since there is FitsLazyLoadable in between, I'm not sure. Also accessing a closed memmap object will segfault, so needs to be checked).
There doesn't appear to be any way to cause AstroData to close a file that was opened with astrodata.open(). It seems that in many cases the file ends up getting closed when the ad object goes out of scope or has zero refcount or something, but it also seems like we shouldn't be relying on this.
The text was updated successfully, but these errors were encountered: