I am using PyEphem to calculate the location of the Sun in the sky at various times.
I have an Observer point (happens to be at Stonehenge) and can use PyEphem to calculate sunrise, sunset, and the altitude angle and azimuth (degrees from N) for the Sun at any hour of the day. Brilliant, no problem.
However, what I really need is to be able to calculate the altitude angle of the Sun from an known azimuth.   So I would set the same observer point (long/lat/elev/date (just yy/mm/dd, not time)) and an azimuth for the Sun.  And from this input, calculate the altitude of the Sun and the time it is at that azimuth. 
I had hoped I would be able to just set Sun.date and Sun.az and work backwards from those values, but alas.  Any thoughts on how to approach this (and if it even is approachable) with PyEphem?
The only other option I'm seeing available is to "sneak up" on the azimuth by iterating over a sequence of times until I get within a margin of error of the azimuth I desire, but that is just gross.
thanks in advance, Dave
Without knowing the details of the internal calculations that PyEphem is doing I don't know how easy or difficult it would be to invert those calculations to give the result you want. 
With regards to the "sneaking up on it" option however, you could pick two starting times (eg sunrise and noon) where the azimuth is known to be either side (one greater and one less than) the desired value. Then just use a simple "halving the interval" approach to quickly find an approximate solution.
PyEphem: can I calculate Sun's altitude from azimuth