pydsstools icon indicating copy to clipboard operation
pydsstools copied to clipboard

Problem in projection of Grid DSS file

Open hahabibi88 opened this issue 3 years ago • 11 comments

I am trying to create Spatial Grid DSS and the put_grid function works just fine when I use "specified" as grid type. But if want to create the dss grid in SHG CRS, I get the following error: grid_info['grid_crs'] = SHG_WKT NameError: name 'SHG_WKT' is not defined

This error is related to from related to utils.py (line 192-195). It seems the SHG_WKT is variable but no where is defined. Does anyone know who should I resolve the issue?

Thank you!

hahabibi88 avatar Jun 24 '21 21:06 hahabibi88

You are right. utils.py was missing SHG_WKT value. I have added statement to import this value. You may copy util.py from repository to your install location. I will update the wheel files later.

gyanz avatar Jun 24 '21 22:06 gyanz

Thank you! Now it runs without an error but when I use DSSVue to visualize it, I see the record is written but it doesn't open it (doesn't show the plot or grid info)! However, when I use the "specified" as the "grid_type", I can see the grid plot and and grid info! Is the detailed info CRS for "SHG_WKT" is defined somewhere in the scripts? I only could find this definition in the "SHG_WKT = SHG_SRC_DEFINITION" in the "constants.pyx" file but I think the following info should be defined somewhere, am I correct or I am missing something?

image

hahabibi88 avatar Jun 25 '21 15:06 hahabibi88

You can find the value of SHG_SRC_DEFINITION in the header file. Which version of HEC-DSSVue are you using?

gyanz avatar Jun 25 '21 16:06 gyanz

Thank you! I am using Version 3.2.3! Not sure, why the DSSvue doesn't show the recorded, although it is written to the file.

hahabibi88 avatar Jun 25 '21 16:06 hahabibi88

Can you post pathname for the grid record? It may have incorrect D- and E- parts.

gyanz avatar Jun 25 '21 16:06 gyanz

I notice something. I installed the pydsstools through the wheels and now when I checked, I see the "external" folder doesn't exist in the src folder! I couldn't install the tool from source code, so I used the wheels! Can I just copy the external folder in my install location?

and here is the pathname: "/GIRD/Drainage/PRECIPITATION/25Aug2017:1700/25Aug2017:1715/V0/"

hahabibi88 avatar Jun 25 '21 16:06 hahabibi88

The install location is not supposed to have the external folder. The external folder is used while building the library from source. The purpose of the wheel files is to bypass the "build from source" or compilation step. Can you remove the dates in the pathname and see if DSSVue shows the grid?

gyanz avatar Jun 25 '21 16:06 gyanz

I removed it and it not showing the record. Do you see anything unusual here:

image

When I use "specified" grid type, the results are OK but not sure if it can be read/used by HMS model since the projection is not (Albers)! do you have any experience on this? image image

hahabibi88 avatar Jun 25 '21 16:06 hahabibi88

SHG is an standard grid system for United States. Are you sure your xmin and ymax values are consistent with SHG grid?

gyanz avatar Jun 25 '21 23:06 gyanz

I am not sure if I am using the correct SHG grid. What I did is using xmin and ymax (the coordinates in meter for upper left corner of the upper left grid cell) which is xmin=890373.33 m and ymax=4257710.63 m and calculated lower left y as following:

lower_left_y= 4257710.63-51*1000= 4206710.63 m (51 is number of rows and 1000 is cell size) Then the "opt_lower_left_x" and "opt_lower_left_y" in SHG grid are calculated: "opt_lower_left_x"= floor (890373.33/1000)= 890 "opt_lower_left_y"= floor(4206710.63/1000)=4206 Am I missing something or this is correct?

Also I notice this error as well? Do you know why I get this error although I put 'grid_type' as 'albers' which 421? image

Thank you for your help.

hahabibi88 avatar Jun 28 '21 15:06 hahabibi88

Has this been resolved? I am having the same or similar issue. I am unable to get anything other than the 'specified' grid type to work. Using the 'specified' grid type allows me to view the grid in HEC-DSSVue but gives me issues when reading the resulting grid in HEC-HMS. If I try 'shg' or 'albers' as the grid type the dss file is populated with records but I am unable to view them.

mdeshotel avatar Nov 15 '21 12:11 mdeshotel