Particle Track in Python

671
2
11-20-2011 07:43 PM
VincentGreenwade
New Contributor
I am looking for a little python help. I am trying to add a function to the script for Spatial Analyst Particle Track that will allow me to point to a shape file (point) or point feature to get the coordinates for the particles. I've been stumbling through scripts trying to cobble something together from multiple sources and have run into a wall.

I have attached a copy of the python script as a reference. Any help would be much appreciated.

Thanks,

VG
Tags (2)
0 Kudos
2 Replies
StephanieWendel
Esri Contributor
It looks like how you have your code set up right now you are looping through the points and making the source point have many different points. But, the Particle Tracker help doc says that the source point is only one coordinate location, the start of the track. The OutTrack file also needs to be an ASCII text file. What it sounds like you need to do is take those xy coordinates that you get from for loop and write them into the text file which you can then use as your track. Explanation of reading and writing to a file.

If you have that ASCII file set up already but want the track to start at the point you've extracted from the shapefile in that For loop, then you will want to indent the checkout and particletrack so that it hits each point to run the track.

Hope this helps!
0 Kudos
VincentGreenwade
New Contributor
Thanks Stephanie,

The information that you provided was very helpful. It allowed us to break through the brick wall that is Python.We are trying to get around the one particle restriction you mentioned in your response by adding the ability to extract multiple particles from a single point feature. This is necessary in order to stream line our process of groundwater analysis at our site.
0 Kudos