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

Problem in projection of Grid DSS file #25

Open
hahabibi88 opened this issue Jun 24, 2021 · 11 comments
Open

Problem in projection of Grid DSS file #25

hahabibi88 opened this issue Jun 24, 2021 · 11 comments

Comments

@hahabibi88
Copy link

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!

@gyanz
Copy link
Owner

gyanz commented Jun 24, 2021

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.

@hahabibi88
Copy link
Author

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

@gyanz
Copy link
Owner

gyanz commented Jun 25, 2021

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

@hahabibi88
Copy link
Author

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.

@gyanz
Copy link
Owner

gyanz commented Jun 25, 2021

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

@hahabibi88
Copy link
Author

hahabibi88 commented Jun 25, 2021

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/"

@gyanz
Copy link
Owner

gyanz commented Jun 25, 2021

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?

@hahabibi88
Copy link
Author

hahabibi88 commented Jun 25, 2021

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

@gyanz
Copy link
Owner

gyanz commented Jun 25, 2021

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

@hahabibi88
Copy link
Author

hahabibi88 commented Jun 28, 2021

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.

@mdeshotel
Copy link

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.

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

No branches or pull requests

3 participants