Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Use CLC data with WPS

rafnas

New member
Hello,

In the past couple weeks, i have been trying to use the CLC data with the WPS instead of the default MODIS data. After reviewing some thread here regarding the subjects, those are the steps i have taken:

1. I downloaded the CLC data from their website.
2. I reclassified the data based on a table i found in this paper : https://www.researchgate.net/figure...-from-the-CLC-to-modified-IGBP_tbl2_342176597

3. I used gdal_translate to convert my tiff fie to binary. i plotted the binary file to validate that the file was converted successfully (i will include the plot as attachment)

4. i renames the binary based on the values i got from the gdal_translate. The final name ended up like this : 00001-65000.00001-46000

5. i created an index file which i will also be including (i suspect here is my problem)


5. i edited the GEOGRID.TBL to read from the binary file and the index file i created instead from the default data.:
landmask_water = corine_30s:17
interp_option = corine_30s:nearest_neighbor
rel_path = corine_30s:clc_data/
6. I edited the namelist.wps:
geog_data_res = 'corine_30s','corine_30s','corine_30s',


Finally i ran ./geogrid.exe and ./metgrid.exe and i used ncview to view the generated ncfiles.

My problem is that ncview isnt showing me any information when i choose LANDUSEF.

I am pretty sure that the values i am setting in my index file are somehow incorrect, but even after i read the documentation of the index file which i found here: Chapter 3: WRF Standard Initialization , i still cant understand what the values are in my case.

i will be attaching namelist.wps, GEOGRID.TBL and the index file as txt files, but on the server they are not txt files.

I would appreciate every single help.
Thank you
 

Attachments

  • step 3 - binary plotting.png
    step 3 - binary plotting.png
    94 KB · Views: 11
  • index.txt
    305 bytes · Views: 3
  • tbl file.txt
    16 KB · Views: 4
  • namelist.wps
    1.7 KB · Views: 1
Hi,
Take a look at this post and find the information on, and the attached script (plot_tile.py) from mgduda. Can you use that to plot one of your CLC data files and see if you are able to see LANDUSEF in that file?
 
Hello,

I am sorry for the late reply.

The plot above (attached here again) is the one i plotted using the script you mentioned. i just had to make changes to the variables above like this:

tile_x = 65000
tile_y = 46000
tile_bdr = 0
scaleFactor = 1.0
wordsize = 1

and some changes to the syntax because i used python 3.



I am also interested in the LU_INDEX variable. I ran geogrid with the binary file and i plotted the nc file that geogrid outputted. the plot seems weird to me comapred to the original modis data with 21 categories. (plots also attached)
 

Attachments

  • step 3 - binary plotting.png
    step 3 - binary plotting.png
    94 KB · Views: 6
  • LI_INDEX_MODIS21.png
    LI_INDEX_MODIS21.png
    33.4 KB · Views: 5
  • LU_INDEX_CLCDATA.png
    LU_INDEX_CLCDATA.png
    36.7 KB · Views: 7
Last edited:
Thank you for clarifying that. Is it possible to also share the CLC static file(s) you created? I'd like to try to run WPS with it and see what I can figure out. If the file(s) is too large, take a look at the home page of this forum for instructions on sharing large files. Thanks!
 
Hello,

I uploaded all the files that you asked for in the Nextcloud:

File name Explaination

U2018_CLC2018_V2020_20u1.tif The CLC 2018 data downloaded from their website CLC 2018 — Copernicus Land Monitoring Service

output_raster_new.tif Reclassified data to fit the 21 categories MODIS data

00001-65000.00001-46000 The binary file generated using the command "gdal_translate -of ENVI input.tif outputBin.dat"

domain01.png Picture showing the LU_INDEX variable in domain 1
domain02.png Picture showing the LU_INDEX variable in domain 2
domain03.png Picture showing the LU_INDEX variable in domain 3

GEOGRID.TBL
namelist.wps
index

Hope this explanation is enough. please let me know if you need anything else.

Thank you and have a nice day!
 
Hi,
Thank you so much for sending those. I don't have a lot of experience with converting files to static binary format, but after playing around with your files, these are my concerns.

1) I'm able to use the plot_tile.py script to plot your 00001-65000.00001-46000 file, though mine doesn't quite look like yours - the shape is somewhat deformed and the values go from -120 to 40. I'd be interested to see the script you used to see what I'm doing differently.

2) When I use the "gdal_translate -of ENVI output_raster_new.tif output_raster_new.dat" command, I then rename the file to 00001-65000.00001-46000. But when I try to plot the new tile, I'm not longer able to do so. Actually, I'm kicked out of my HPC system with a warning that I'm using too much memory. I would think the resulting file would be the same as the 00001-65000.00001-46000 file you sent. Can you let me know if you did something different than me?

3) In your index, you have the degrees (dx) listed as "0.0174532925199433," but if this is 30 second resolution data, shouldn't it be 0.00833333?

4) You also have the projected listed as "regular_ll" in the index, but when I take a look at the *.hdr file after using gdal_translate, it's listed as a lambert projection.

Note: When I try to run geogrid after changing the index values mentioned in 3) and 4), it just gives water points for the entire domain.

5) When I run geogrid with your files, I get warning messages for many points that say something like "point (10, 212) has an invalid category of 128." I notice in the reclassification paper you linked, the value 128 is not mentioned before or after reclassification, so I'm not sure where that value is coming from, but I also get the junky geo_em* output like you do.

So it seems like something went wrong with the reclassification, or maybe somewhere else along the way. I'm not quite sure, but wanted to share these thoughts/findings with you in case they help in any way.
 
Hello again,

I would like to thank you for putting time reviewing my thread and replying to me.
I was able to fix all of this by using convert_geotiff which produced the whole binary files including the index file.

Thank you very much and have a nice day!
 
Top