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

Convert Multiband Raster to WPS binary #145

Open
taoansf opened this issue Jul 29, 2019 · 8 comments
Open

Convert Multiband Raster to WPS binary #145

taoansf opened this issue Jul 29, 2019 · 8 comments
Labels
enhancement New feature or request
Milestone

Comments

@taoansf
Copy link

taoansf commented Jul 29, 2019

Hello,

I'm trying do convert a multiband raster to WPS binary by GIS4WRF process tool
image

However the resulting output is a single band binary file.

I attached my input and and output data for your checking.
green-mask-final-small.zip
greenfrac_fpar_modis-07-2019-wps.zip

Any help will be very appreciated.

With best regards,

Taoan

@dmey
Copy link
Contributor

dmey commented Jul 29, 2019

I do not quite understand why you want to convert a multi band to WPS binary but in any case this feature is not supported. You need to convert to single band first.

@taoansf
Copy link
Author

taoansf commented Jul 29, 2019

My idea is to update geogrid database to increase coast line resolution in my WRF simulations.
I got good improvements with Landuse data, which is single band. However, Albedo, Greenfraction and others multiband data I can't do because it is not working with GIS4WRF conversion tool.

If you know another way to do this, please share it with me.

Thank you for your attention.

Taoan

@dmey
Copy link
Contributor

dmey commented Jul 29, 2019

We do not support that feature at the moment. @letmaik I was going to add this as a feature request under the future milestone -- I am not sure we should aim to add this at the next release due to time...

@letmaik
Copy link
Contributor

letmaik commented Jul 29, 2019

That's right, this is not supported currently and there is no work-around for this either. We should really print an error message in that case instead of simply converting the first band.

@dmey future sounds fine, it's not a simple fix but requires some work and I don't think we have the resources currently to do this in the near future.

@taoansf Contributions are always welcome. The code is here: https://github.com/GIS4WRF/gis4wrf/blob/master/gis4wrf/core/writers/wps_binary.py.

@letmaik letmaik added the enhancement New feature or request label Jul 29, 2019
@letmaik letmaik added this to the Future milestone Jul 29, 2019
@taoansf
Copy link
Author

taoansf commented Jul 29, 2019

Thanks all
I will study wps_binary.py to understand better the process.

I also found this explanation about wps format that give some insights http://www.met.wur.nl/Summerinthecity/posts/2014/03/wrfgisinput/

If wps format is similar to ENVI image format, so I will look for some solution by this way using GDAL.

However, I have another question related with "wordsize" parameter on wps index file. I got this error when I try to convert a geotiff float32 to wps and open the output with GIS4WRF.
image

Is there some trick for conversion of geotiff and get a "wordsize=2"? because I only get wordsize=4 on my output.

These are my test files.
SOILTEMP.zip

@letmaik
Copy link
Contributor

letmaik commented Jul 29, 2019

Currently wordsize is determined automatically with a heuristic with the goal of trying to represent the input as accurately as possible. Feel free to open a separate feature request about this as it should really be an option for the user to choose it manually if needed, typically to reduce data volume.

The error you got is correct and a limitation of GDAL which doesn't support this high bit depth natively. Again, feel free to open a feature request for that. The way to do it would be to preprocess the WPS data (downsampling) before handing it to GDAL.

@sampr7
Copy link

sampr7 commented Aug 21, 2020

My idea is to update geogrid database to increase coast line resolution in my WRF simulations.
I got good improvements with Landuse data, which is single band. However, Albedo, Greenfraction and others multiband data I can't do because it is not working with GIS4WRF conversion tool.

If you know another way to do this, please share it with me.

Thank you for your attention.

Taoan

Greetings Taoan,
When I tried to alter the default landuse data in WRF using gis4wrf, it is throwing datum shift warning. Can I avoid this warning or should I do something else?
First of all I loaded the landuse data by add wps binary layer and then exported it to geotiff format.
Then I edited some grid boxes using Serval and then clicked on convert active layer to binary .
Thank you

@taoansf
Copy link
Author

taoansf commented Aug 29, 2020

Hello samp7,

I'm sorry for the late answer.
My sugestion is to adopt the WGS84 datum epsg:4326 to avoid conflicts.
This article can give you some orientations https://fabienmaussion.info/2018/01/06/wrf-projection/
I also recomend this plugin for raster edition https://github.com/SMByC/ThRasE

I hope this help you.

With best regards,

Taoan

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

No branches or pull requests

4 participants