mscross / pysplit

A package for HYSPLIT air parcel trajectory analysis.
BSD 3-Clause "New" or "Revised" License
149 stars 80 forks source link

Blank back trajectories are generated, with only column names of along trajectory meteorology, no data in the rows #79

Open Pasvolo opened 3 years ago

Pasvolo commented 3 years ago

I am still learning python, and I am trying to get back trajectories as follows: pysplit.generate_bulktraj('kor', r'C:/hysplit/working', r'E:/trajectories/kor', r'E:/gdas', [2019], [10], [21], [100, 500], (38.419, -5.083), -168, meteo_bookends=([1,2]),monthslice= slice(8,-22,1), get_clipped= True, get_reverse= True, hysplit='C:\hysplit\exec\hyts_std')

The gdas files I used are in this format gdas1.oct19.w1 and gdas1.oct19.w2. I have tried to figure out where is the mistake but did not succeed. Please help where i am making a mistake. Thank you.

Pasvolo commented 3 years ago

The trajectory looks like this: 2 1 GDAS 19 10 1 0 0 GDAS 19 10 8 0 0 1 BACKWARD OMEGA
19 10 9 21 38.419 -5.083 500.0 10 PRESSURE THETA AIR_TEMP RAINFALL MIXDEPTH RELHUMID SPCHUMID H2OMIXRA TERR_MSL SUN_FLUX

mscross commented 3 years ago

meteo_bookends in your case should be ([], []), indicating no files from the previous month and none from the next month, though I don't think that will fix the problem.

Some things to try/ investigate: Does the same thing happen if you choose a different day, say the 10th? What if you generate the original trajectory directly in the HYSPLIT program? Is there actual data in your GDAS files (size greater than 0)? Has your altitude setting in HYSPLIT been changed from the default meters above ground level to meters above sea level?

Pasvolo commented 3 years ago

Dear Mellissa, Thank you for the quick response, let me investigate suggestions you have given then I will give feedback here. Pasvolo.

Pasvolo commented 3 years ago

Hi, After changing the meteo_bookends to ([1], [2]) and the altitude set to meters AGL, the results were still blank trajectories. And after changing to either 10th, 8th, 7th, the output still was blank trajectories. I decided to test what will happen if I set the monthslice to whole month, i.e (0,32,1), the output was 62 blank trajectories, 31 for the 100 m AGL and 31 for the 500 m AGL. I thought it will throw an error that there is not enough data to run the whole month. Any suggestion will be appreciated. The data files are attached here for your reference. gdas1.oct19.zip

Thank you.

Pasvolo commented 3 years ago

In addition, the warning text file in the working directory says: WARNING metset: Only one time period of meteo data. When I tried to run in HYSPLIT it gave this error: Model started ... HYSPLIT - Initialization HYSPLIT version: hysplit.v5.0.0 Last Changed Date: 2020-05-13 NOTICE: using namelist file SETUP.CFG

WARNING metset: Only one time period of meteo data WARNING metset: Only one time period of meteo data Calculation Started ... please be patient ERROR metpos: start point not within (x,y,t) any data file

mscross commented 3 years ago

Your GDAS files are messed up, there is essentially no meteorology data inside them. The normal size of a w1, w2, w3, w4 data file is 584853 KB; the normal size of a w5 is 83551 to 250651 KB; your files are 1036 and 592 KB.

Pasvolo commented 3 years ago

Thank you Mellissa for this observation. I redownload the data again.

Pasvolo commented 3 years ago

Hi, Sorry, I am following all step to downloading the gdas1 weekly files as shown in the two attached pdf files. finally the file called extract_23380.zip is downloaded. After unzipping with WinRAR the result is extract_23380.bin, I do not know at this point why the extracted file is not in the format that is recognized by PySPLIT, can I rename it to the gdas1.oct19.w1 say for example? Another thing I wonder is the file size after extraction is smaller than the normal gdas1 w1, w2, w3, w4 file size. Please help where I am making a mistake, thank you a lot. READY -gdas1_oct19_w1.pdf READY -.pdf extract_23390.zip

mscross commented 3 years ago

It looks like you're extracting a square rather than a global meteorology file. Try downloading from here: ftp://arlftp.arlhq.noaa.gov/archives/gdas1/

Pasvolo commented 3 years ago

Hi, thank you for the address, i have tried but it does not work. Then I tried downloading the era5 data and converted to HYSPLIT format and renamed to era5.oct19.w1 and era5.oct19.w2, after running this code:import os os.environ['PROJ_LIB'] = r'C:\Users\User\anaconda3\pkgs\proj4-5.1.0-hfa6e2cd_1\Library\share' from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import pandas as pd import numpy as np import pysplit pysplit.generate_bulktraj('kor', r'C:/hysplit/working', r'E:\trajectories\kor', r'E:\gdas', [2019], [10], [21], [100, 500], (38.419, -5.083), -168, meteo_bookends=([1],[2]),monthslice= slice(8,-22,1), get_clipped= False, get_reverse= False, hysplit='C:\hysplit\exec\hyts_std')

The following error was raised:

Traceback (most recent call last):

File "C:\Users\User\anaconda3\envs\pysplitenv\lib\shutil.py", line 791, in move os.rename(src, real_dst)

FileNotFoundError: [WinError 2] The system cannot find the file specified: 'koroct0100autumn2019100721' -> 'E:\trajectories\kor\koroct0100autumn2019100721'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "E:\EcMwF\PysPLiT_Umn.py", line 9, in pysplit.generate_bulktraj('kor', r'C:/hysplit/working',

File "C:\Users\User\anaconda3\envs\pysplitenv\lib\site-packages\pysplit\trajectory_generator.py", line 176, in generate_bulktraj shutil.move(trajname, final_trajpath)

File "C:\Users\User\anaconda3\envs\pysplitenv\lib\shutil.py", line 805, in move copy_function(src, real_dst)

File "C:\Users\User\anaconda3\envs\pysplitenv\lib\shutil.py", line 435, in copy2 copyfile(src, dst, follow_symlinks=follow_symlinks)

File "C:\Users\User\anaconda3\envs\pysplitenv\lib\shutil.py", line 264, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:

FileNotFoundError: [Errno 2] No such file or directory: 'koroct0100autumn2019100721'

I have tried to solve this error without success, please any one with a suggestion on how to solving this error.

Thank you,