Hello,Aref
I hope this message finds you well. Sorry to bother you with this, but I'm having some trouble running the WRF_Hydro_Regridding_Spatial_Weights.py script and was hoping you might be able to offer some guidance.
I've been encountering an error that says: "TypeError: in method 'Geometry_Transform', argument 2 of type 'OSRCoordinateTransformationShadow *'". Interestingly, I get the same error even when using your script and input files directly.
I did some searching online and it seems this might be related to the GDAL package version. Would you be able to share which version of GDAL you were using when you successfully ran the script? I believe this information could really help me resolve the issue.
I also wanted to ask about how you prepared the input shp file. I generated the basn_msk raster using ArcGIS with the wrf_hydro_arcgis_preprocessor tool, and then exported it to a shp file. I was wondering if this approach is appropriate, or if there might be a better way to create the required shp file.
Thank you so much for your time and help. I truly appreciate any advice you might be able to offer.
Best regards,
Zed Li
conda
–version
conda create -n gdal_env python=3.10 gdal netCDF4 numpy -c conda-forge
conda activate gdal_env
python -c "from osgeo import gdal, ogr, osr; print('GDAL loaded
successfully')"
conda install -c conda-forge libgdal-netcdf
then if you are submitting a job, add this section to your job script on HPC:
# Load conda
environment
source ~/.bashrc
conda activate gdal_env
cd
/home/fatemehs/WRB/wrf_hydro_arcgis_preprocessor-master
python3
WRF_Hydro_Regridding_Spatial_Weights.py
Best regards,
Fatemeh
--
You received this message because you are subscribed to the Google Groups "wrf-hydro_users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wrf-hydro_use...@ucar.edu.
To view this discussion visit https://groups.google.com/a/ucar.edu/d/msgid/wrf-hydro_users/c2b35c3b-565c-4f3e-a32b-47b31181f1edn%40ucar.edu.
Hi Aref,
Thank you so much for your helpful response!
The GDAL and Python version information you provided was exactly what I needed. I have now successfully set up the environment, and the script ran without any issues—generating both the Model_grid.tif and spatialweights_out.nc files.
I really appreciate your guidance on the shapefile modification as well.
Thanks again for your kind support!
Best regards,
Zed Li
Hi Fatemeh,
Thank you so much for your detailed and helpful response!
I really appreciate you taking the time to share the exact environment setup and job submission instructions.
I followed the steps you provided and have successfully configured the software environment. Your guidance was incredibly valuable and made the process smooth and straightforward.
Thanks again for your kind assistance!
Best regards,
Zed Li