Select to view content in your preferred language

Create multiple graphs from large geodatabase table

1740
10
08-23-2013 06:56 AM
ModernElectric
Frequent Contributor
Greetings

     I have a rather large project I am trying to do and I hope I can get Python to do it for me. I have a file geodatabase table called "SERVICE METERS DEMAND" which is basically composed of the peak demand reading on an electric meter for a given month. I have the range of readings from November 2011 to March 2013. The table contains about 172,000 total records with almost 10,000 electric meters.

     What I want to be able to do is to take an individual meter by number (TWACs Number) and create a graph visually showing the peak demand for each month. This would be used by our engineering department and our meter techs for analysis and decisions making. The big thing is - I update this table about 4 times a year so my geodatabase can have the latest demand readings that other departments use. With that being said, I would like to create a script that can automatically create all new graphs and export them out to a .PDF format. I can than use the Attachment geoprocessing tools to link those .PDF graphs to the meter locations.

     Do you think this is something that can be done by Python? If so - how do I start this.

I currently have ArcMap 10.0 on one machine and in the process of testing a bunch of different tools/processes on ArcMap 10.2 on a different machine.

Thank you in advance.
Can send a sample of the SERVICE METERS DEMAND table as well
Tags (2)
0 Kudos
10 Replies
ModernElectric
Frequent Contributor
Excellent! It is great that you have written out a plan, many people don't and then get hopelessly lost... It definitely looks possible.

Right now we'll get step 1 partly working, just printing to screen. Once that is good we can put the data in a useful data structure, rather than just printing it.

I think James' suggestion, of using Pandas, is good. I haven't used it myself, but I think it works pretty well with time data and plotting functions. So there is something else you will need to look up and have a play with...

Do you intend to only ever assess one meter at a time? You have a few options, but for now we may as well keep part 1 collecting all the data, and between part 1 and part 2 define the one METER NUMBER to make the graph of.


Stacy-

     Thank you for the posts. So far - I do not have much code written since I am still in the research and design phase of this project to get to the final outcome. Really looking for advice and maybe examples of different parts of the overall Python code. So far - I have some great information from different people to research and start doing some trial and error.

The only thing I do not have yet:
    How do I go about taking a Python script and making a "One-Click" custom button in ArcMap that when someone clicks on it - it runs the Python Script in the background?
0 Kudos