-
Notifications
You must be signed in to change notification settings - Fork 36
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
Example of using vsicurl to GUNW products #27
Comments
They seem to have detailed instructions on their page:
I plan to test this out this week. |
Once, I get the AWS credentials with the above script, both these commands work for me:
The AWS mechanism appears to be working pretty well. For awscli reference - see https://www.asf.alaska.edu/sar_datasets/sentinel-1-interferograms-beta/command-line-tools/aws-cli/ |
Some additional useful information: https://gis.stackexchange.com/questions/201831/how-to-efficiently-access-files-with-gdal-from-an-s3-bucket-using-vsis3 |
You will also have to setup an additional environment variable, if you are already an aws user and have ~/.aws with configurations setup
|
Here is a full example from material we are putting together for UNAVCO short course. Looks like there could an issue with conda's gdal installation that recognizes nc with groups as HDF5 when using vsis3 - might be good to communicate this to ASF. This has to do with detection of netcdf_mem.h when building GDAL.
|
Thanks @piyushrpt. Im tagging @asjohnston-asf and @fjmeyer and will bring up at next GRFN meeting for some advice as well.
|
Turns out this is related to them building conda packages on old kernels: userfaultfd support: no This is unlikely to change anytime soon as they plan to support older kernels. Piyush |
Thanks for the heads up. A few random comments on this thread: Much of the information on our web site under https://www.asf.alaska.edu/sar_datasets/sentinel-1-interferograms-beta/ is out of date. For example, we retired all of our v1.x products when we upgraded to v2.x products, but all of our examples still refer to files that aren't in our archive anymore. The "long term storage" sections are also obsolete; we no longer move any files to long term storage. If you prefer, you can also use After I wrote the example script I discovered requests has built-in json parsing, so you can save yourself an import: |
Last month ASF also rolled our our new "ASF Data Search" app at https://search.asf.alaska.edu/ . The old https://vertex.daac.asf.alaska.edu/ URL now redirects there. We've made it much easier to search for GUNW products, just select "S1 InSAR (BETA)" from the Dataset pulldown. |
@asjohnston-asf Thanks for info on response having inbuilt json parsing. Could you point us to an example of using /vsicurl with the right environment variables? Is it just adding AWSKey etc to the URL itself? |
Requires gdal >= v2.4.0. Chunk size isn't strictly necessary, but I've found it improves performance when accessing larger files. |
Same approach should work for any data hosted by ASF or EOSDIS, just need the netrc and cookie setup to deal with Earthdata Login. |
Thanks @asjohnston-asf . This also works ... the userfaultfd issue persists. I have opened a ticket here: conda-forge/gdal-feedstock#323
|
Thanks for fixing this @piyushrpt. Will work on capturing the changes needed to leverage this in aria-tools here: #138 |
@piyushrpt Im also getting h5 read. Do i need to increase the requirements in the file to make sure its capture as a netcdf. Running on Mac and Linux on the same issue. |
@piyushrpt @asjohnston-asf I am not able to get the GUNW products recognized as netcdf products on mac or linux using conda installed gdal. I have opened an issue ticket on the gdal-feedstock channel: conda-forge/gdal-feedstock#376 |
This has now been fixed in GDAL and should be returning the netcdf reader. See full discussion here: conda-forge/gdal-feedstock#376 (comment) Next RC1 is planned for end of April, after which testing will happen. Once a new gdal version is released conda forge GDAL will pick up and we should be able to leverage directly. @bbuzz31 do you have bandwidth for a test to confirm the reader works now?
|
@dbekaert unfortunately the highest version of Linux I have access to is 4.15 |
@bbuzz31 Tested this on opensarlabs server. Need to make a .netrc file and got succesfulle .ncdf reader being used:
|
Closing this issue ticket now S3 support has been integrated. |
Adding a small example of using vsi curl to access netcdf products in ASF AWS directly. Providing notes below. Note the ASF instructions are outdated.
@piyushrpt does this work for you?
ASF instructions
From ASF website: Users can obtain a temporary AWS access key from ASF using their Earthdata Login credentials. The temporary key is then used to obtain data while the access key is valid. Temporary access keys are obtained by invoking the following URL: https://grfn.asf.alaska.edu/door/credentials
The "Credentials" block of the response includes an Access Key, Secret Key, and Session Token for a temporary S3 session, along with the session's expiration date. The "PolicyDocument" block describes the AWS permissions granted for the session, including the name of the S3 bucket where Sentinel-1 Interferogram (BETA) products are stored.
Example of a legacy beta product and vsi:
GDAL installtion notes
A recent enough version (4.5+) of libnetcdf must be used so that /vsicurl/ can be used by the netCDF driver. i.e. you should see 'NetCDF has netcdf_mem.h: yes' in configure output.
Current beta product linls
URL of an existing ASF GUNW product:
The text was updated successfully, but these errors were encountered: