Open xigrug opened 5 years ago
I try to run the bulk_trajgen_example.py on linux system : years = [2013] months = [8] hours = [5] altitudes = [10, 3000, 6000] location = (32.04, 118.78) runtime = -120
the data is :
gdas1.aug2013.w1 gdas1.aug2013.w3 gdas1.aug2013.w5
gdas1.aug2013.w2 gdas1.aug2013.w4
gdas1.jul2013.w4 gdas1.jul2013.w5
gdas1.sep2013.w1
pysplit.generate_bulktraj(basename, working_dir, storage_dir, meteo_dir, years, months, hours, altitudes, location, runtime, monthslice=slice(0, 32, 2), get_reverse=True, get_clipped=True,hysplit='/public/home/hysplit/hysplit_study/trunk/exec/hyts_std')
hysplit@admin[examples]$ python bulk_trajgen_example.py HYSPLIT4 - Initialization USE: svn info | tail -n3 to fill in these three records with the version information! Calculation Started ... please be patient ERROR sfcinp: ASCDATA.CFG file not found! See MESSAGE file for more information ['13', '8', '1', '5', '32.040', '118.780', '10.0'] I print the data[4] is the latitude not the day Traceback (most recent call last): File "bulk_trajgen_example.py", line 174, in
get_clipped=True,hysplit='/public/home/hysplit/hysplit_study/trunk/exec/hyts_std') File "/public/home/hysplit/software/anaconda3/lib/python3.6/site-packages/pysplit/trajectory_generator.py", line 170, in generate_bulktraj meteo_dir, meteofiles, controlfname) File "/public/home/hysplit/software/anaconda3/lib/python3.6/site-packages/pysplit/trajectory_generator.py", line 230, in _reversetraj_whilegen day = int(data[4]) ValueError: invalid literal for int() with base 10: '32.040'
Windows also has the same problem, when I change the code, it didn't work.
year = int(data[0])
mon = int(data[1])
day = int(data[2])
hour = int(data[3])
lat = float(data[4])
lon = float(data[5])
alt = float(data[6])
hysplit@admin[examples]$ python bulk_trajgen_example.py HYSPLIT4 - Initialization USE: svn info | tail -n3 to fill in these three records with the version information! Calculation Started ... please be patient ERROR sfcinp: ASCDATA.CFG file not found! See MESSAGE file for more information xigrugaug0010summer2013080105 [' 8 1\n', ' GDAS 13 7 22 0 0\n', ' GDAS 13 7 29 0 0\n', ' GDAS 13 8 1 0 0\n', ' GDAS 13 8 8 0 0\n', ' GDAS 13 8 15 0 0\n', ' GDAS 13 8 22 0 0\n', ' GDAS 13 8 29 0 0\n', ' GDAS 13 9 1 0 0\n', ' 1 BACKWARD OMEGA \n', ' 13 8 1 5 32.040 118.780 10.0\n', ' 1 PRESSURE\n'] ['13', '8', '1', '5', '32.040', '118.780', '10.0'] HYSPLIT4 - Initialization USE: svn info | tail -n3 to fill in these three records with the version information! Calculation Started ... please be patient ERROR sfcinp: ASCDATA.CFG file not found! See MESSAGE file for more information [' 8 1\n', ' GDAS 13 7 22 0 0\n', ' GDAS 13 7 29 0 0\n', ' GDAS 13 8 1 0 0\n', ' GDAS 13 8 8 0 0\n', ' GDAS 13 8 15 0 0\n', ' GDAS 13 8 22 0 0\n', ' GDAS 13 8 29 0 0\n', ' GDAS 13 9 1 0 0\n', ' 1 BACKWARD OMEGA \n', ' 13 8 1 5 32.040 118.780 10.0\n', ' 1 PRESSURE\n'] Traceback (most recent call last): File "bulk_trajgen_example.py", line 174, in
get_clipped=True,hysplit='/public/home/hysplit/hysplit_study/trunk/exec/hyts_std') File "/public/home/hysplit/software/anaconda3/lib/python3.6/site-packages/pysplit/trajectory_generator.py", line 173, in generate_bulktraj _cliptraj(output_cdir, trajname) File "/public/home/hysplit/software/anaconda3/lib/python3.6/site-packages/pysplit/trajectory_generator.py", line 308, in _cliptraj if len(contents[ind + 1]) > len(contents[ind + 2]): IndexError: list index out of range
Hey xigrug,
I am definitely not an expert on that sort of stuff, but I just had the same error and solved it in my case by following the hint of the error message.
It says
ERROR sfcinp: ASCDATA.CFG file not found!
In my case I found this file in the HySPLIT GUI\working
directory. Running pysplit.generate_bulktraj()
with the correct working directory parameter (hysplit_working = your/path/to/HySPLIT GUI/working
) solved the problem.
Good luck!
I have not yet tested PySPLIT on Linux.
ValueError: invalid literal for int() with base 10: '32.040' Looks like #54. What version of HYSPLIT are you using and can you attach the file that is throwing the error?
I have used PySPLIT successfully on Linux, with HYSPLIT revision version 868 (back in 2017). I have not used it with the latest HYSPLIT version yet though.
Can you give you HYSPLIT revision version 868 on Linux?
If the pysplit can run with the hysplit on LINUX which also have "hycs_std" file.