Skip to content
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

nc/i-metric-joint-k-5-d-3.nc' data is not downlaoding #3

Open
ronygolderku opened this issue May 7, 2024 · 5 comments
Open

nc/i-metric-joint-k-5-d-3.nc' data is not downlaoding #3

ronygolderku opened this issue May 7, 2024 · 5 comments

Comments

@ronygolderku
Copy link

Hi,
When, I am using trying to run this python3 main.py

it shows the error like

high
'mpl_params' 0.00060 s

settings:
cst.EXAMPLE_TIME_INDEX 40 cst.SEED 10
high
'mpl_params' 0.00038 s

Traceback (most recent call last):
File "/home/ubuntu/fronts/env/lib/python3.8/site-packages/xarray/backends/file_manager.py", line 209, in _acquire_with_cache_info
file = self._cache[self._key]
File "/home/ubuntu/fronts/env/lib/python3.8/site-packages/xarray/backends/lru_cache.py", line 55, in getitem
value = self._cache[key]
KeyError: [<class 'netCDF4._netCDF4.Dataset'>, ('/home/ubuntu/fronts/nc/i-metric-joint-k-5-d-3.nc',), 'r', (('clobber', True), ('diskless', False), ('format', 'NETCDF4'), ('persist', False)), 'cc23bfcc-b404-4b78-9197-6574972c55b7']

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 6, in
mf.make_all_figures()
File "/home/ubuntu/fronts/src/time_wrapper.py", line 24, in timed
result = method(*args, **kw)
File "/home/ubuntu/fronts/src/make_figures.py", line 57, in make_all_figures
ds = xr.open_dataset(cst.DEFAULT_NC)
File "/home/ubuntu/fronts/env/lib/python3.8/site-packages/xarray/backends/api.py", line 541, in open_dataset
backend_ds = backend.open_dataset(
File "/home/ubuntu/fronts/env/lib/python3.8/site-packages/xarray/backends/netCDF4_.py", line 578, in open_dataset
store = NetCDF4DataStore.open(
File "/home/ubuntu/fronts/env/lib/python3.8/site-packages/xarray/backends/netCDF4_.py", line 382, in open
return cls(manager, group=group, mode=mode, lock=lock, autoclose=autoclose)
File "/home/ubuntu/fronts/env/lib/python3.8/site-packages/xarray/backends/netCDF4_.py", line 329, in init
self.format = self.ds.data_model
File "/home/ubuntu/fronts/env/lib/python3.8/site-packages/xarray/backends/netCDF4_.py", line 391, in ds
return self.acquire()
File "/home/ubuntu/fronts/env/lib/python3.8/site-packages/xarray/backends/netCDF4
.py", line 385, in _acquire
with self._manager.acquire_context(needs_lock) as root:
File "/home/ubuntu/fronts/env/lib/python3.8/contextlib.py", line 113, in enter
return next(self.gen)
File "/home/ubuntu/fronts/env/lib/python3.8/site-packages/xarray/backends/file_manager.py", line 197, in acquire_context
file, cached = self._acquire_with_cache_info(needs_lock)
File "/home/ubuntu/fronts/env/lib/python3.8/site-packages/xarray/backends/file_manager.py", line 215, in _acquire_with_cache_info
file = self._opener(*self._args, **kwargs)
File "src/netCDF4/_netCDF4.pyx", line 2469, in netCDF4._netCDF4.Dataset.init
File "src/netCDF4/_netCDF4.pyx", line 2028, in netCDF4._netCDF4._ensure_nc_success
FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/fronts/nc/i-metric-joint-k-5-d-3.nc'

The thing is that, i-metric-joint-k-5-d-3.nc file is not downloaded when I downloaded the bsose data.
Could you please it?

Best regards,

@sdat2
Copy link
Collaborator

sdat2 commented May 8, 2024

Hi, thanks a lot for getting in touch, I'm sorry about this error message

@sdat2
Copy link
Collaborator

sdat2 commented May 8, 2024

Could you let me know if you ran the command python3 src/models/batch_i_metric.py. I'm a little hazy on the details, but I think this is the step when this file is created

@ronygolderku
Copy link
Author

When I ran this command "(/home/ubuntu/fronts/env) ubuntu@indian-ocean:~/fronts$ python3 src/models/batch_i_metric.py
output shows that a NC file was created( bold letters). That means, it only creates a single nc file named interp.nc instead of i-metric-joint-k-5-d-3.nc file.

The output:
going to save to: /home/ubuntu/fronts/nc/interp.nc

@sdat2
Copy link
Collaborator

sdat2 commented May 9, 2024

Hey, thanks for getting back in touch so quickly. I was having a look back at that script:
https://github.com/so-wise/so-fronts/blob/main/src/models/batch_i_metric.py
(which is pretty badly documented, apologies).

The function merge_and_save should save the netcdfs using https://github.com/so-wise/so-fronts/blob/main/src/data_loading/io_names.py opening from io.return_folder and then saving to io.return_name. I think an issue I might have created in the repository is that it saves to GWS_DATA_DIR which is set to the particular HPC I was using rather than a generic default.

Thanks for spotting this, I will make a pull request. A quick solution might be to edit src.constants but I should test that.

@ronygolderku
Copy link
Author

Thanks for your kind reply. and no need to apologize. I want to bring your attention to rerunning the whole script and updating the code because some modules have been updated. Specifically, I had to install seaborn separately even though I activated the entire environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants