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

Having trouble with readWDM #176

Open
mishranurag opened this issue Sep 3, 2024 · 1 comment
Open

Having trouble with readWDM #176

mishranurag opened this issue Sep 3, 2024 · 1 comment

Comments

@mishranurag
Copy link
Contributor

Hi

I tried to read two wdm files using HSP2tools. One file was read properly, and the other file gave the following error.

Is there an easy way to troubleshoot this issue?

Thanks
Anurag

File c:\\Users\\Anurag.Mishra\\miniconda3\\envs\\alafia_py311\\Lib\\site-packages\\hsp2\\hsp2tools\\readWDM.py:51, in readWDM(wdmfile, hdffile, compress_output)
     49         dsnlist.append(index)
     50 if len(dsnlist) != ntimeseries:
---> 51     raise RuntimeError (f'Wrong number of Time Series Records found expecting:{ntimeseries} found:{len(dsnlist)}')
     53 with pd.HDFStore(hdffile) as store:
     54     summary = []

RuntimeError: Wrong number of Time Series Records found expecting:75 found:74"
}
@timcera
Copy link
Contributor

timcera commented Sep 3, 2024

Sounds like a bad WDM file. Best bet is if you have a good copy somewhere else. Could also use "wdmrx" (might be installed with BASINS?) or wdmtoolbox has a "cleancopywdm" function which has saved some of my bad WDM files in the past.

from wdmtoolbox import wdmtoolbox
wdmtoolbox.cleancopywdm("in.wdm", "clean.wdm")

Note that "cleancopywdm" won't repair a time-series or WDM file. It just copies all the whole time-series that it finds.

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

2 participants