-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] earthaccess.download gets different data than curl from an OPeNDAP service #887
Comments
This is certainly weird. It must be OPeNDAP conditionally compressing the data based on headers or something like that? waves hands I don't think this is intended. |
I had originally suspected that something was up with the OPeNDAP service, but LAADS user services response indicates they do not compress on their end. https://forum.earthdata.nasa.gov/viewtopic.php?t=6247 |
I think we need to debug and compare the HTTP requests! Then we can probably force this to occur with |
earthaccess/earthaccess/store.py Lines 679 to 682 in ffbfddd
Response.content instead of Response.raw but that'd impact the memory usage cap strategy.
|
The note in this section of the docs actually provides a better explanation of what's causing this issue - https://docs.python-requests.org/en/latest/user/quickstart/#raw-response-content |
Thanks @maxrjones! The practice recommended in those docs is to use Response.iter_content instead of raw, which also lets us set a chunk size. Any opposition to testing that switch? |
Good find @maxrjones , thank you!
🚀 🚀 🚀 |
Thanks @itcarroll for the implementation! |
Is this issue already tracked somewhere, or is this a new report?
Current Behavior
Reporting an issue noted by @tsnow03 on the CryoCloud slack.
Giving
earthaccess.download
a URL for the LAADS OPeNDAP service (in this case, one that returns a NetCDF4 formatted version of the archival HDF-EOS file) returns a gzipped file. Usingcurl
on the same URL returns an uncompressed file. If it is intended thatearthaccess.download
get a compressed file, then some notification should be given. If not ...Expected Behavior
I expect
earthaccess.download
to download a file identical to whatcurl
downloads for a given URL.Steps To Reproduce
Show that
earthaccess
writes a compressed file:That looks to me like a gzipped file, and passing the file through gunzip does allow it to be opened with
netCDF4
.On the other hand,
curl
writes an uncompressed HDF5 file.Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: