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

Cell size error #66

Open
Ivanleeg opened this issue Jun 24, 2024 · 2 comments
Open

Cell size error #66

Ivanleeg opened this issue Jun 24, 2024 · 2 comments
Assignees

Comments

@Ivanleeg
Copy link

Hello,

When trying to run the LIVAP utility for 1998 using the data from https://jeodpp.jrc.ec.europa.eu/ftp/jrc-opendata/CEMS-EFAS/meteorological_forcings/EMO-1arcmin/ I get a cell size error. However, when I investigate both grids using gdalinfo I see there is no difference in the cell size?

C:\Users\leegwate\LISVAP>docker run -v /:/tmp -v C:/Users/leegwate/LISVAP/lisflood-lisvap/tests/data:/input -v C:/Users/leegwate/LISVAP/lisflood-lisvap/tests/data:/output jrce1/lisvap:latest /input/1998_lisvap_efas.xml -v -t
Start date: 02/01/1998 06:00 (1) - End date: 31/12/1998 06:00 (364)
Traceback (most recent call last):
File "/lisvap1.py", line 94, in
sys.exit(main())
File "/lisvap1.py", line 90, in main
lisvapexe(lissettings)
File "/lisvap1.py", line 63, in lisvapexe
lisvap_model = LisvapModel()
File "/lisvap/lisvapinitial.py", line 55, in init
CutMap.register(map_for_metadata)
File "/lisvap/utils/init.py", line 365, in register
return cls(in_file)
File "/lisvap/utils/init.py", line 86, in call
cls._instances[key] = super(Singleton, cls).call(*args, **kwargs)
File "/lisvap/utils/init.py", line 369, in init
self.cuts = self.get_cuts(in_file)
File "/lisvap/utils/init.py", line 390, in get_cuts
raise LisfloodError('Cell size different in maskmap {} and {}'.format(settings.binding['MaskMap'], filename))
lisvap.utils.LisfloodError:

========================== LISFLOOD ERROR =============================
Cell size different in maskmap /input/../../basemaps/area.nc and /input/input/1998/tn_1_15.nc

Below the gdalinfo of the maskmap
(lisflood) root@583efef4d74c:/# gdalinfo /mnt/LISVAP/lisflood-lisvap/basemaps/area.nc
Driver: netCDF/Network Common Data Format
Files: /mnt/LISVAP/lisflood-lisvap/basemaps/area.nc
Size is 4530, 2970
Coordinate System is:
GEOGCRS["WGS 84",
DATUM["World Geodetic System 1984",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
CS[ellipsoidal,2],
AXIS["geodetic latitude (Lat)",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (-25.250000000000000,72.250000000000014)
Pixel Size = (0.016666666666667,-0.016666666666667)
Metadata:
area_European_01min#grid_mapping=crs
area_European_01min#long_name=GDAL Band Number 1
area_European_01min#missing_value=nan
area_European_01min#_FillValue=nan
crs#GeoTransform=-25.25 0.01666666666666667 0 72.25 0 -0.01666666666666667
crs#grid_mapping_name=latitude_longitude
crs#inverse_flattening=298.257223563
crs#longitude_of_prime_meridian=0
crs#long_name=CRS definition
crs#semi_major_axis=6378137
crs#spatial_ref=GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]
lat#axis=Y
lat#long_name=latitude
lat#standard_name=latitude
lat#units=degrees_north
lon#axis=X
lon#long_name=longitude
lon#standard_name=longitude
lon#units=degrees_east
NC_GLOBAL#CDI=Climate Data Interface version 1.9.8 (https://mpimet.mpg.de/cdi)
NC_GLOBAL#CDO=Climate Data Operators version 1.9.8 (https://mpimet.mpg.de/cdo)
NC_GLOBAL#Conventions=CF-1.5
NC_GLOBAL#GDAL=GDAL 3.0.4, released 2020/01/28
NC_GLOBAL#GDAL_AREA_OR_POINT=Area
NC_GLOBAL#history=Fri Nov 20 14:22:33 2020: ncks -A -v lat,lon /hugetmp/NOT_Permanent/LDD/LDD_BOX/res/CHECKED/ldd_European_01min.nc /hugetmp/NOT_Permanent/LDD/LDD_BOX/res/CHECKED/RECUT/elv_European_01min.nc
Fri Nov 20 14:22:32 2020: cdo -invertlat tmp_2.nc /hugetmp/NOT_Permanent/LDD/LDD_BOX/res/CHECKED/RECUT/elv_European_01min.nc
Fri Nov 20 14:22:32 2020: GDAL CreateCopy( tmp_2.nc, ... )
NC_GLOBAL#history_of_appended_files=Fri Nov 20 14:22:33 2020: Appended file /hugetmp/NOT_Permanent/LDD/LDD_BOX/res/CHECKED/ldd_European_01min.nc had following "history" attribute:
Wed Nov 18 13:58:11 2020: ncks -A -v lat,lon /hugetmp/NOT_Permanent/LDD/LDD_BOX/res/CHECKED/ldd_European_01min_BeforeCorrection.nc /hugetmp/NOT_Permanent/LDD/LDD_BOX/res/CHECKED/ldd_European_01min.nc
Wed Nov 18 13:57:42 2020: ncks -A -v lat,lon /hugetmp/NOT_Permanent/LDD/LDD_BOX/res/CHECKED/ldd_European_01min_BeforeCorrection.nc /hugetmp/NOT_Permanent/LDD/LDD_BOX/res/CHECKED/ldd_European_01min.nc
Wed Nov 18 13:57:42 2020: cdo -invertlat tmp_5.nc /hugetmp/NOT_Permanent/LDD/LDD_BOX/res/CHECKED/ldd_European_01min.nc
Wed Nov 18 13:57:42 2020: GDAL CreateCopy( tmp_5.nc, ... )

NC_GLOBAL#NCO=netCDF Operators version 4.9.2 (Homepage = http://nco.sf.net, Code = http://github.com/nco/nco)
Corner Coordinates:
Upper Left ( -25.2500000, 72.2500000) ( 25d15' 0.00"W, 72d15' 0.00"N)
Lower Left ( -25.2500000, 22.7500000) ( 25d15' 0.00"W, 22d45' 0.00"N)
Upper Right ( 50.2500000, 72.2500000) ( 50d15' 0.00"E, 72d15' 0.00"N)
Lower Right ( 50.2500000, 22.7500000) ( 50d15' 0.00"E, 22d45' 0.00"N)
Center ( 12.5000000, 47.5000000) ( 12d30' 0.00"E, 47d30' 0.00"N)
Band 1 Block=4530x1 Type=Float32, ColorInterp=Undefined
NoData Value=nan
Metadata:
grid_mapping=crs
long_name=GDAL Band Number 1
missing_value=nan
NETCDF_VARNAME=area_European_01min
_FillValue=nan

Below the gdalinfo of the tn_1_15.nc

(lisflood) root@583efef4d74c:/# gdalinfo /mnt/LISVAP/lisflood-lisvap/tests/data/input/1998/tn_1_15.nc
Driver: netCDF/Network Common Data Format
Files: /mnt/LISVAP/lisflood-lisvap/tests/data/input/1998/tn_1_15.nc
Size is 4530, 2970
Coordinate System is:
GEOGCRS["WGS 84",
DATUM["World Geodetic System 1984",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
CS[ellipsoidal,2],
AXIS["geodetic latitude (Lat)",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (-25.250000000000000,72.250000000000014)
Pixel Size = (0.016666666666667,-0.016666666666667)
Metadata:
lat#long_name=Latitude
lat#standard_name=latitude
lat#units=degree_north
lon#long_name=Longitude
lon#standard_name=longitude
lon#units=degree_east
NC_GLOBAL#comment=The timestamp marks the end of the aggregation interval for a given map. e.g.: A daily map with the timestamp of 1990-01-02 06:00 represents the data aggregated from 1990-01-01 06:00:01 to 1990-01-02 06:00:00
NC_GLOBAL#Conventions=CF-1.6
NC_GLOBAL#history=Created Wed Apr 20 11:25:54 2022
NC_GLOBAL#institution=European Commission - Disaster Risk Management Unit (JRC.E.1) : https://ec.europa.eu/jrc/en/research-topic/floods
NC_GLOBAL#keywords=Lisflood, Europe
NC_GLOBAL#reference=A European daily high-resolution gridded meteorological data set for 1990 - 2021
NC_GLOBAL#source=Lisflood Europe meteo maps - pb2015
NC_GLOBAL#Source_Software=SPHEREMAP for EFAS SC9 (c) DWD-GPCC (08 March 2022)
NC_GLOBAL#title=Lisflood meteo maps 1990-2021 for European setting Jun. 2021
NETCDF_DIM_EXTRA={time}
NETCDF_DIM_time_DEF={365,6}
NETCDF_DIM_time_VALUES={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364}
time#calendar=proleptic_gregorian
time#frequency=1
time#standard_name=time
time#units=days since 1998-01-01 06:00:00.000000
tn#add_offset=0
tn#cell_methods=time: minimum
tn#esri_pe_string=GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]
tn#grid_mapping=wgs_1984
tn#long_name=Daily Minimum Temperature
tn#missing_value=-9999
tn#scale_factor=0.1
tn#standard_name=air_temperature
tn#units=degree_Celsius
tn#valid_max=500
tn#valid_min=-500
tn#_FillValue=-9999
wgs_1984#EPSG_code=EPSG:4326
wgs_1984#grid_mapping_name=wgs_1984
wgs_1984#inverse_flattening=298.257223563
wgs_1984#proj4_params=+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
wgs_1984#semi_major_axis=6378137
wgs_1984#spatial_ref=GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433],AUTHORITY["EPSG","4326"]]
Corner Coordinates:
Upper Left ( -25.2500000, 72.2500000) ( 25d15' 0.00"W, 72d15' 0.00"N)
Lower Left ( -25.2500000, 22.7500000) ( 25d15' 0.00"W, 22d45' 0.00"N)
Upper Right ( 50.2500000, 72.2500000) ( 50d15' 0.00"E, 72d15' 0.00"N)
Lower Right ( 50.2500000, 22.7500000) ( 50d15' 0.00"E, 22d45' 0.00"N)
Center ( 12.5000000, 47.5000000) ( 12d30' 0.00"E, 47d30' 0.00"N)


In the settingsfile I have checked if I have defined the correct paths for these files. I have also tried locating the basemaps somewhere else and defining a new path, but the same error occurs after relocating the basemaps and changing the filepath.

Hopefully you can see what I am missing!

Kind regards,
Ivan Leegwater

@gnrgomes gnrgomes self-assigned this Jun 24, 2024
@gnrgomes
Copy link
Collaborator

Dear Ivan,
Thank you for your interest in Lisvap and to have reported this issue.
I will investigate this as soon as I can.
Best regards,
Gonçalo Gomes

@Ivanleeg
Copy link
Author

Hi Gonçalo,

Thanks for reaching out so fast! In the mean time I have tried some other things and noticed the following: after cloning https://github.com/ec-jrc/lisflood-lisvap.git
I tried to run the different tests again. Then I noticed that the tests_efas.xml and the tests_glofas.xml run without any problems. However, all tests_efas_1arcmin.....xml show this error message:

C:\Users\leegwate\LISVAP>docker run -v /:/tmp -v C:/Users/leegwate/LISVAP/lisflood-lisvap/tests/data:/input -v C:/Users/leegwate/LISVAP/lisflood-lisvap/tests/data:/output jrce1/lisvap:latest /input/tests_efas_1arcmin.xml -v -t
Lisvap 0.4.2 23/08/2019

(C) Disaster Risk Management Knowledge Centre
Joint Research Centre of the European Commission
Units E1,D2 I-21020 Ispra (Va), Italy

Start date: 02/06/1990 06:00 (152) - End date: 12/06/1990 06:00 (162)
Traceback (most recent call last):
File "/lisvap/utils/readers.py", line 55, in loadsetclone
iter_setclone_pcraster(filename)
File "/lisvap/utils/readers.py", line 359, in iter_setclone_pcraster
return remote_input_access(pcraster.pcraster.setclone, file_path)
File "/lisvap/utils/readers.py", line 376, in remote_input_access
obj = function(file_path)
RuntimeError: Data source /input/../../basemaps/1arcmin/area.nc(raster):
cannot be opened

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/lisvap/utils/readers.py", line 376, in remote_input_access
obj = function(file_path)
File "/lisvap/utils/readers.py", line 348, in access_function
return Dataset(path, mode, **kwargs)
File "netCDF4/_netCDF4.pyx", line 2291, in netCDF4._netCDF4.Dataset.init
File "netCDF4/_netCDF4.pyx", line 1855, in netCDF4._netCDF4._ensure_nc_success
FileNotFoundError: [Errno 2] No such file or directory: b'/input/../../basemaps/1arcmin/area.nc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/lisvap1.py", line 94, in
sys.exit(main())
File "/lisvap1.py", line 90, in main
lisvapexe(lissettings)
File "/lisvap1.py", line 63, in lisvapexe
lisvap_model = LisvapModel()
File "/lisvap/lisvapinitial.py", line 49, in init
self.MaskMap = loadsetclone('MaskMap')
File "/lisvap/utils/readers.py", line 61, in loadsetclone
nf1 = iter_open_netcdf(filename, 'r')
File "/lisvap/utils/readers.py", line 349, in iter_open_netcdf
return remote_input_access(access_function, file_path)
File "/lisvap/utils/readers.py", line 379, in remote_input_access
raise LisfloodError(file_path)
lisvap.utils.LisfloodError:

========================== LISFLOOD ERROR =============================
/input/../../basemaps/1arcmin/area.nc

Below also a screenshot of the command prompt screen:
image

Hopefully you can figure out what is going wrong.
Thanks for your time!
Ivan

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