thanks Brian uh and thanks for putting this series together I think it's really uh will be useful for me too to hear about what everyone else is doing so I'm going to talk about uh using epics Channel access and python together um and some of the basics of the libraries and then a few of the applications that have been developed over the last few years and including some stuff that's still in progress for data collection um so many of you have seen much of this before because because about half of this talk is going to be just on the channel access library for python it's just using python to talk to epics um but I wanted to make sure that everyone was aware of how easy it is to do epics Channel access from within python so so often in the past when I talked about these things I always started with why use Python at all but so I think most of the people at the aps now recognize that it's a good alternative for um scripting or controlling uh experiments as well as doing data analysis and the the real features that are important for it are that there's lots of scientists using python it they're mostly using it for its elegance and its ease of easy to read aspects um and crossplatform and of course all the all the stuff you expect from any high level objectoriented language these days and it's free in MO most senses of the word free and there's a lot of scientific libraries available for it numpy and Si scipi together give you all of the numeric uh and numerical processing things you need lay pack fast for transforms fitting algorithms and so on um so and so there's many scientists in many domains using these tools and you can just build on what they've done so the the pi epics Channel access um library for python has sort of three layers this was this is after some years of of working out how to do this right um it turns out that it has three layers the lowest level is a very close mapping of the channel access shared object Library so it's really it's just like C only it's in Python so it's as close to C as you would want to get um and has all of essentially all of the features of the cap API and it uses the dll the this dll built with epic space on top of that is built a PV object so that you have an object-oriented view more pythonic like view where you have a process variable that has methods and attributes that is fairly easy to use and if you're doing any significant programming with python and want and channel access the PV is the right way to go um and there's also on top of that a procedural layer which is CA get CA put CA monitor which are and CA info which are just just like the the command line tools you would have at a Unix or or Windows command line or what's available from ECA um and those are that's the simplest interface actually it does most of what you want but the other stuff is there when you need to dig deeper down into uh working with Channel access so that and I'll I'll also talk about several higher level python objects built on top of the PV object so the procedural interface is the easiest to use and that this is just CA put and CA get like you'd have in a dozen languages and and on the command line so you just import the functions and you use the string PV name and you can get the value you can get the value am I again yes uh and you can put the value and there are options for for the most common options for put would be to wait until the processing is complete uh before returning uh so this this P VI or CA put with a weight could hang for uh some unspe some for some amount of time and then for CA get you may want to get not only the raw value but a string representation of the value so the in new name state name for an INE or a formatted Flo floating Point number uh and again yeah that's okay I'll I'll it'll keep me on my toes um so again this just this does 90% of what you need so if you're new to epics Channel access Andor python like if you just use this you'll you'll get all the way but we have some time I have an hour left so we can see what else we can do to make this more complicated so there is there's also an info that lists the control Fields Avail that uh come with a PV and there's um a monitor which is a a very simple monitoring of a PV this just prints out a message for every value change you can you can use CA Monitor and to and pass in your own python function that will be called instead of just doing a print but once you get to that point of point of of sophistication you might as well use a PV which can do the same thing uh slightly more robustly uh the ca put info Monitor and gets uh use a global cache of process variables internally this is like ECA does so that each CA get does not make a new connection to the PV again if if if you don't know much about epex and that's you didn't understand what I just said that's fine but for the experts in the room it it does work like ECA in keeping um connections established so the PVE object is actually also very easy to use um you here you create a PV object using the PV Creator um and then this has many that features or many attributes including methods so you can just get the count and the type and you can there's a get uh uh method that you can call for that a put method and in addition to using these methods you can also just write to the value or read from the value so PV value. value equals three is the same as doing a put and you can read the value this way you can also do a get with an as string which will do a formatted uh formatted string of the of the of a double or the ene label for the for uh an enum uh PV and the PV then you you'll notice for for the epics people you'll notice that this this handled all all of the connection management it does use connection callbacks it uses actually event callbacks so that a get really retrieves the last uh the last cached value from an internal callback and this and that just handles it all for you um so that it's a very easy to use object you can also then uh add a call back so that for events so that you can have so that you can tell it to run some function when the value of P of a PV changes and then you can just wait for those changes to happen so the event callbacks and I'll go into this a little bit in a little detail because the most of the Callback functions use the same uh convention that use the the python um keyword call signatures so you want to use this uh you want to use a call Signature that is uses keyword value pairs um and then once that happens that will just be you can just add that call back you can add several callbacks for a PV which is convenient um later on I'll show you why that's convenient and then you can just run and allow the changes to happen uh so the Callback function takes a lot of arguments all with keyword pair so you can you can fold them all into the star star keywords convention for for VAR args like the C VAR AR thing um you you can get all of these values passed into your callback function so that you can get the if the units have changed you can retrieve those um and the this all of the callbacks even in the ca module which I'll talk about next use a similar use similar signatures and put in connection callbacks are similar just a little simpler in uh what they can return or the the arguments that they take so one one category of data for that's especially important for controlling beam lines which is what the seminar series is about is waveform data as from area detectors so epic supports epic uh supports waveform data that can be of many different types and how to map those into python objects is a is um worth noting so for double arrays so say from the scan record you can just create a list either a list or a numpy array numpy arrays are are um uh homogeneous data types so integers are floats and highly Compact and highly um efficient at storing large numbers of of arrays so they're like arrays in C not like lists in Python which are heterogeneous and can have many different data types so here you can just set the the scan uh P1 pa uh process variable for the positioner array position arrays for positioner one in the scan record you can just put that to a numpy array and you could also retrieve that and print out the values um for for modern versions of epics Bas or over the last couple years subarrays are also supported if if your waveforms use those and then long strings are are are an important case because um many uh epics supports strings only up to 40 characters and many times you want to have a string that's longer than 40 characters especially for say file names if you're passing those around through epics H so um the way you one does that is to use a character waveform which is just an array of characters those are also useful for other purposes so so they're exactly the same as strings but you want to be able to convert those between strings easily and and so you can do that you can create a PVE that it holds a a character a type of character has 100 up to 128 say um uh characters in in this waveform and you can get those values either as an array of numbers or as a string and you can also then put the string and that will magically uh do the right thing and convert those into asy numbers numbers that go into the waveform and it will now append to trailing dll so that any other client can read that well uh and not get confused um so I want to talk a little bit about the implementation of of pics because it's uh it uses a library that's part of a standard part of python that's very useful and if so if you have another library that you would like to think you might want to use with python this is a really good tool to understanding to use it's called C types and it basically gives you an interface into any C or Fortran dll so you load a library and then you can call any of the any of the methods that are inside the dll and so all of all of Channel access uh through in Python was is uses this library to access the dll so what that means is several things um it makes the the implementation very easy um I didn't write any c code it's all in Python you have to you have to build the data structures up and the and in epics the data structures for getting certain types of data back are rather complex but it it's supported completely to do this um and so and that means that all the installation is done with a very simple installation and there's and uh the threading which is a which is a problem for almost all scripting languages how to how threading is handled is handles as well as it can be handled in Python and both python 2 and three that are supported uh almost with almost no Co code change there a small amount of uh code change that changes when you U install the library for Python 3 but it's otherwise completely uh supported so if you have a library that you think that's Inc and you think I'd like to use that but I don't want to translate it you you don't have to this works uh very well and then you have you also have C code speed from within python so the ca module then does all of the standard Channel access Library calls create channel element count field type and so on and with when you've created a channel ID you use that as the uh sort of as the object uh pointer for a channel and you can also then use create subscription which is just like uh adding a back for event changes and so on um the oh so because events will happen that fast why not no the events are handled by in a separate thread so this this uses the the uh preemptive callbacks so that's just waiting for events to happen you don't you don't need you don't need the short time there right there's you can wait you could wait for 10 seconds there it would be fine yeah yeah of it doesn't you have you have to right so I had to write a dbr translation that tells because so B Chang if Bas changed that's right in fact if the if the for the more complex data types the control types if that layout changed where those are in memory changed that would have to be changed too just how the structure is laid out has to be mapped C++ is harder to do with this it's not as well um it's not as well handled so that's that is a limitation that is it is C types it's not c yeah it is that is more challenging to do that to do uh see structures there are there are some tools that that can do that but I Swig and so on but I I don't know how um how easily those are are yeah and and C types has the advantage that like there's absolutely no C code so that you know installation is really easy yeah anyway okay that's fine we can go on off on other tangents and so so then this this looks a lot like the C Channel access calls there's a little bit of um translation of namespaces and some of the stuff like initializing CA and creating a context are done can be done um automatically they're done automatically if you forget them so these these functions check if a context has been made before they do really call create channel okay and that's uh that's also done with python decorators which are sort of functions to wrap functions okay so there are a few so there are a few things that are make it not quite just like C but but uh very close to C so preemptive call box are used by default and this can be turned off but it has to be done before you create a context before so before any epics Channel access is done um and by default it seems to work fine I've been using this for many years with preemptive callbacks it's it's much more convenient than having to uh use nonpreemptive callbacks and have to actually do pend event so there you can get the control and time data types those are supported but the severity time status and the graphical ones I didn't translate because they're subsets of the other ones um and wave waveform records are converted to numpy arrays if it's possible otherwise lists are used and some of the functions are just not needed like add exception event you can just you can just raise an exception from within python um if it's not already set since since many people use this with waveform records if it's not already set epic CA Max array bites is set by the uh by the library and connection and event callbacks are almost always used internally for PV objects those are it already defines uh event and connection callbacks and then the callbacks you define are called by those event callbacks um that means that the the values are always uh updated in time um and that's almost always true except for very large arrays for arrays larger than 16 kilobytes or 16 Kil elements um that doesn't use callbacks automatically and subscription events an event mask was picked so that they're always uh use that so I'll go on to talk about some of the things built on top of pics but if you have any questions about the implementation or the use of the basic Library uh feel free to just raise your hand or shout out yes it sets an environment V variable for that yeah right that's right that's right if you set it this to anything else it will use what you set it to yes oh no no no I'm I'm sorry I just I just used so shared object Library Dynamic library on Mac yeah in know and so one of the things about doing it that way is that it works actually very well and it's easy to support on Windows Mac and Linux and I think possibly some people are using it still on Solaris no you don't even even with 64 bit it you well so so I think I think that would be if the if epic Channel access if if libc.so was built um then so yeah that's more of a general C types right those are all those are all okay so devices so you with with epic it uh maps to process variables to individual process variables very easily but um oftentimes we want to work with a whole record or a whole or a set of PVS together so a an PEX device I would have called it a record but that's too close to the epics record so it's a device is a collection of PVS usually sharing a name prefix my convention um but so it's similar to a record but it's not relying on the record definition in any way it just it just is a collection of PVS usually associated by name so these are easy to create so for to make an analog input device you can just tell these are the fields that are available for an analog input device I just read that from the documentation and then you just say initialize that with all of these fields and then you have a device that you can use either get or put methods or you can use attributes so you can say for example if you make a pump out of an AI record you can say. description or EGU and get those variables uh uh get those variable values and you can also if you want it as a string you do get dtype as string equals true to get the device type string so that that's just a way to coordinate and colle SCT a set of devices um and that that's fairly easy but of course you can also add methods to to a class like this so for a scaler you could create all those PVS that go with it and then you could put have a method that's one shot mode or count time to set different modes then you can do things like create a scaler set a calculation for it enable the calculations put put it in one shot mode and count for 5 seconds and then read out the the values so this is just a convenient way to take a collection of PVS and turn it into a a python class that has lots of uh uh functionality a simple example for why you would want to do this is is something I've done is for reading an ion chamber current and the amplifier settings that go with it and maybe the X-ray energy which is someplace else and then convert that into a photon flux right so then you want you want a simple device that can do that and to to do that calculation right you need some table of coefficients so the way I have it it's about 16 kilobytes of data but then it's only 100 lines or so of python to turn to read a collection of of PVS that aren't really associated with each other except for at my beam line those all go into this calculation that I want for the flux okay so the final device that's worth talking about is the motor which so a motor record has about 100 fields or so and it's very we use motors a lot so there's a motor device that Maps those and you can move the motor either in user dial or raw units you can check limits and so on so you can get and put or use the attributes for description rbv and so on and you can check the limits so is the motor currently violating the limits and then you can also check if a value some value ahead that you want to put it at is within will be within the limits there's tweak and move methods and so on um so this is the most comp complex device that's in the standard library but there are other devices included too so for the an MCA record a Scala record a struck for multi Channel scalers and a transform record and those are actually pretty simple uh implementations but they allow you to um to work with these higher level Epic Records easily I went the wrong way I went the wrong way okay here so one more one more uh thing that's often convenient is to have an alarm this is so this is a simple process that you could set up a simple script that would set up to an alarm and you give a PV and a comparison and a trip point and a call back and it will do something when the the comparison is true so you could you could set up an alarm to send email or some other alert turn off some some uh system or so on once if a pv's value goes out of a good range and and that could be done with a script that's you know 10 lines long okay so those were those are all for uh scripting or for command line use but for much of what we want to use at a beam line you want to provide a guey to your users so that they have a simple form that they can robustly use and you can walk away for the night uh so so their gooey controls built into the pyic library using WX python which is one of the two or three more common uh guey tool kits available I'm not opposed to using other GUI guey tool kits but I just haven't gotten to the to the point of uh using QT with python or uh or supporting the TK the older TK libraries so for these for the different data types and the different python widgets that you might have there's there are connections between them so there's a a PV text widget which is a readon text string widget and you tie that to a PV and when that pv's text value changes the the display on the label shown will change so you can set that to say a um the a description field and if the description Fields changes that text will change and there's a text control which is for you know the the Box you write type A String into and there's a new choices for either drop- down list or button sets of buttons there's a popup message and there are float controls that are editable and use the the limits and the numerical limits for a PV so that you the numbers that you enter can only be valid numbers that obey those limits and there's there's several more uh uh gooey U widgets extended for um epics PVS most of those most of these were done by Angus Gratton from Australia National University um and there's also some decorator functions which are useful when you start writing guey code you quickly run into a problem that the guey there's a gooey thread in C++ and the python thread in C can want to talk to each other and you have to be careful about avoiding those conflicts so there there are functions to make that easy to work with otherwise you can get um cord dumps quickly from having those two libraries talking to each other two C++ libraries wanting to mix threads so a simple application um is to show say the image from a prosilica camera from a area detector so this is this is a a simple go it just has some controls up here that map uh to the trigger mode exposure time and start and stop for an area detector and you can click and drag on the image to to change the ROI definition so that the AA detector image that you read is um is then zoomed in into that region uh you can almost see this also this this actually is showing a Crosshair that was from the C the overlay plugin that goes into the image uh plugin for the area detector so this this this is a screenshot from a Mac um using Python and WX on a Mac um and it displays at about 15 Hertz which is for this camera that's slightly slower than image J runs I'll be honest you know WX Python and python are not as fast as everything else out there so that's slightly slower than image J but it can be done and it's quite convenient to have a single uh panel that you give to the user and say Here's how you control the this camera um I talked about the motor device earlier and so there are also WX widgets that go with a motor so this looks like a lot like an mm screen where you have a a row for a motor with its description and readback and drive and so on and these are much easier to use than medm like motor displays so the entry values can only be valid numbers and they have to be in within this the uh the soft Limits The Tweak values are generated so you have a drop- down list that you can change the tweak values from and the uh cursor uh Focus Works more like um modern systems than Motif so you can resize the windows well you can resize the windows the font handling is is not as um uh I don't know whether it's good or bad but it's not as crazy as um and there's a more screen that that looks quite a bit like a motor more screen the or the setup screen from the medm and it accesses all of these widgets so then all of these are live and and you know changing them someplace changes them any place else so this is why a PV need needs to so just to go back this is why PB needs to be able to have multiple callbacks because the you know the tweak value here has to has to that's the same PV internally but it has to be able to control several different uh uh widgets within the libr within the WX Library so a slightly uh slightly more sophisticated uh uh expansion of that is this this control that we use at our beam line for controlling a microscope so this has a few stages uh coordinated together actually there's a few that are that are hidden right now that you can display and this will save an image either from a web camera or a or an area detector image uh and and also coordinate that with a position so that you can move this sample stage around and type in a position name and it will remember that and then you can go back to that position later and see the image so again this is that this is an example application this is made not be of of interest to everybody just sort of this the sort of the kind of thing that you can do fairly easily um I'll show a few more applications that I'll come back to an application that's more like that one in a bit so here's so one of the standard epics uh toolkits uh that come with its distribution is a strip chart application so here's one here's a strip chart that monitors PVS and you can just watch the real time uh value of a PV within for seconds or or minutes or days or whatever um and it it in includes interactive zooming of the graph and you can set the time range you can do log plots save PNG files and so on here's some here's some more screenshots of this that you can adjust the colors and so on um this is mostly just an example also mostly an example application that of things you can do easily so for the for the motor widgets I I I don't know about your B but my B we have a lot of these screens and we often are just you know lost in a sea of medm screens for Motors four six or or eight Motors and so but the main complaint about medm is not is not so much what it looks like or what or how how it works but that it can't save the any state information or really when you build this medm window you've told it or you tell it to take four Motors but you don't tell it that those four Motors really go together they're just four individual Motors So based on the the sample stage uh idea we wanted to have a a widget that where we could take a set of positions either motor positions or other PVS and save that state as a as a as a as a thing as a place and then go back to it easily so the instruments uh application is a guey for letting users and this is be you know your you can hand this to your users and they can do this they can organize PVS into instruments so they can create one of these set of name PVS and they can manage them they it uses tab control for multiple instruments so that you can easily go back and forth with a single layout you're only looking at one place on the screen and then you can save any position for any instrument by by a name and then go back or erase that those positions and it will remember all of the definitions for all of the instruments and all of the positions in this setting into a single file uh SQL light it uses a relational database to organize all of that data um we find this we actually find this to be very convenient for setting up a beam line for setting the slits in some location or you want to move the or even you want to set the the parameters for some detector to between a few different modes you can put all the PVS into one of these pages and yeah those can be just any PV yeah that's right yeah it's it's doing a put there it's not it's not saying it current it's yeah so you say go to that position not you are currently at that position oh no no you have to you have to so no no okay so no you click on the position and when you click on the position you then you click on go to and then this comes up on goto a window comes up and says do you want to move there and then you can even say I want to move some of them but not all of them because maybe you know that you're GNA have a cersion it gives gives you a chance to see what you're doing and yeah and you have to really want to move yeah because for the obvious reasons that yeah and oh so and then let's see so that's there oh when I hit something it's okay um and one of the features of this is that because it uses uh an sqli database that's a single file so you can have multiple instances of this running and multiple people can have their own instances or multiple instances of of this so when it starts up it will ask you for the file to use and you can um you can will load all of those settings that it knows about all of the instrument definitions and the the settings that you so you can save a setting set of settings and come back to it six months later it will still be there and then there's also a screen for this is a screen for setting up an instrument so you can add as many PVS as you want to an instrument okay this also has oh yeah okay so finally this also has a server mode because at our beam line we don't just use Python we also use epic we also use spec and IDL so this has a server mode so you can connect this to a PV and and then allow other processes there's a simple epics record um database record and you can have other processes write to say I want to move to um I want to move to position named two microsc on me4 dxp settings uh instrument so that you can you could have store load these settings from this F from this screen and then restore them from spec okay so now finally in the last Okay so yeah there's 20 minutes left so I'll talk about the work in progress that I've been doing for the last several months on scanning software so of course the thing that the thing that's that hasn't been discussed here is how to actually collect data right um those are all tools for the beam line so this is work in progress um but much of this is actually working uh already and ready for for use or or discussion so okay so one can collect data a lot of different ways so spec or the epics scan record is used all over in fact until now I've used the Epic scan record for most of my real data collection um it's somewhat limited both of these are somewhat limited and it might be nice to rethink about how we're doing the data collection and move to a a more consistent scripting language so there's a simple a simple step scan module in Python um that that goes with the Epic applications Library um that you can easily create a scan and run a scan in in a few lines of code so here you create a step scan add a positioner giving it the positions you want it go to go to add a scaler detector and add another counter that would just be something to count not a trigger but a detector is a counter and a trigger I'll get to this in a bit and then run that scan and that will simply run through this list of positions trigger the detector read everything that the detector is is exposing and write out the file into a a simple asky data file so this borrows the way I've done this it borrows many uh Concepts from the scan record positioners detectors triggers and so on and um these detect these sorts of detectors are supported right now and it's writing out asky column files uh although it expects an area detector to write out its own data and it it just writes out the index from that file um so the loop that it does so you know a scan is just a for Loop or a do Loop and um the loop it does is just to go through the list of scan points and move all the positioners wait for all the positioners to be done and then trigger the detectors and then read all of the detect read all of the detectors once the detector triggers are finished and then at the end write the data so you need positioners triggers and counters and a detector is just a combination of a trigger and a set of counters you can also do you know you can also then add some bells and whistles you could add a list of extra PVS to record at the beginning of a scan and maybe you want prescan and postscan methods to run before and after the scan starts to put things in the right mode or to recover um positions so on and then I also added uh as you'll see in a second I also added a concept of a break point which is just a list of places in the scan to pause and to write the data so far to dis it also records the extra bvs and then you can add methods to run at each breakpoint so you might want to integrate the data after some uh so far after some number of of data collection points so the so the positioners for a scan are Unlimited in number and they use full arrays for points they don't use start stop step of course you can can create a list an array easily with startop using start stop step or end points but what it wants is the full array so that multi-dimensional scans here are not an inner scan and an outer Scan they are you'll give if you have two arrays for an XY scan you give that's 10 by 10 each you have two arrays of 100 points yeah it's it's very overp specified but this allows you to do non-rectangular scans you could do a diagonal scan easily you could do a spiral scan and so on you can make complex trajectories again this is only for step scanning but for SLO scanning this can also be uh actually this can be adopted for sleo scanning also um and then you can with this with this way you can also alter the integration time per point this isn't done for for lots of fields but for the for the data I collect for xfs data we do this all the time so I want the positioner I want time to be a positioner that has variable uh values you can also then with this method you can also then put in attenuators filters and and so on at certain break points and you can write out the break points to write the multi-dimensional data and the detectors are also Unlimited in number um so this I I've used the scan record and and spec is not all that great at this either spec has a fixed file format where it needs to write on each line um or each a row for each line so writing out 150 detectors is challenging for spec and this epic scan record doesn't do do it so well and actually I want to be able to record 150 things at each point in my scan I I do that um and and they aren't it's challenging it's okay okay okay um okay so so a counter can store any scalar PV um it doesn't support waveforms yet uh I'm expecting that waveform PVS will be written by other other ways for like area detector but but we can think about mostly how to save them and how to write them to disk is the main issue for waveform PVS and so there's several several uh classes of of detectors already written so for scaler detectors MCA Airy detectors this so for and for most of these they know what to save already so for a scaler everything that you've named in a scaler can will be saved um you don't need to say you want to save S1 S2 yes because all so all this does is trigger so what this does is trig sets the dwell time and triggers and Records array counter rbv so it expects area detector to save the data for you with a plugin yeah to be able to save the MC yes to be able to save data from a yes yes you declare you declare many you can declare as many positioners as you want and you give it the full set of positions you want it to go over there's not multiple Dimensions right yeah you have to you have to engineer that yourself right that's it's worth that's yeah I'm interested in the opinions on this but for me being able to do non-rectangular scans is actually um yeah yeah okay so there's so built on top of that so okay so we started talking about this last April or May and one of the goals for this was to have something that was like spec so built on top of these step scan uh uh Library module is simple functions that are spec like I don't use spec myself we use it at our beam I use it myself um but there is a method that's a scan that you would give it a you know you declare a motor tell that that that is X then you would do a scan X from 10 to 11 with 41 points and a dwell time of 0.25 seconds and there's a l and a mesh and so on these are actually easy to build based on on these kind of Step scans um so here a motor is any epics PV um and a detector is the ones that I've described a little bit this writes out data that's kind of like a spec file but it's not enough like a spec file to be a spec file if someone really wants to use this and make this really be a spec file that's I'm I'm all over it that's great but I I I'm not sure I know how to write a spec file well enough to say I've written a spec file this doesn't do neither of these do live plotting yet by themselves when run from a script but I'll get to that in a second so for the spec leg scans you can also read an initialization file which is I think what similar to what spec does so you can have an inii like file that declares your Motors and your detectors and then you can just load that and then it's much easier to just say here I want to do a scan with that you know motor X which it read from here okay um so but for for for my for my be line I need a guey so that I can hand this off to users who are going to be doing lots of scans on their own so here's a guey form again with tabs and I'll click through some of these they can do line scans and mesh scans and sleo scans for certain types of Motors actually I can right now I'm only doing SLO scans with the Newport XPS and we'll get to using the motor record the motor trajectory scans soon with this um and then also set up for XF scans which are multi- segment nonlinear steps in energy with varying count times so are a little peculiar for most for most what most people need for scanning the current way this works um and the way the sleo scanning and the step scanning works for this right now is that the guey the goey does not do the scan because a a guey doing a scan means that then the person sitting at the beam line that's the only place that's where it happens it's the only place where you can control the scan and that's not something that is very epics likee which is a a highly networked system uh so right now the guy writes the scam parameter into a file and signals with an with epics um a separate data collection process that then runs the scan from that file so it tell it says run the run this scan and this other process goes ahead and runs the scan that way you can interrupt the scan or have the scan be run from on a different machine so that the data collection process does not need to be even on the same machine as the guy um in progress and what I'm trying what I want to do and what I'm in progress I'm hoping to do this get this done real soon is to have the scam parameters not sent to a file but into a database and then have the data collection process read from that database and I mean a proper relational database um and that way you can have real-time data and uh and Status information being posted to the database so that you have one of these one of these kind of layouts like this where a few different clients could be talking to the database server a collection program that reads from the database what to do next and then does the real work um this allows that this will that then allows data collection commands to be queed and logged and um oh queued and logged and automatic logging and uh and and many multiple clients in fact many different clients so the clients don't need to all could be in different languages they could be some could be just web pages running JavaScript that can still read from this database just to find out what is going on you know is this is the scan running is the is the beam up uh kind of things so then SQL is the basic communication layer between the clients and the server here um and that allows a clean break of of a client and server um so what's next for this and for for is uh getting the relational database and metadata uh communication uh in in using SQL um which is that's all very easy to do and getting real-time plots from the database to a client program that's also not hard to do um it's just not finished yet and I'd like to get to a point where I have scripal scriptable high level scanning commands so that a a a macro can be you know written into the database I have the the real Advantage for doing that is that then you can have the macros also doing uh data collection and Analysis simultaneously so you can scan until until your data is good enough another another um interesting challenge for this is to convert the raw data that's collected into hdf5 efficiently and as soon as the data is actually collected so that it can be um uh set so the hdf5 can be used for visualization and sent home to the users but it's but hdf5 is not robust enough to use a direct uh saving format so that has to be that conversion has to be happen immediately after data collection so the open questions for this are can hdf5 um be standardized or the layout the schemas be standardized I'm sure they can be but you know can we use the standards is maybe the question and then uh you know what would make these tools more generally useful and uh and uh inspire people to want to collaborate on them so okay so I'm going to stop there um I talked about several different things um py epics has a nearly complete uh low-level interface to channel access and built on top of that are several layers of of python uh classes including and mostly the PV class and some of these devices there's a there's a fair amount of guey support in WX python and a few general purpose applications and more um on the way so there's all there's a huge list of people who have given really great feedback on uh piy epics and including Tech the tech talk mailing list but I want to thank angress graten from a&u the most he he was very helpful in getting many of the aspects of the guey code um up and running and uh so thanks