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

java.lang.IllegalStateException: nLon (=0) and nLat (=0) must be positive and > 0 #136

Closed
aleatorius opened this issue Apr 13, 2021 · 5 comments

Comments

@aleatorius
Copy link

aleatorius commented Apr 13, 2021

hi, we have a standalone ncWMS 2.5.0
https://github.com/Reading-eScience-Centre/edal-java/blob/master/cdm/pom.xml

and we get the following errors for files larger than 300MB:

%%%%%%%%%%%%%%%%%%%%%%%%%%
Status of dataset 003 (for debugging)
State: ERROR

Loading progress
Starting loading
Using dataset factory: class uk.ac.rdg.resc.edal.dataset.cdm.CdmGridDatasetFactory
Error report
Stack trace:
uk.ac.rdg.resc.edal.exceptions.EdalException: Problem creating dataset 003 at https://ns9081k.hyrax.sigma2.no/opendap/S4K/roms_test_02/roms_02.nc
uk.ac.rdg.resc.edal.dataset.cdm.CdmDatasetFactory.createDataset(CdmDatasetFactory.java:133)
uk.ac.rdg.resc.edal.dataset.cdm.CdmDatasetFactory.createDataset(CdmDatasetFactory.java:75)
uk.ac.rdg.resc.edal.catalogue.jaxb.DatasetConfig.createDataset(DatasetConfig.java:249)
uk.ac.rdg.resc.edal.catalogue.jaxb.DatasetConfig.refresh(DatasetConfig.java:209)
uk.ac.rdg.resc.edal.catalogue.jaxb.CatalogueConfig$1.run(CatalogueConfig.java:154)
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java.base/java.lang.Thread.run(Thread.java:834)

Caused by:
java.lang.IllegalStateException: nLon (=0) and nLat (=0) must be positive and > 0
uk.ac.rdg.resc.edal.util.LookUpTable.(LookUpTable.java:128)
uk.ac.rdg.resc.edal.grid.LookUpTableGrid.generate(LookUpTableGrid.java:87)
uk.ac.rdg.resc.edal.util.cdm.CdmUtils.createHorizontalGrid(CdmUtils.java:238)
uk.ac.rdg.resc.edal.dataset.cdm.CdmGridDatasetFactory.getNonStaggeredGriddedVariableMetadata(CdmGridDatasetFactory.java:148)
uk.ac.rdg.resc.edal.dataset.cdm.CdmGridDatasetFactory.generateGridDataset(CdmGridDatasetFactory.java:134)
uk.ac.rdg.resc.edal.dataset.cdm.CdmGridDatasetFactory.generateDataset(CdmGridDatasetFactory.java:124)
uk.ac.rdg.resc.edal.dataset.cdm.CdmDatasetFactory.createDataset(CdmDatasetFactory.java:97)
uk.ac.rdg.resc.edal.dataset.cdm.CdmDatasetFactory.createDataset(CdmDatasetFactory.java:75)
uk.ac.rdg.resc.edal.catalogue.jaxb.DatasetConfig.createDataset(DatasetConfig.java:249)
uk.ac.rdg.resc.edal.catalogue.jaxb.DatasetConfig.refresh(DatasetConfig.java:209)
uk.ac.rdg.resc.edal.catalogue.jaxb.CatalogueConfig$1.run(CatalogueConfig.java:154)
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
java.base/java.lang.Thread.run(Thread.java:834)
%%%%%%%%%%%%%%%%%%%%%%

Before we tried a combo hyrax 1.16.3 + ncWMS 2.4.2.
for example in this datasets (with this ncWMS+hyrax combo) :
https://ns9081k.hyrax.sigma2.no/opendap/S4K/roms_test_02/contents.html
roms_01.nc can be displayed in Godiva3, while roms_02.nc with too extra varables 696x453x35 cannot be displayed.

It seems the situation is similar to the case described here:
Unidata/netcdf-java#43

Dmitry

@guygriffiths
Copy link
Contributor

Looking at the dataset, it appears you have some variables (pvorticity, rvorticity) whose co-ordinates are the grids defined by lon_psi and lat_psi. But lon_psi and lat_psi are grids entirely containing zeros - i.e. not valid co-ordinate systems. I think that is the issue here, particularly since the _psi variables are not present in roms_01.nc.

@aleatorius
Copy link
Author

ah, thanks! that was stupid of me not to notice it! that's a bug in ROMS outputs,

btw, is it possible to blacklist some variables so to prevent the scanning for them?

@guygriffiths
Copy link
Contributor

No, it's not currently possible to blacklist variables directly in ncWMS, but we do support NcML as an input format (https://www.unidata.ucar.edu/software/netcdf-java/v4.6/ncml/Tutorial.html) which I believe can point to a remote dataset and include/exclude certain variables.

@aleatorius
Copy link
Author

yes, thanks, just made up for lat_psi and lon_psi from lat_rho and lon_rho and now all the vars are properly displayed
https://ns9081k.hyrax.sigma2.no/ncWMS2/Godiva3.html?server=https://ns9081k.hyrax.sigma2.no/ncWMS2/wms/lds/S4K/roms_test_02/roms_02_mod.nc

thanks for your help!

@guygriffiths
Copy link
Contributor

No worries, glad to hear it's working :)

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