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
I believe astroquery.mast should be able to download and write over an incomplete file. However, it still is corrupted/incomplete even when the code recognizes the file as incomplete. Here are the steps to re-produce.
from astroquery.mast import Observations
from astropy.io import fits
fileN = 'jw01185103001_02102_00001-seg001_nrcalong_rate.fits'
with open(fileN,'wb') as f:
f.write(b'junk')
Observations.download_file('mast:jwst/product/'+fileN)
tmpHDU = fits.open(fileN)
I get OSError: Empty or corrupt FITS file whereas I was expecting astroquery to download a new file because it detects that the cached one is incomplete.
I'm using astroquery 0.4.10.dev9927 on Python 3.12.2
The text was updated successfully, but these errors were encountered:
I was expecting astroquery to download a new file because it detects that the cached one is incomplete.
That's not how "resume download" generally works. In pretty much every http client (like wget) and also what astroquery seems to do ( https://github.com/astropy/astroquery/blob/main/astroquery/query.py#L455 ) "resume" will download only the "missing" part of the file and append it to already existing file. This way if you have 10GB file and your download crashed at last 1MB you only need to download 1MB and not whole file again.
Your "test" does not showcase a normal scenario because you put junk into the file, instead of actual prefix of the file.
I believe astroquery.mast should be able to download and write over an incomplete file. However, it still is corrupted/incomplete even when the code recognizes the file as incomplete. Here are the steps to re-produce.
I get
OSError: Empty or corrupt FITS file
whereas I was expecting astroquery to download a new file because it detects that the cached one is incomplete.I'm using astroquery 0.4.10.dev9927 on Python 3.12.2
The text was updated successfully, but these errors were encountered: