respec / HSPsquared

Hydrologic Simulation Program Python (HSPsquared)
GNU Affero General Public License v3.0
43 stars 17 forks source link

Converting error from WDM to HDF5 file format with own dataset. #37

Closed scalet98 closed 3 years ago

scalet98 commented 3 years ago

Hello !
Currently, I am trying to apply your code with my dataset. So for now, I am trying to converting wdm file to HDF5 format.

After I applying my own dataset (as a test I used BASINS4 sample sediment dataset which is mostly larger dataset(56timeseries) than your test01 code(19timeseries)) with your ReadWDM module, I have got an error as below picture shows.

106986773_644429486148620_1507050922593792267_n

Point-1

Point-2

If you know why it is coming up. Please let me know.
Thank you for developing this package and reading this question.

Jiheon Lee.

PaulDudaRESPEC commented 3 years ago

I think the issue is related to the WDM attributes available on those data sets. It seems to me the ReadWDM code looks for this list of attributes: search = ['STAID', 'STNAM', 'SCENARIO', 'CONSTITUENT','LOCATION'] If it finds any of them, it expects the same set to exist for all the data sets.

A quick work-around might be to add the missing attributes so that the same set exists for each timeseries in the WDM file.

scalet98 commented 3 years ago

PaulDuda ! Thank you !

Unexpectedly, solution is too simple. I did not expect that the sample file has the corrupted parts. I was just obsessed with the code. After adding the missing parts in the sample code, all things works very well :)

I was too serious about the issue I think. I checked out every single line in the code.

Always, Simple is the best way !~ Thank you again !

Jiheon Lee :)

I think the issue is related to the WDM attributes available on those data sets. It seems to me the ReadWDM code looks for this list of attributes: search = ['STAID', 'STNAM', 'SCENARIO', 'CONSTITUENT','LOCATION'] If it finds any of them, it expects the same set to exist for all the data sets.

A quick work-around might be to add the missing attributes so that the same set exists for each timeseries in the WDM file.

PaulDudaRESPEC commented 3 years ago

Glad I could help!
I believe it is an issue to be fixed, in that it should not be a requirement that there be the same set of attributes on each WDM timeseries data set.

scalet98 commented 3 years ago

Hello !~ PaulDuda !

Yes I think It needs to be upgraded for more general case application. But if it is not, more users will study about your code probably. :)

I have one more question. In the ReadWDM file, you are using the number 512 in the code line 37. ( I have attached the related pic with red line marker below)

I appreciate your help. Thank you for reading the comments again !~

Best regards, Jiheon Lee

code

Glad I could help! I believe it is an issue to be fixed, in that it should not be a requirement that there be the same set of attributes on each WDM timeseries data set.

PaulDudaRESPEC commented 3 years ago

I believe the 512 is the record length in the WDM file, but I'm at the limit of my knowledge in that territory. Someone else on the team may have to answer the follow-on questions.

scalet98 commented 3 years ago

Hello ! PaulDuda !

Thank you for your kind reply. It was not my territory either, but I just wanted to understand the code thoroughly.

I think I need to upload the question again or contact the code designer directly. Thank you ! Have a good one !~:)

Jiheon Lee.

I believe the 512 is the record length in the WDM file, but I'm at the limit of my knowledge in that territory. Someone else on the team may have to answer the follow-on questions.