Hi,
I have a problem with my binary file created of corine land cover that seems to not be taking into account by geogrid. I have no warning or error on geogrid.log, but when plotting the geo_em.d02.nc for example, my Lu_INDEX have only 28 classes. It seems ok with default usage, but I have reclassify my CLC to USGS and I have some ID that goes up to 33. So I have to end up with 33 classes instead. The 31 to 33 representing the urban part. So the urban part is missing.To make my binary file I used a fortran code combine with the c code of write_geogrid.c. The output file seems ok, and I can see the data. Just in case, I have the same results, when putting empty binary file.
1- My reclassification is made on python with the reprojected tiff file, also reprojected on python. Here I reclassify with the following dictionnary :
reclassification_dict = {-128:0, 0:0, 48:0, 1:32, 2:31, 3:33, 4:33, 5:33, 6:33, 7:19, 8:19, 9:19, 10:7, 11:7, 12:2,
13:3, 14:3, 15:6, 16:6, 17:6, 18:2, 19:6, 20:4, 21:5, 22:6, 23:11, 24:14, 25:15, 26:7, 27:9,
28:9, 29:9, 30:19, 31:19, 32:19, 33:19, 34:24, 35:17, 36:17, 37:17, 38:17, 39:17, 40:16,
41:28, 42:28, 43:16, 44:16}
2- Next that new tiff file is send to the IDRIS server to convert the file to ASCII and into binary file. I run it on the server because of memory issues in my local computer. I used a slurm file containing the last step, where I do :
module load gdal/
gdal_translate -of AAIGrid cropped_CLC_wgs84_reclasssify.tif CLC_USGS.asc
gcc -D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF-DIO_BINARY-DIO_GRIB1 -D_GEOGRID -O -c write_geogrid.c
gfortran geogrid_clc.f90 write_geogrid.o
./a.out
-My index file contain :
type=categorical
row_order=top_bottom
category_min=1
category_max=33
projection=regular_ll
dx=0.00128354112745536
dy=0.00128354112745536
known_x=1.0
known_y=1.0
known_lat=68.3668663391942
known_lon=-31.8067559589092
wordsize=1
missing_value=0
tile_x=60602
tile_y=27641
tile_z=1
units="category"
description="CLC 2018 landuse"
-My namelist.wps contain : geog_data_res = 'srtm_3s+clc2006+usgs_lakes+default','srtm_3s+clc2006+usgs_lakes+default'
-And GEOGRID.TBL :
===============================
name=LANDUSEF
priority=2
dest_type=categorical
z_dim_name=land_cat
landmask_water = clc2006:16,28 # Calculate a landmask from this field
interp_option = clc2006:nearest_neighbor
rel_path= clc2006:specific/landuse_clc2018_wgs_test/
===============================
In case you ask, the problem is the same if I directly make a binary file from the tiff file. Also I have a reference to see what I have to obtain in my geo_em.d02.nc file for example. See figure attached. Don't pay attention to the levels of colorbar, I'm particularly interesting of the number of classes.
Is anyone have any idea ?
I have a problem with my binary file created of corine land cover that seems to not be taking into account by geogrid. I have no warning or error on geogrid.log, but when plotting the geo_em.d02.nc for example, my Lu_INDEX have only 28 classes. It seems ok with default usage, but I have reclassify my CLC to USGS and I have some ID that goes up to 33. So I have to end up with 33 classes instead. The 31 to 33 representing the urban part. So the urban part is missing.To make my binary file I used a fortran code combine with the c code of write_geogrid.c. The output file seems ok, and I can see the data. Just in case, I have the same results, when putting empty binary file.
1- My reclassification is made on python with the reprojected tiff file, also reprojected on python. Here I reclassify with the following dictionnary :
reclassification_dict = {-128:0, 0:0, 48:0, 1:32, 2:31, 3:33, 4:33, 5:33, 6:33, 7:19, 8:19, 9:19, 10:7, 11:7, 12:2,
13:3, 14:3, 15:6, 16:6, 17:6, 18:2, 19:6, 20:4, 21:5, 22:6, 23:11, 24:14, 25:15, 26:7, 27:9,
28:9, 29:9, 30:19, 31:19, 32:19, 33:19, 34:24, 35:17, 36:17, 37:17, 38:17, 39:17, 40:16,
41:28, 42:28, 43:16, 44:16}
2- Next that new tiff file is send to the IDRIS server to convert the file to ASCII and into binary file. I run it on the server because of memory issues in my local computer. I used a slurm file containing the last step, where I do :
module load gdal/
gdal_translate -of AAIGrid cropped_CLC_wgs84_reclasssify.tif CLC_USGS.asc
gcc -D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF-DIO_BINARY-DIO_GRIB1 -D_GEOGRID -O -c write_geogrid.c
gfortran geogrid_clc.f90 write_geogrid.o
./a.out
-My index file contain :
type=categorical
row_order=top_bottom
category_min=1
category_max=33
projection=regular_ll
dx=0.00128354112745536
dy=0.00128354112745536
known_x=1.0
known_y=1.0
known_lat=68.3668663391942
known_lon=-31.8067559589092
wordsize=1
missing_value=0
tile_x=60602
tile_y=27641
tile_z=1
units="category"
description="CLC 2018 landuse"
-My namelist.wps contain : geog_data_res = 'srtm_3s+clc2006+usgs_lakes+default','srtm_3s+clc2006+usgs_lakes+default'
-And GEOGRID.TBL :
===============================
name=LANDUSEF
priority=2
dest_type=categorical
z_dim_name=land_cat
landmask_water = clc2006:16,28 # Calculate a landmask from this field
interp_option = clc2006:nearest_neighbor
rel_path= clc2006:specific/landuse_clc2018_wgs_test/
===============================
In case you ask, the problem is the same if I directly make a binary file from the tiff file. Also I have a reference to see what I have to obtain in my geo_em.d02.nc file for example. See figure attached. Don't pay attention to the levels of colorbar, I'm particularly interesting of the number of classes.
Is anyone have any idea ?