-
Notifications
You must be signed in to change notification settings - Fork 7
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
Difficuty accessing ECCO file #179
Comments
Hi @waywardpidgeon, apologies for the sparse documentation... we are working on it. This page (which is on a PR) explains how to set up your https://github.com/CliMA/ClimaOcean.jl/tree/glw/clean-up-ECCO/src/DataWrangling/ECCO Note that the username and password are not your login, but rather the "programmatic API" credentials which are generated by Earthdata. PS you may want to change your login password now, because it is visible here. |
Thanks. I've changed the login password and set up the API creds. However, I'm running under Windows (10 and 11) in the Windows power shell, and this may be the problem with wget (and most other windows commands) needing special treatment from a brief perusal of the web. However, I checked the file argument for C:\Users\kab.julia\scratchspaces\0376089a-ecfe-4b0e-a64f-9c555d74d754\Bathymetry Cheers - Kevin |
Also, might we use HTTP.jl instead of run and wget to access and download these sorts of files? See https://stackoverflow.com/questions/61862089/how-to-use-wget-with-julia Cheers - Kevin |
Ok ok Can you confirm this is the error? If you run ecco_mask() on Windows, you'll get the error
I think this is coming from here: ClimaOcean.jl/src/DataWrangling/ecco_metadata.jl Lines 167 to 169 in b3b44b7
@waywardpidgeon you can confirm if you paste more of the error. @simone-silvestri why don't we use |
Hmm it also looks like we apparently would like to test this on Windows, but are not right now, ClimaOcean.jl/.github/workflows/ci.yml Lines 55 to 58 in b3b44b7
this only tests JRA55 https://github.com/CliMA/ClimaOcean.jl/blob/main/test/test_downloading.jl |
Yes, that looks v promising. HTTP.jl and maybe other options I think call wget. The doc julia-1.10.5.pdf on p985 indicates Downloads.download is a currently supported function, with Downloads.jl included in the standard library (not Base). I've tested this on an HTML file from my website kevinbroughan.nz under Windows 10 and it works ok. I'll try Greg's test next but note some of the JRA55 requests, e.g. in generate_atmos_dataset.jl, I needed to replace |
I ran this code and here is the output: Does this mean no JRA55 data is available to my process ? Thanks - Kevin |
I looked again at one of the original errors and observed the url had single, not double quotes. Also before the file name there was a backslash not forward, another gremlin. Given these two url fixes I tried Downloads.download(url) and it downloaded a file of over 470Mb into a temporary file with name returned by the function. So I assume it works for ECCO files. Sorry about Windows, but there must be many users who have it so I'm sticking with this OS. |
No need to apologies! I think a more direct test will be to paste this code in your REPL using ClimaOcean
using Oceananigans
JRA55_temperature = ClimaOcean.JRA55.JRA55_field_time_series(:temperature; time_indices=2:3) Then you can try to play around with, inspect, or plot PS: to make the errors easier to read when you paste them here, try surrounding them in triple backticks (```). This is how your format "code blocks" in markdown (also googling "code blocks in markdown" may help) |
Sorry for the late reply. I forgot that wget does not work on windows machines. Good catch. If you make a PR to correct this oversight it would be great. |
I think an expert should fix this with a PR, not me yet. Here is my workaround for wget producing an error in Windows: I used Downloads.download and the ECCO data for the example generated_bathymetry.jl ended up in my Downloads folder. I moved it into the scratchspaces subdirectory of .julia (the file was about 0.5 Gbytes), the subdirectory possibly having been created by the generate_atmos_dataset.jl example. I then ran the example generated_bathymetry.jl again and it picked up the file ("existing file") without any further difficulty (other than the warning "resolution->size" for the Figure Makie function). |
I do not have immediate access to a windows machine. If I open a PR to fix this, can you check that downloading works? We should probably add Windows tests in the CI to catch these architecture-dependent bugs |
OK I will test. Windows tests would be a good idea. Its nice to be alert to the problem - I think I have struck it in the past and not known it! I am working on the generate_surface_fluxes.jl example, having downloaded the ECCO2 data directly from the JPL data store. Is there a path that I can find or establish on my machine where I can put this data and the program (ecco_mask() and its calls) will find it? |
@simone-silvestri we do have access to windows via github actions. We need to add a test there. |
Another case: in the example inspect_ecco_data.jl at line 20 we see a reference to the "default location' from which ecco_field is expected to access the data if it exists (see the doc for ecco_field in ECCO.jl item (1)). I want to place the data (which I have) at this location, but I don't know what it is? What is it and how in general can I find it? |
Can you put hyperlinks to the source code here? |
Is |
Ah yes, it's also possible to generate a link to the line itself (which is nice because GitHub will display that line directly in the comment, convenient because we don't have to click on it). A link to the file is helpful too though, thank you. To generate a link to a line look for the three dots that appear when hovering your mouse over the line numbers on the left side of a file being viewed on GitHub. |
@waywardpidgeon you mean these lines? ClimaOcean.jl/examples/inspect_ecco_data.jl Lines 19 to 23 in ddea939
|
Ok ok I understand the question. It looks like you can provide a filename: ClimaOcean.jl/src/DataWrangling/ECCO.jl Lines 133 to 142 in ddea939
But it also seems that it will still try to download the dataset even if the filename is provided. This seems really buggy and fragile but maybe there is an underlying purpose to this design that @simone-silvestri can explain. Sorry to say @waywardpidgeon that this stuff is in flux a little bit and we need to clean it up for sure. From your experience I understand that:
What else? |
Yeahm the path cannot be specified, that in theory, was one of the objectives of #180. ClimaOcean.jl/src/DataWrangling/ecco_metadata.jl Lines 154 to 160 in ddea939
So we should change the download command to downloads and add a path for the ecco files. In theory, in #180 we provide a directory to the ECCOMetadata type that specifies the path of the files. That will help us with generalizing the data-wrangling module.
|
we can also probably remove the |
I think we should polish this implementation first and then we can add new features, eg supporting manually-downloaded files for example. But yeah in general it is good if everyone uses the same filename, it will help communication. |
OK, I'll stop with this work now for a while. Plenty else to do. Here is where I'm at. The function urlread works under Windows 11 using HTTP function urlread(url, un, output) The download function did not pick up the username or password from the environment and It did not appear to read these with .netrc or _netrc, but building in both API credentials into the URL worked (picked up the method from SpaceLiDAR.jl). This function returned a path and created the file but seemed to need existing subdirectories to actually work. Other tasks: getting the output into Julia, including the Sys.iswindows() conditional, creating the canonical subdirectories of .julia/scratchspaces, doing a good check of other wget occurrences, etc. Thanks for the advice. I try and come more up to speed with git next time - Kevin |
On trying the example generate_surface_fluxes.jl at the line
mask=ecco_mask()
I get the error (in this minimal example)
run(
wget --http-user=kevin_broughan --http-passwd=Nasa44earth-data 'https://ecco.jpl.nasa.gov/drive/files/ECCO2/cube92_latlon_quart_90S90N/daily/THETA\THETA.1440x720x50.19930101.nc'
)ERROR: IOError: could not spawn
wget --http-user=kevin_broughan --http-passwd=Nasa44earth-data 'https://ecco.jpl.nasa.gov/drive/files/ECCO2/cube92_latlon_quart_90S90N/daily/THETA\THETA.1440x720x50.19930101.nc'
: no such file or directory (ENOENT)However, when I login to Nasa earth data and navigate to the file the file its in place at 74.5Mb.
I tried running Julia as su with no change in other problematic examples.
Thanks for looking at this -- Kevin
The text was updated successfully, but these errors were encountered: