Git Product home page Git Product logo

pysplit's People

Contributors

cross85 avatar jdwarner avatar mscross avatar weber-s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pysplit's Issues

'shape mismatch' problrm in 'traj_trajgroup_basics_example.py'

hello,Mellisssa,
sorry to disturb you, but when I run 'traj_trajgroup_basics_example.py', I came across a problem that:when I run the code"traj.calculate distance()',there is an valueError:shape mismatch:value array of shape(121,)could not be broadcast to indexing result of shape(120,).

Getting error with reversetraj_clippedtraj_gen

I am getting an error with reversetraj_clippedtraj_gen.py in line 46 which is described below image:
image
Since there are none values in the Temperature_C field so '> or <' is not supported. I have used the GDAS1 meteorological input files for generating trajectories. Please fix this error, why I am getting none values in the temperature field?

AttributeError: module 'geopandas' has no attribute 'GeoDataFrame'

Hi Melissa!

Sorry to raise another issue. When I try and run the files that I generated in bulk_traj.py in the hysplit_clustering.py example you give I get the error:

trajgroup = pysplit.make_trajectorygroup(r'C:/trajectories/quel/clippedtraj/quel*')
Traceback (most recent call last):

File "", line 1, in
trajgroup = pysplit.make_trajectorygroup(r'C:/trajectories/quel/clippedtraj/quel*')

File "C:\Users\maurerj\Anaconda3\lib\site-packages\pysplit\hy_processor.py", line 76, in make_trajectorygroup
trajectories.append(Trajectory(data, path, datetime, head,

File "C:\Users\maurerj\Anaconda3\lib\site-packages\pysplit\traj.py", line 55, in init
HyPath.init(self, trajdata, pathdata, datetime, trajheader)

File "C:\Users\maurerj\Anaconda3\lib\site-packages\pysplit\hypath.py", line 36, in init
self.data = gp.GeoDataFrame(data=alongpath[:, 1:],

AttributeError: module 'geopandas' has no attribute 'GeoDataFrame'


I made sure that all of the clipped trajectories are in the proper folder and done correctly. I also tried messing around with the last part of the file path (/quel*) but the error still went on. Am I missing something easy?

Thanks!!!

Problem with running Pysplit

Hello Melissa,

I hope that you are doing well. I am trying to use Pysplit. I am using Jupyter with Python 2.7 and I have the following problem. I tried very hard to follow your steps in the Github repository examples but when I am not able to make it work.

  1. I am running the following command:
    import pysplit
    pysplit.generate_bulktraj("Example", hysplit_working="C:/hysplit4/working", output_dir="C:/Users/dell/Dropbox/Pysplit/trajectories/facilityexample", meteo_dir="C:/Users/dell/Dropbox/Pysplit/gdas", years=[2005], months=[6], hours= [6,12,18], altitudes=[500,1500], coordinates=(34.4326157, -119.9028486), run=48, monthslice=slice(0, 32, 1), meteo_bookends=([0]), get_reverse=False, get_clipped=False, hysplit="C:/hysplit4/exec/hyts_std")

  2. I get the following error:


AttributeError Traceback (most recent call last)
in ()
1 import pysplit
----> 2 pysplit.generate_bulktraj("Example", hysplit_working="C:/hysplit4/working", output_dir="C:/Users/dell/Dropbox/Pysplit/trajectories/facilityexample", meteo_dir="C:/Users/dell/Dropbox/Pysplit/gdas", years=[2005], months=[6], hours= [6,12,18], altitudes=[500,1500], coordinates=(34.4326157, -119.9028486), run=48, monthslice=slice(0, 32, 1), meteo_bookends=([0]), get_reverse=False, get_clipped=False, hysplit="C:/hysplit4/exec/hyts_std")

AttributeError: 'module' object has no attribute 'generate_bulktraj'

I was wondering if you think this is due to an installation problem or something. I hope that you can help me and sorry if the question is too basic.

Best,
Danae

Running PYSPLIT using Python 3.6 version

Dear Mellisa, how are you?
My name is Fábio and I'm currently working at UNiversity of São Paulo-Brazil using a Lidar system to investigate vertical distribution and optical properties of aerosol. I use HYSPLIT to retrieve back-trajectory information to constrain information of aerosol from biomass burning all around Brazilian territory.
The PYSPLIT tools that you developed is power and wonderful, and I'm very interested to use. However, I'm using Python 3.6 version and I'm not able to run it. Do you have a perspective of when the PYSPLIT version for Python 3.6 will be launch?
In the next days I'll try to run it using Python 2.7 in another computer, can I contact you if I have any trouble?
My best regards
Fabio

Meteo File Over-population

Hi Mellissa,

This issue is in reference to my pull request -- re: _meteofinder function with NARR data.

The meteo file generator function is calling too many NARR files for the years 1998,1999,2000, and 2001. Attached are several screenshots of an example of the January 1999, which triggers the error in HYSPLIT because a CONTROL file cannot have more than 12 meteo files for a single run.

I am still not sure why this happens when using 2-digits to search. I have also attached an example of the pysplit_meteofinder function and my modified meteofinder function from my pull request for the same month/year example, which identifies the correct NARR meteo files using 4- instead of 2-digits for the year.

Best,
Maria

screenshot 7

screenshot 8

screenshot 9

screenshot 11

screenshot 12

An issue with labelfile_generator

Hi Mellissa
I just followed your 2018 paper. And I met with this problem when running codes from line 74 to 76.

# Make then edit text file of labels
pysplit.labelfile_generator(r'F:/trajectories/umn/umnlabels.txt', example='west')

Then, a KeyError is reported:

KeyError                                  Traceback (most recent call last)
<ipython-input-18-5f357be86803> in <module>()
      1 # Make then edit text file of labels
----> 2 pysplit.labelfile_generator(r'F:\trajectories\umn\umnlabels.txt', example=['west'])

B:\anaconda3\envs\pysplitenv\lib\site-packages\pysplit\maplabeller.py in labelfile_generator(labelfile, example)
    257         example = 'east'
    258 
--> 259     labels = lbdict['example']
    260 
    261     with open(labelfile, 'w') as labelfile:

KeyError: 'example'

How can I solve this problem?

Best regards,
Tingvan

Error in trajectory generation on python 3.6.1

Hi,

I am new to Pysplit, but I used Hysplit before. I read and follow the SCIPY 2015 paper as well as the comments in examples and source code to understand Pysplit technically. When I run the most basic example: bulk_tarajgen_example.py, it shows error message about "can't do nonzero end-relative seeks". Anybody has ideas how to debug this?

In the Command Prompt on Windows 10:
I run python bulk_trajgen_example.py, then:

Percent complete: 99.2
Percent complete: 100.0
Complete Hysplit
Traceback (most recent call last):
File "bulk_trajgen_example.py", line 139, in
monthslice=slice(0, 32, 1), get_reverse=True)
File "C:\Users\Zhengyu\Anaconda3\lib\site-packages\pysplit\trajectory_generator.py", line 144, in generate_bulktraj
meteo_dir, meteofiles, controlfname)
File "C:\Users\Zhengyu\Anaconda3\lib\site-packages\pysplit\trajectory_generator.py", line 211, in _reversetraj_whilegen
traj.seek(lastline_start, 2)
io.UnsupportedOperation: can't do nonzero end-relative seeks

However, I successfully run the bulk_trajgen_example.py on older version of python 2.7 and produce trajectory files. Then I run the basic_plotting_example.py, it got failed as "MatplotlibDeprecationWarning": some of functions in matplotlib, such as get_axis_bgcolor, was not readable in python 2.7. So, I just reinstall the new version of Python to upgrade 3.6.

I need some help to go trough this bugs.
Thanks,
RZX

sort() method for trajGroup

Hi Melissa,
Would it be possible to include a sort() method to TrajectoryGroup which is sorting the trajectories based on their IDs in trajids?

The trajectory files that I have are named in a logical, unique way, e.g. YYYY-MM-DD-HH.txt. I thought of something like pandas DataFrame sorting function. An easy way would be to load trajectories and trajids in a DataFrame and apply its sort function. That would imply though to import pandas. For now, when I create my TrajectoryGroup I use

import pysplit as pys
traj_dir = r'/my/directory/to/files/*'
trajGroup = pys.make_trajectorygroup(traj_dir)

which imports all trajectory files in that directory but in a random order. For plotting it would be cool to have the trajGroup in order.

Cheers,
Nic

Trouble with integration error - bad reverse trajectory

HI,
I am using pysplit to generate backtrajectories.
When calculating the integration error, sometimes, this error comes up "Trajectory C:/Users/User/Desktop/serv_trajs/london17\london17dec0000winter20171201031.0 has a bad reverse trajectory:

                      120 hours instead of 51 hours

It happens for many trajectories to end in 👍
AttributeError: 'Trajectory' object has no attribute 'integration_error'

I am not sure what this means and how to fix it either, any suggestions?
Many thanks in advance

ValueError: Invalid literal for int() with base 10 : 'n'

Hi I'm having a strange issue trying to run bulk trajectories and I was hoping someone could help me out. I'm using python 3.8.8 through Spyder on windows 10. I'm trying to run 72 hour back trajectories every 6 hours for Jan 2013. I have files from week 4 and 5 of December '12 and week 1 of Feb '13. No matter what I try I keep getting the error:

Traceback (most recent call last):

  File "C:\hysplit\HYSPLIT_Stuff\HYSPLIT_forAlex\Python_scripts\bulk_traj.py", line 161, in
    pysplit.generate_bulktraj(basename, working_dir, storage_dir, meteo_dir,

  File "C:\Users\maurerj\Anaconda3\lib\site-packages\pysplit\trajectory_generator.py", line 138, in generate_bulktraj
    meteofiles = _meteofinder(meteo_dir, meteo_bookends, m, y,

  File "C:\Users\maurerj\Anaconda3\lib\site-packages\pysplit\trajectory_generator.py", line 382, in _meteofinder
    if int(each_file[file_number]) in meteo_bookends[0]:

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


My files are all named according to the instructions in the script (gdas1.jan13.wk1) and are all .bin files (gdas1.jan13.wk1.bin). The only way I think this error could happen is if the function is mistaking the file extension for the end of the file name? I've tried to make sure that it's only reading the actual file by slicing the strings but still have no luck.

If anyone has any input I would appreciate it a ton! I'm completely at a loss here and running up against a deadline pretty soon.

Error in TrajGroup-ing

Hi Mellissa,

I have been using pysplit with no issues, and suddenly came across this issue when grouping trajectories. It is my first time seeing it. What does this mean? It happened just after I downloaded the latest hysplit version (January 2017), but I am not sure if that would have anything to do with it.

I'd appreciate any guidance.

Best,
Maria

In [245]:
...: trajgroup = pysplit.make_trajectorygroup(r'C:/trajectories/bulktest
...: /jan')

ValueError Traceback (most recent call last)
in ()
1
----> 2 trajgroup = pysplit.make_trajectorygroup(r'C:/trajectories/bulktest/jan')

C:\Anaconda2\envs\pysplitenv\lib\site-packages\pysplit\hy_processor.pyc in make_trajectorygroup(signature)
59 for hyfile in hyfiles:
60
---> 61 data, path, head, datetime, multitraj = load_hysplitfile(hyfile)
62
63 if multitraj:

C:\Anaconda2\envs\pysplitenv\lib\site-packages\pysplit\hyfile_handler.pyc in load_hysplitfile(filename)
104 # Got the date, time direction from the OMEGA line
105 del data[1:8]
--> 106 hydata[arr_ind, :] = data[:2] + data[5:]
107 pathdata[arr_ind, :] = data[2:5]
108 arr_ind += 1

ValueError: cannot copy sequence with size 32 to array axis with dimension 11

errors in generating trajectories using ERA meteo data

Hi Mellissa,

I have no problem in generating trajectories using NCAR or GDAS meteo data. I tried to generate bulk trajectories using ERA-interim meteo data. However, I run into wrong information in Jupyter Notebook. Here is the code I run:

# run 2017 Jan traj with ERA
import pysplit
working_dir = r'C:/hysplit4/working'
storage_dir = r'C:/trajectories/201701/PA'
meteo_dir = r'C:/era'
basename = 'PuntaArenas'
years = [2017]
months = [1]
hours = [3, 9, 15, 21]
altitudes = [500, 1000, 1500,2000]
location = (-53.000, -70.967)
runtime = -120
pysplit.generate_bulktraj(basename, working_dir, storage_dir, meteo_dir,
                          years, months, hours, altitudes, location, runtime,
                          monthslice=slice(0, 32, 1), meteo_bookends=([4, 5], [1]), get_reverse=True, get_clipped=True)

Here is the error information:


ValueError Traceback (most recent call last)
in ()
12 pysplit.generate_bulktraj(basename, working_dir, storage_dir, meteo_dir,
13 years, months, hours, altitudes, location, runtime,
---> 14 monthslice=slice(0, 32, 1), meteo_bookends=([4, 5], [1]), get_reverse=True, get_clipped=True)

C:\Users\Zhengyu\Anaconda2\lib\site-packages\pysplit\trajectory_generator.pyc in generate_bulktraj(basename, hysplit_working, output_dir, meteo_dir, years, months, hours, altitudes, coordinates, run, monthslice, meteo_bookends, get_reverse, get_clipped, hysplit)
143 if get_reverse:
144 _reversetraj_whilegen(trajname, run, hysplit, output_rdir,
--> 145 meteo_dir, meteofiles, controlfname)
146
147 if get_clipped:

C:\Users\Zhengyu\Anaconda2\lib\site-packages\pysplit\trajectory_generator.pyc in _reversetraj_whilegen(trajname, run, hysplit, output_rdir, meteo_dir, meteofiles, controlfname)
201
202 # Get reverse trajectory start information
--> 203 year = int(data[2])
204 mon = int(data[3])
205 day = int(data[4])

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

I checked the generated trajectory files: for each starting altitude, the last file was missing (2017 January 31 21h). It is also the case for clipped traj and reverse traj. If there is no error information, the total number of trajectories should be 4×4×31=496. However, it comes to only 492. The 31th 21h are missing. Do you know what's the reason based on error information?

btw, I downloaded ERA-interim data in weekly interval and converted them into ARL-readable files using HYSPLIT. The ERA meteo files are like GDAS files here; each represents weekly data.

how can i plot the right graph?

hi Mellissa!

I want to plot a different color graph for each day.

So I made two codes.

The first one is

`import pysplit

trajgroup = pysplit.make_trajectorygroup(r'C:\Users\lg\Desktop\trajectory\jeju06*.txt')

with open(r"C:\Users\lg\Desktop\trajectory\jeju060100-500.txt"),open(r"C:\Users\lg\Desktop\trajectory\jeju060200-500.txt"),open(r"C:\Users\lg\Desktop\trajectory\jeju060300-500.txt") as traj:
contents = traj.readlines()

color_dict = {1 : 'red',
2 : 'green',
3 : 'blue'}

for traj in trajgroup :
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = color_dict[day]

mapcorners = [0, 00, 160, 80]
standard_pm = None
bmap_params = pysplit.MapDesign(mapcorners, standard_pm)
bmap = bmap_params.make_basemap()

for traj in trajgroup[::1]:
print(traj.filename)
bmap.plot(*traj.path.xy, c=traj.trajcolor, latlon=True, zorder=20)`

_

And second one is

`import pysplit

trajgroup = pysplit.make_trajectorygroup(r'C:\Users\lg\Desktop\trajectory\jeju06*.txt')

with open(r"C:\Users\lg\Desktop\trajectory\jeju060100-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'red'

with open(r"C:\Users\lg\Desktop\trajectory\jeju060200-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'orange'

with open(r"C:\Users\lg\Desktop\trajectory\jeju060300-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'yellow'

with open(r"C:\Users\lg\Desktop\trajectory\jeju060400-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'green'

with open(r"C:\Users\lg\Desktop\trajectory\jeju060500-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'blue'

with open(r"C:\Users\lg\Desktop\trajectory\jeju060600-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'black'

with open(r"C:\Users\lg\Desktop\trajectory\jeju060700-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'purple'

with open(r"C:\Users\lg\Desktop\trajectory\jeju060800-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'blue'

with open(r"C:\Users\lg\Desktop\trajectory\jeju060900-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'blue'

with open(r"C:\Users\lg\Desktop\trajectory\jeju061000-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'blue'

with open(r"C:\Users\lg\Desktop\trajectory\jeju061100-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'blue'

with open(r"C:\Users\lg\Desktop\trajectory\jeju061200-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'blue'

with open(r"C:\Users\lg\Desktop\trajectory\jeju061300-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'blue'

with open(r"C:\Users\lg\Desktop\trajectory\jeju061400-500.txt") as traj:
contents = traj.readlines()
last_timepoint = 9
data = contents[last_timepoint].split()
day = int(data[4])
traj.trajcolor = 'blue'

mapcorners = [0, 00, 160, 80]
standard_pm = None
bmap_params = pysplit.MapDesign(mapcorners, standard_pm)
bmap = bmap_params.make_basemap()

for traj in trajgroup:
print(traj.filename)
bmap.plot(*traj.path.xy, c=traj.trajcolor, latlon=True, zorder=20)
`

then Its results are shown in the following figures.

image

image

How can I make the right graph?

Best Regards
Chaelin.

Issue with Hysplit_Clustering

Hello,I have got the trajectories with the 'pysplit.generate_bulktraj.py', now I want to cluster these trajectories, so I use the 'Hysplit_Clustering.py' code . But I hit a wall: the first is what kind of file 'CLUSLIST_7' is, it's a file or a directory ,when I run ' traj_assignment = r'C:/hysplit4/cluster/working/CLUSLIST_7', there is no problem, but when I run 'clusgroup = pysplit.spawn_clusters(trajgroup, traj_assignment, clusterpath_dir)', there is error. I don't know why. Do I need to do anything with the software 'Hysplit'?
image
@mscross

Issue with TRATIO suggestion

In the trajectory_generator.py file, the following suggestion is in generate_bulktraj.

It is also recommended to change TRATIO in the SETUP file to 0.25 to limit integration error.

However, after running a bulk set of trajectories with tratio at 0.25, errors were generated in some of the reverse trajectories leaving the files blank inside, because the final initial trajectory point is outside the meteorology file domain. This behavior is surprising because I believe the trajectories are supposed to stop if they exit the meteo file domain.

After generating the trajectories again with the default tratio of 0.75, I see the errors no longer exist, and reverse trajectories are generated correctly. Bringing this issue up so others can check their reverse trajectory files.

EDIT
Issue actually still seems to persist even with tratio at 0.75. Not quite sure why this issue is being triggered with reverse trajectories...

It only appears to happen to a few of the reverse trajectories so it may not be a huge deal to just count this as an error and remove the trajectories from the analysis, but I won't know the aggregate count until I generate all my trajectories which are in the millions so it may be a while before I know. I am also considering to try to generate these odd reverse trajectories again after my bulk generation is complete using earlier timesteps. Would appreciate any feedback if anyone has dealt with this issue. This issue occurs for me when using either the Linux or Windows Hysplit versions.

screen shot 2017-08-27 at 7 37 12 pm

screen shot 2017-08-27 at 7 53 23 pm

Problem displaying the basemap.

I'm using python 3.6 in a virtual environment of anaconda to run pysplit. I use Spyder to run the scripts.
I'm trying to get the pictures from a cluster run, and the trajectories are shown ok, but I don't get any basemap or coordinates in the image. Just trajectories and clusters.
Any idea what could be the problem?

I followed this instructions, maybe are not updated to python 3.6?:

https://github.com/mscross/pysplit/blob/master/docs/examples/hysplit_clustering.py

Problem loading 'hysplitfile'

I'm using the 0.35 version of pysplit. I run it once without a problem, but now with another run of hysplit I get this error message:

File "C:\Miniconda3\envs\pysplitenv\lib\site-packages\pysplit\hy_processor.py", line 63, in make_trajectorygroup
    data, path, head, datetime, multitraj = load_hysplitfile(hyfile)

  File "C:\Miniconda3\envs\pysplitenv\lib\site-packages\pysplit\hyfile_handler.py", line 146, in load_hysplitfile
    if len(contents[ind + 1]) > len(contents[ind + 2]):

IndexError: list index out of range

This happens when I run this line from the cluster analysis docs/examples/hysplit_clustering.py
trajgroup = pysplit.make_trajectorygroup(r'C:/hysplit4/E-3/endpts/fdump*')

the fdump* files seems to be ok, and I run Hysplit with no problem, so I can't figure out what could be the problem here.

moisture uptake and flux analysis

Hello, Mellissa

I had some technical questions about moisture uptake and flux parts. I see in the closed issues, Maria has raised it already (Feb 16, 2017), but I was still confused.

moisture = []
for traj in trajgroup:
traj.moisture_uptake(precipitation=-0.2,evaporation=0.2,interval=3)
moisture.append(traj)

  1. Here she used "moisture.append(traj)" before running "traj.moisture_uptake()". If running "traj.moisture_uptake()", each trajectory will calculate its moisture uptake data (method) and add uptake data to the trajectory (object) itself, is that right? Then, why do I need to use append method to add new traj to moisture list? After running four lines of codes, is the moisture list same with the trajgroup list?

  2. You recommend using scatter plotting to visualize the data with gradient color and you provide example code. After run moisture_uptake(), I can get the information about the uptake location as well as how much moisture is uptaken. Is that correct? Then gradient plotting of moisture uptake is possible. However, as moisture uptake is calculated every 6h, if plotting moisture uptake data along trajectory, do I need to plot against the trajectory midpoint (3h after each window) coordinate within the uptake window?

  3. Any caveat on choosing the evaporation and precipitation threshold value in moisture uptake calculation? I see Baldini et al. (2010) mentioned they used 0.5g/kg specific humidity threshold within 6h. If I want to follow this method, I should set precipitation threshold -0.2, but evaporation threshold 0.7?

  4. For publication, if I want to generate a figure to argue that for example 2010 summer has heavier rainfall isotope because moisture is coming from adjacent ocean while 2011 summer has lighter rainfall isotope because moisture is coming from terrestrial recycled water, I should use plot of moisture uptake or moisture flux? Which one is better in terms of science? I see in your 2015 conference paper, you use moisture flux, but other papers still prefer moisture uptake.

  5. Also, I think in Figure 2, many colored scatter trajectories are overlaid/covered by other trajectories. Have you thought about trying to adding up all trajectory scatter values in one grid and plot something like raster plots? By doing this, you can visualize the total moisture flux/uptake within certain grid in that season, and better say something like the major moisture source is from Bay of Bengal and minor source is from South China Sea. How do you think of this? I see the paper [Extreme rainfall events in southern Sweden: where does the moisture come from?] did this. Another new paper, [Quantification of the impact of moisture source regions on the oxygen isotope composition of precipitation over Eagle Cave, central Spain] plotted moisture uptake percentage on map, which is something I want.

Sorry for too many questions!

RZX

NAM 12km Meteorology

Hi Mellissa,

I have been using the web-based version of HYSPLIT to generate many trajectories with the NAM 12 km (pressure) meteorology. Because this process is onerous, I was wondering if your trajectory_generator function supports these NAM files, which are produced daily at 6 hr intervals. Following your instructions for the GDAS files, I get an error, presumably because the filenames are formatted differently. Any help is appreciated!

Thanks,
Tim

[Errno 2] No such file or directory: 'examplenov1500spring2017112403' error when generating bulk traj

I am having receiving this error when attempting to generate bulk trajectories by pysplit.generate_bulktraj. I am under the assumption that using generate_bulktraj should return new files in my traj directory. I am seeing the error after the hysplit model is finished.

I am new to pysplit and don't have a lot of experience coding in general, any help would be appreciated. Below is my code.

import os
import numpy as np
import netCDF4 as nc
import pysplit as py
from matplotlib import pyplot as plt
os.chdir('/Users/petergombert')

#directories
working_direc = r'hysplit4/working'
final_direc = r'traj'
metero_direc = r'/Users/petergombert/hysplit4/gdas1'

py.generate_bulktraj('example', working_direc, final_direc, metero_direc, [2017], [11], [3, 6, 9, 12], [1500], (-63.79, 111.78), 24, monthslice = slice(23, 24, 1), get_reverse=False, get_clipped=False, hysplit='/Users/petergombert/hysplit4/exec/hyts_std')

Where is the picture to show?

Hello, I can run the basic_scatterplotting.py and basic_plotting_example.py, but where is the picture, it doesn't show. I run pysplit on LINUX

Issues with bulk_trajgen_example.py on linux !!!

Hello,
I tried to run bulk_trajgen_example.py code in the Linux system but ended with some error. The prompted error says unable to locate the met files. But I believe I gave the right path. What could be the possible reason? Please help me out.

Thanks

Capture

ValueError: LineStrings must have at least 2 coordinate tuples

Hi..

Thanks a lot for your informationa but after updating pysplit i have got another issues using this code (trajgroup = pysplit.make_trajectorygroup('C:/trajectories/jnushyam/aug') .

AttributeError Traceback (most recent call last)
C:\Users\Shyam\Anaconda3\lib\site-packages\shapely\geometry\linestring.py in geos_linestring_from_py(ob, update_geom, update_ndim)
199 # From array protocol
--> 200 array = ob.array_interface
201 assert len(array['shape']) == 2

AttributeError: 'list' object has no attribute 'array_interface'

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)
in ()
----> 1 trajgroup = pysplit.make_trajectorygroup('C:/trajectories/jnushyam/aug')

C:\Users\Shyam\Anaconda3\lib\site-packages\pysplit\hy_processor.py in make_trajectorygroup(signature)
74 trajectories.append(Trajectory(data, path, datetime, head,
75 folder, hyfile, clipdir,
---> 76 multitraj))
77
78 # initialize trajectory group

C:\Users\Shyam\Anaconda3\lib\site-packages\pysplit\traj.py in init(self, trajdata, pathdata, datetime, trajheader, folder, filename, cfolder, multitraj)
52 If True, is from a file containing multiple trajectories
53 """
---> 54 HyPath.init(self, trajdata, pathdata, datetime, trajheader)
55
56 self.data.rename(columns={'AIR_TEMP': 'Temperature',

C:\Users\Shyam\Anaconda3\lib\site-packages\pysplit\hypath.py in init(self, alongpath, pathdata, datetime, header)
37 columns=header[1:], geometry=pts)
38
---> 39 self.path = LineString(pts)
40
41 self.data['DateTime'] = datetime

C:\Users\Shyam\Anaconda3\lib\site-packages\shapely\geometry\linestring.py in init(self, coordinates)
47 BaseGeometry.init(self)
48 if coordinates is not None:
---> 49 self._set_coords(coordinates)
50
51 @Property

C:\Users\Shyam\Anaconda3\lib\site-packages\shapely\geometry\linestring.py in _set_coords(self, coordinates)
92 def _set_coords(self, coordinates):
93 self.empty()
---> 94 self._geom, self._ndim = geos_linestring_from_py(coordinates)
95
96 coords = property(BaseGeometry._get_coords, _set_coords)

C:\Users\Shyam\Anaconda3\lib\site-packages\shapely\geometry\linestring.py in geos_linestring_from_py(ob, update_geom, update_ndim)
256 if m < 2:
257 raise ValueError(
--> 258 "LineStrings must have at least 2 coordinate tuples")
259
260 def _coords(o):

ValueError: LineStrings must have at least 2 coordinate tuples

Interestingly, if I use to remove the * fromaug (i.e aug*)
(trajgroup = pysplit.make_trajectorygroup('C:/trajectories/jnushyam/aug*') then thiis command shows no error but executing the next commands don't display the trajectory map. To generate the traj map , I used the follwing commands to display the map with trajectory at jupyter notebook on window 10.

years = [2016] months = [2,6,8,11] hours = [11, 17, 23] altitudes = [500, 1000, 1500] location = (28.70, 77.14) runtime = -120 monthslice=slice(0, 32, 2)

pysplit.generate_bulktraj(basename, working_dir, storage_dir, meteo_dir, years, months, hours, altitudes, location, runtime, monthslice)

trajgroup = pysplit.make_trajectorygroup(r'C:/trajectories/jnushyam/aug*')

`mapcorners = [40, -15, 170, 60]

standard_pm = None`

bmap_params = pysplit.MapDesign(mapcorners, standard_pm)

bmap = bmap_params.make_basemap()

`color_dict = {500.0 : 'blue',

          1000.0 : 'orange',

          1500.0 : 'black'}`

`for traj in trajgroup:

altitude0 = traj.data.geometry.apply(lambda p: p.z)[0]

traj.trajcolor = color_dict[altitude0]`

`for traj in trajgroup[::5]:

bmap.plot(*traj.path.xy, c=traj.trajcolor, latlon=True, zorder=20)`

Thanks
shyam-aug-2016.zip

Problem loading hysplit file with multiple trajectories

There seems to be a bug in the pysplit code intended for reading a hysplit file with multiple trajectories in it. I was able to trace it back and fix the issue, and I'll try to explain it below.

The function load_hysplitfile() (inside file hyfile_handler.py) decides if it is reading a file with a single or multiple trajectories in it:

def load_hysplitfile(filename)
# (... many lines...) 
    # Split hydata into individual trajectories (in case there are multiple)
    if multiple_traj:
        hydata, pathdata, datetime = _trajsplit(hydata, pathdata, timedata,
                                                century)
    else:
        print('hmjb', timedata)
        datetime = _getdatetime(century, timedata)

Function _trajsplit() will then sort the hysplit lines, so that all lines corresponding to the same trajectory are grouped:

def _trajsplit(hydata, pathdata, timedata, century):
# (... many lines...) 
    # Find number of unique trajectories within `hydata`
    unique_traj = np.unique(hydata[:, 0])

    # Sort the array row-wise by the first column
    # Timepoints from same traj now grouped together
    sorted_indices = np.argsort(hydata[:, 0], kind='mergesort')
    sorted_hydata = hydata[sorted_indices, :]
    sorted_pathdata = pathdata[sorted_indices, :]
    sorted_timedata = timedata[sorted_indices, :]

It then tries to identify (in the sorted arrays) where is the start position (i.e. first line number) for each trajectory.

    # Find first occurrence of each traj, except for the first
    # which is obviously 0
    first_occurrence = [np.nonzero(sorted_indices == u)[0][0]
                        for u in unique_traj[1:]]

The problem happens at this point.

The code takes each trajectories number (in my case, trajectories 1 to 8) and search for all the positions (in the sorted arrays) where that trajectory occurs. The problem is the use of sorted_indices, which hold the positions in the sorted array. If we print the values in sorted_indices[:] we will have numbers 0 to the number of lines in the hysplit file (in my case, 124).

The correct would be to use sorted_hydata[:,0] which is the first column (i.e. ID of trajectory) in the sorted arrays. If we print the values in sorted_hydata[:,0], they will be those in unique_traj (in my case, 1 to 8). The corrected code looks like this:

    # Find first occurrence of each traj, except for the first
    # which is obviously 0
    # BUG first_occurrence = [np.nonzero(sorted_indices == u)[0][0]
    first_occurrence = [np.nonzero(sorted_hydata[:,0] == u)[0][0]
                        for u in unique_traj[1:]]

Could any of the developers have a look and confirm this?

Hyfile_Handler Date (Year) Labeling Issue

Hi Mellissa,

I just realized all my trajectories from the 1900's are showing up as 2000's in PySPLIT --- the load_hysplitfile( ) function in hyfile_handler.py adds a "20" to every year read in:

    datestrings = []

    for d in date0:

        datestrings.append("20" +

            "{0:02}{1:02}{2:02}{3:02}".format(*[int(x) for x in d]) +

            '0000')

Can we add an option for years in the 1900's? I'd be happy to put together a pull request! Or, do you have an easy fix in mind? The dates show up in HYSPLIT as two digits, as you already know --- e.g. 1979 below.

Best,
Maria

screenshot 5

The system cannot find the file specified

Hi Mellissa,

I have been trying to run the docs/examples/bulk_trajgen_example.py but I am getting this error when running it:

File "C:\Users\Danny Vargas.conda\envs\pysplitenv\lib\subprocess.py", line 1207, in _execute_child
startupinfo)

FileNotFoundError: [WinError 2] The system cannot find the file specified

I am running it in Windows 10, python=3.6 and use spyder 5.0 to run the code. I followed all the instructions from the github repository and your paper but I could not make any progress solving it. May you please help me with this issue. Many thanks.
Danny

KeyError: 'Temperature' during running the 'trajgroup'

Dear Cross,

Thank you for contributing your time for developing wonderful trajectory package.

I am new in Python and Pysplit, when I follow your example and rerun your code I am getting the following issues:

When I ran the command pysplit.generate_bulktraj(basename, working_dir, storage_dir, meteo_dir, years, months, hours, altitudes, location, runtime, monthslice), it didn't showed any error but when I go to next step and run the command ,

vtrajgroup = pysplit.make_trajectorygroup(r'C:/trajectories/jnushyam/*aug*')

it showed the following error

KeyError Traceback (most recent call last)
C:\Users\Shyam\Anaconda3\lib\site-packages\pandas\indexes\base.py in get_loc(self, key, method, tolerance)
1944 try:
-> 1945 return self._engine.get_loc(key)
1946 except KeyError:

pandas\index.pyx in pandas.index.IndexEngine.get_loc (pandas\index.c:4154)()

pandas\index.pyx in pandas.index.IndexEngine.get_loc (pandas\index.c:4018)()

pandas\hashtable.pyx in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:12368)()

pandas\hashtable.pyx in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:12322)()

KeyError: 'Temperature'

During handling of the above exception, another exception occurred:

KeyError Traceback (most recent call last)
in ()
1 import pysplit
----> 2 trajgroup = pysplit.make_trajectorygroup(r'C:/trajectories/jnushyam/aug')

C:\Users\Shyam\Anaconda3\lib\site-packages\pysplit\hy_processor.py in make_trajectorygroup(signature)
80 else:
81 trajectory = Trajectory(data, path, datetime, head, folder,
---> 82 hyfile, clipdir)
83
84 trajectories.append(trajectory)

C:\Users\Shyam\Anaconda3\lib\site-packages\pysplit\traj.py in init(self, trajdata, pathdata, datetime, trajheader, folder, filename, cfolder)
61 inplace=True)
62
---> 63 self.data['Temperature_C'] = self.data['Temperature'] - 273.15
64 if self.data.get('Mixing_Depth') is None:
65 self.data['Mixing_Depth'] = None

C:\Users\Shyam\Anaconda3\lib\site-packages\geopandas\geodataframe.py in getitem(self, key)
374 GeoDataFrame.
375 """
--> 376 result = super(GeoDataFrame, self).getitem(key)
377 geo_col = self._geometry_column_name
378 if isinstance(key, string_types) and key == geo_col:

C:\Users\Shyam\Anaconda3\lib\site-packages\pandas\core\frame.py in getitem(self, key)
1995 return self._getitem_multilevel(key)
1996 else:
-> 1997 return self._getitem_column(key)
1998
1999 def _getitem_column(self, key):

C:\Users\Shyam\Anaconda3\lib\site-packages\pandas\core\frame.py in _getitem_column(self, key)
2002 # get column
2003 if self.columns.is_unique:
-> 2004 return self._get_item_cache(key)
2005
2006 # duplicate columns & possible reduce dimensionality

C:\Users\Shyam\Anaconda3\lib\site-packages\pandas\core\generic.py in _get_item_cache(self, item)
1348 res = cache.get(item)
1349 if res is None:
-> 1350 values = self._data.get(item)
1351 res = self._box_item_values(item, values)
1352 cache[item] = res

C:\Users\Shyam\Anaconda3\lib\site-packages\pandas\core\internals.py in get(self, item, fastpath)
3288
3289 if not isnull(item):
-> 3290 loc = self.items.get_loc(item)
3291 else:
3292 indexer = np.arange(len(self.items))[isnull(self.items)]

C:\Users\Shyam\Anaconda3\lib\site-packages\pandas\indexes\base.py in get_loc(self, key, method, tolerance)
1945 return self._engine.get_loc(key)
1946 except KeyError:
-> 1947 return self._engine.get_loc(self._maybe_cast_indexer(key))
1948
1949 indexer = self.get_indexer([key], method=method, tolerance=tolerance)

pandas\index.pyx in pandas.index.IndexEngine.get_loc (pandas\index.c:4154)()

pandas\index.pyx in pandas.index.IndexEngine.get_loc (pandas\index.c:4018)()

pandas\hashtable.pyx in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:12368)()

pandas\hashtable.pyx in pandas.hashtable.PyObjectHashTable.get_item (pandas\hashtable.c:12322)()

KeyError: 'Temperature'


It would be great for me if you have any suggestion for to solve this issues.

Thanks
Shyam

No results when running basic_plotting_example.py

Hello!
I am new in python but found the pysplit package that could help me a lot in my research.
I am a Linux user and was trying to run some examples. I successfully got the trajectory files after running the bulk_trajgen_example.py.
However when I want to plot a map using the basic_plotting_example.py:
$ python basic_plotting_example.py
I get the following error:
"mypath/pysplit/hyfile_handler.py:373: FutureWarning: The pandas.datetime class is deprecated and will be removed from pandas in a future version. Import from datetime module instead.
times.append(pd.datetime(*[int(x) for x in i]))"

Any idea on what can be the issue?

A little question without your python code?

I saw the source code in pysplit.
There is a function that aims to genarate the CONTROL file
and later run the hysplit model, hyts_std.exe.

but i run hyts_std.exe in cmd.exe while the CONTROL was existed.
it still need to give some parameters line by line?

how can i solve it?

[important] Domain height issue.

Hi all,

I don't have much time to address this however for the domain height / top of model Hysplit webclient is using 17k
to fix this discrepancy I edited Line 459 in trajectory_generator.py when i was working on this a few weeks ago.

This is 10k by default. There should be an option to change this in future.

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

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.

Traceback Error: "OutOfBoundsDatetime: Out of bounds nanosecond timestamp" when calling make_trajectorygroup

Hello Mellissa,

This is my first time using HYSPLIT and pysplit. I am trying to create some trajectory plots from HYSPLIT trajectories that I have run previously using the HYSPLIT Windows GUI. I started by trying to follow your example basic_plotting_example.py.

When I try to run the command:
trajgroup = pysplit.make_trajectorygroup(fpath)

It returns the following error:
OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 4016-08-31 23:00:00

I am not sure where this error comes from or how I can trace it back to its source. It is possible that it could be an error in how I initialized the HYSPLIT trajectory in the first place. For instance the datetime for this trajectory should be 2016-08-31 23:00:00 not 4016. I can't find any information in the HYSPLIT documentation about this.

Have you seen this problem before? Do you have any ideas for how I might fix it in python without having to re-run all my trajectories? I am not sure if this is the right place to post this question but I hope you might point me in the right direction.

I am using python 3.6.

Thank you!

Heather

Problem generating bulk trajectories with ERA5 data

I get the error:
"ValueError: invalid literal for int() with base 10: 'L'"
I am using the example script for trajectory generation with pysplit with ERA5 data. My data is global, with 0.75 * 0.75 spatial resolution, every 6 hours. Download and Transformation of the data to ARL format seems correct, in fact, trajectory generation works fine with the hysplit version for windows. Also, the pysplit script works fine with data from ERA Interim.

I would appreciate some help with this.

Screenshot from 2021-11-01 06-46-06

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

Hi

I'm using python 3.6 in a virtual environment of anaconda to run pysplit.
I'm using JupyterLab to run the scripts.

I tried to run the "bulk_trajgen_example.py" script, but I find the following error message.

Someone find the same error ?

I'm beggniner in python


ValueError Traceback (most recent call last)
in
151 years, months, hours, altitudes, location, runtime,
152 monthslice=slice(0, 32, 2), get_reverse=True,
--> 153 get_clipped=True)
154
155 """

~\Anaconda3\lib\site-packages\pysplit\trajectory_generator.py in generate_bulktraj(basename, hysplit_working, output_dir, meteo_dir, years, months, hours, altitudes, coordinates, run, meteoyr_2digits, outputyr_2digits, monthslice, meteo_bookends, get_reverse, get_clipped, hysplit)
168 if get_reverse:
169 _reversetraj_whilegen(trajname, run, hysplit, output_rdir,
--> 170 meteo_dir, meteofiles, controlfname)
171
172 if get_clipped:

~\Anaconda3\lib\site-packages\pysplit\trajectory_generator.py in _reversetraj_whilegen(trajname, run, hysplit, output_rdir, meteo_dir, meteofiles, controlfname)
228 year = int(data[2])
229 mon = int(data[3])
--> 230 day = int(data[4])
231 hour = int(data[5])
232 lat = float(data[9])

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

How to run trajectory generation from NCAR/NCEP monthly data?

Hi,

I have no issues when using GDAS weekly data. But when running traj generation from NCAR/NCEP monthly data, there is an error message:

working_dir = r'C:/hysplit4/working'
storage_dir = r'C:/trajectories/PA_NCAR/Jan'
meteo_dir = r'C:/NCAR'
basename = 'PA'
years = [1990]
months = [1]
hours = [15]
altitudes = [500, 1000, 1500, 2000]
location = (-52.060, -72.031)
runtime = -120
pysplit.generate_bulktraj(basename, working_dir, storage_dir, meteo_dir,
years, months, hours, altitudes, location, runtime,
monthslice=slice(0, 32, 1),
meteo_bookends=([1], [1]),
get_reverse=True,
get_clipped=True,
meteoyr_2digits=False)

The NCAR/NCEP files' names were changed to:
RP.dec1989.1.gbl
RP.jan1990.1.gbl

I set yr_2digits to false; I set meteo_bookends to 1, as they are both monthly data, not weekly data. Pysplit should be able to read the code, but it did not. The error message is:

---> 17 meteoyr_2digits=False)
ValueError: invalid literal for int() with base 10: 'l'

Do you have any insights into this problem?? I am using version 0.3.4.

Best,
Ryan

Changing the hysplit model top height

Hi, I have been looking at using PySPLIT for handling hysplit back trajectories for volcanic plumes. These often go above 10000m so I would like to be able to raise the top height of the model, but I couldn't see a way of setting this in generate_bulktraj. On inspecting trajectory_generator I noticed that the top height is set in _populate_control and fixed to 10000 m.

If I wanted to change the top height of the model can I simply change this value? Would there be any problems with other pysplit functionality? I noticed there is a altitude check in _reversetraj_whilegen, are there any others that would need changing?

Thanks in advance.

Ben

Question: Moisture Uptake Code

Hi Mellissa,

I realize you are still working on the example code for the plotting of moisture uptake along backward trajectories, but since my early research is very dependent on these results, I have been attempting to figure it out and would like to know if you have any feedback on how to correct it. I still need to add the integration error and rainstatus (setting it so that the backward trajectories begin if precipitation is occurring) in the loop and am pretty confident I understand how to do those steps, but my main concern is getting the moisture uptake values to show up along the trajectory paths. I saw the ".map_data_line" and ".map_data_scatter" examples in the 2015 scipy manuscript and presentation, but can't seem to find those commands in PySPLIT. I have therefore attempted to use ".plot" and ".scatter" with Basemap with some success, but while the values vary for different trajectories, they don't vary along the trajectories. In my attempt below, there are 65 trajectories, ran backwards, over 100 hours, at 1000 metersAGL. I have attached the generated figure. Thank you so much for your time and work on PySPLIT! Any guidance is appreciated.

Best,
Maria

Here is my code:

`trajgroup = pysplit.make_trajectorygroup(r'C:/trajectories/janstudy/jan1000')

fig = plt.figure()

bmap = pysplit.mapdesigner.Basemap(llcrnrlon = -115,
llcrnrlat = 10,
urcrnrlon = -65,
urcrnrlat = 40,
projection = 'aea',
lat_1 = 10,
lat_2 = 40,
lon_0 = -90,
lat_0 = 25)

bmap.drawmeridians(np.arange(int(-130),int(-60),10),labels=[0,0,0,1],linewidth=0.5)
bmap.drawparallels(np.arange(int(10),int(60),5),labels=[1,0,0,0],linewidth=0.5)
bmap.drawstates()
bmap.drawcoastlines()
bmap.drawcountries()

bmap.drawmapboundary(color='k',linewidth=1.0,fill_color='0.90')
bmap.fillcontinents(color='0.80', lake_color=None)

moistureup = []

for traj in trajgroup:
traj.moisture_uptake(-0.2,0.5,interval=6,
vlim='prs')
moistureup.append(traj)

new_group = pysplit.TrajectoryGroup(moistureup)

colors = np.linspace(0, 2, 65)

for traj, color in zip(new_group[::], colors):
params = {'zorder' : 24,
'latlon' : True,
'c' : plt.cm.Blues(color)}
bmap.plot(*traj.path.xy,
**params)

plt.show()`

trajuptakesolidpaths

FileNotFoundError: [WinError 2] The system cannot find the file specified

Hi all,

I googled this as well. So example data and my own data from gdas are giving this error in the title. I do not know why

import pysplit
working_dir = r'C:/hysplit/working'
storage_dir = r'T:/trajectories/July17'
meteo_dir = r'T:/Globus/gdasJuly17'
basename = 'island'
years = [2017]
months = [7]
hours = [6] #UTC
altitudes = [2000] 
location = (-7, -15)  
runtime = -48 

pysplit.generate_bulktraj(basename, working_dir, storage_dir, meteo_dir,
                          years, months, hours, altitudes, location, runtime,

                         )

Troubleshooting:

  1. Reinstalled the entire python environment -- using recommended 3.7 settings from main page
  2. Change forward to backward slashes
  3. Reinstalled hysplit
  4. Changed directories again
  5. Ran sfc /scannow
  6. added .BIN
    

I dont understand this error pysplit was working fine end of last week on my windows PC with the example .py bulk trajectory example. I checked the file directories they are correct. The troubleshooting took awhile and now I am still kind of stuck.

Now even with the example this occurs
image

This is what the control file says:
image

File directory if needing to inspect the size of the files. I guess I could run hysplit but I would rather run pysplit
image

I was able to do this previously. I have no idea why the program breaks.
image

Question Regarding Moisture Uptake Trajectories

Hi Melissa,

I am a Python and Hysplit user, and was very happy to find Pysplit for use in my research as a PhD student. However, I have a basic question regarding moisture uptake calculations. I would like to calculate the moisture uptake at the 900 pressure level as suggested in your 2015 Scipy paper...
My understanding is that this is a calculation applied to already generated trajectories. Should I be applying this calculation to trajectories generated at the 900hPa in Hysplit (since we can't generate trajectories at pressure levels yet in Pysplit)? Or can this calculation be applied to any Pysplit generated trajectory height (i.e., 10mAGL, 1000mAGL, etc.)? Or should I be creating the trajectories in Pysplit with the moisture uptake option? Please advise.

Currently, I am running this code below on backward trajectories generated in Pysplit at the 10mAGL, but am still figuring out how to make the color gradient vary by value as can be done with the cmap options in regular python matplotlib plotting:

moisture = []
for traj in trajgroup:
traj.moisture_uptake(precipitation=-0.2, evaporation=[0.2], interval=3)
moisture.append(traj)

Best,
Maria

Issue with trajectory analysis commands

Hi,

I've been learning how to use PySPLIT as part of my undergraduate research credit, and have been running into a few technical issues. I have the most recent version of HYSPLIT (April 2018), and use Jupyter notebooks.

I can generate my necessary trajectory files/trajgroups with no issues, but when I try to analyze my trajectories, I hit a wall--using traj.calculate_distance(), traj.calculate_vector(), and traj.calculate_moistureflux() will not work for me. The first screenshot is my error for the first two traj commands, and the second is my specific humidity error. I don't know how to go about fixing this issue, so any guidance would be very helpful!

(result of traj.calculate_distance(), traj.calculate_vector())
image
(result of traj.calculate_moistureflux())
image

Kayla

Ensemble mode in back trajectory

Will it be possible to add ensemble mode in the code, I was going through one of the forum of HYSPLIT and the following is suggested in one of the posts using bash script,

#!/bin/sh

MDL="${HOME}/hysplit4"
MET="${HOME}/Tutorial/captex"
OUT="."
cd $OUT

if [ ! -f ASCDATA.CFG ]; then
echo "-90.0 -180.0" >ASCDATA.CFG
echo "1.0 1.0" >>ASCDATA.CFG
echo "180 360" >>ASCDATA.CFG
echo "2" >>ASCDATA.CFG
echo "0.2" >>ASCDATA.CFG
echo "$MDL/bdyfiles/" >>ASCDATA.CFG
fi
echo $0

echo "83 09 25 17 " >CONTROL
echo "3 " >>CONTROL
echo "38.00 -84.00 750.0 " >>CONTROL
echo "44.00 -74.00 750.0 " >>CONTROL
echo "39.00 -83.00 750.0 " >>CONTROL
echo "6 " >>CONTROL
echo "0 " >>CONTROL
echo "10000.0 " >>CONTROL
echo "1 " >>CONTROL
echo "$MET/ " >>CONTROL
echo "captex2_narr.bin " >>CONTROL
echo "./ " >>CONTROL
echo "fdump " >>CONTROL

rm -f SETUP.CFG
${MDL}/exec/latlon 
${MDL}/exec/hyts_std
${MDL}/exec/trajplot -v0 -z80 -j${MDL}/graphics/arlmap -ifdump 
cat trajplot.ps >>results.ps

rm -f fdump trajplot.ps
# gs results.ps

Apparently, a file named latlon creates the latitude and longitude for the ensemble and then 'hyts_std' is run for each of the coordinates. It will be great if its possible to include something called in bulk_trajectory.py so that user can choose the mode he wants.

Thanks,
Nirav

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.