I think Dave's right, you should subclass PlotCallback, add it to:
and then give it an appropriate name. I think this would be a great addition to the code base; I agree, it is important to have functions like this available. I'd recommend you fork the yt repo at
and then make these changes. Then you can issue a pull request, and we'll incorporate them into the main repository. The BitBucket site (which you can log into with a Google Account) has more info about how to set up your hg username, but if you have a yt install you already have mercurial, so it should be pretty easy.
On Thu, Feb 24, 2011 at 7:28 PM, David Collins email@example.com wrote:
I think you want to write a new callback. Check out what's done in yt/visualizations/plot_modifications.py. (raven/PlotCallbacks if you're not o yt2.0) Basically, you:
1.) Subclass PlotCallback 2.) Give it a _type_name 3.) it needs an __init__ with whatever args you want 4.) it needs a __call__ that takes (self, plot). This does the work 5.) Most everything you need is hung off plot.image and plot._axis. There are a ton of good examples in the file I mentioned above 6.) You can add the callback by doing
ploot= pc.add_projection(whatevz) ploot.modify['ConvolveCharles']()
(this might require registering your callback somewhere, I can't remember)
From there, make sure your convolution is done before other callbacks, and you're set.
The MarkerAnnotateCallback is a good one to look at for callback syntax.
On Thu, Feb 24, 2011 at 4:02 PM, Charles Hansen firstname.lastname@example.org wrote:
Does anyone know a way to convolve a yt image (preferably pc.add_projection) with a telescope psf? This would be useful for simulated observations. At the moment, the best I can do is make an image in yt and then convolve that image in pixel space, but this ends up blurring out things I do not want blurred (like particle markers, or velocity arrows). The psf does not need to be fancy, I just want a 2D gaussian with an adjustable width.
Ideally, there would be a call pc.add_projection("Density", 0, psf_width = 1.5e13) #create a projection with a psf width of 1 AU at the observed distance
yt-users mailing list email@example.com http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Sent from my Stone Tablet and carried by my Pterodactyl. _______________________________________________ yt-users mailing list firstname.lastname@example.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org