mattkjames7 / PyGeopack

Wrapper for geopack-08 used for the Tsyganenko magnetic field models
GNU General Public License v3.0
11 stars 2 forks source link

ValueError: invalid literal for int() with base 10: '' #24

Open hibiki23333 opened 2 weeks ago

hibiki23333 commented 2 weeks ago

This process may take a while, please be patient Updating Kp Indices No files to update. Updating OMNI Data No files to update. Reading OMNI Data Reading Kp Indices Traceback (most recent call last): File "/home/yt/code/test.py", line 2, in gp.Params.UpdateParameters(SkipWParameters=True) File "/home/yt/miniconda3/envs/geopack/lib/python3.8/site-packages/PyGeopack/Params/UpdateParameters.py", line 48, in UpdateParameters data = _CalculateParameters(SkipWParameters) File "/home/yt/miniconda3/envs/geopack/lib/python3.8/site-packages/PyGeopack/Params/_CalculateParameters.py", line 388, in _CalculateParameters data,kp = _LoadData(years) File "/home/yt/miniconda3/envs/geopack/lib/python3.8/site-packages/PyGeopack/Params/_CalculateParameters.py", line 330, in _LoadData kp = kpindex.GetKp() File "/home/yt/miniconda3/envs/geopack/lib/python3.8/site-packages/kpindex/GetKp.py", line 27, in GetKp YM = np.array([np.int32(x[3:7]) for x in idx.FileName]) File "/home/yt/miniconda3/envs/geopack/lib/python3.8/site-packages/kpindex/GetKp.py", line 27, in YM = np.array([np.int32(x[3:7]) for x in idx.FileName]) ValueError: invalid literal for int() with base 10: ''

hibiki23333 commented 2 weeks ago

This may be due to the fact that the file name format in the kp data file is not consistent with the expectation of the code. so,I changed the code: "YM = np.array([np.int32(x[3:7]) for x in idx.FileName if x[3:7].isdigit()])" now, it seems to be working fine.