
Hello everyone. I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object). Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius. This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot) center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right) proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc") the error arrises here prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None ) where I get the error /gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None: AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields' Any ideas how to get around this error? Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this. _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hi Ben, I have some code which does this, but I'm in the middle of job stuff at the moment, and it will take me a few days to extract out the relevant parts of the code to get to you (and upgrade to yt3). Cameron On Tue, Jan 13, 2015 at 10:49 AM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org

Hi Ben, I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore? Would it perhaps work to create a uniform grid dataset from an FRB array? Britton On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hey guys. I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick. Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code. Ben On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote:
Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery. Use the export_fits method: my_frb.export_fits("myfile.fits", fields) Then: ds = yt.load("my_file.fits") I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later. The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package. Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben
On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote: Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson <bthompson2090@gmail.com> wrote: Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hi, Everybody-- This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all. I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj? I'd like to retain all the high resolution data, if possible. Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way? Thanks! d. On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com> wrote:
This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.
Use the export_fits method:
my_frb.export_fits("myfile.fits", fields)
Then:
ds = yt.load("my_file.fits")
I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.
The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.
Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote:
Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.

On Tue, Jun 2, 2015 at 8:21 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everybody--
This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.
I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj? I'd like to retain all the high resolution data, if possible.
Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way?
This is buried a few layers deep in my code, but I use this to generate radial profiles from an image: https://bitbucket.org/ngoldbaum/galaxy_analysis/src/eda50ae6dd8315bb23aab4ba... In lieu of a docstring on that function, 'data' is an image, 'weight' is a weight image (if you are doing a weighted profile), and x_bin_edges is a specification for bin edges that should be passed to np.histogram.
Thanks! d.
On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com> wrote:
This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.
Use the export_fits method:
my_frb.export_fits("myfile.fits", fields)
Then:
ds = yt.load("my_file.fits")
I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.
The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.
Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote:
Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hi Dave, Also, I know that you’re talking about the projection object itself, but for completeness, this was merged in yesterday: https://bitbucket.org/yt_analysis/yt/pull-request/1593/export-fixedresolutio... <https://bitbucket.org/yt_analysis/yt/pull-request/1593/export-fixedresolutio...> Which takes an FRB and makes a dataset out of it. Best, John
On Jun 2, 2015, at 1:54 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Jun 2, 2015 at 8:21 AM, David Collins <dcollins4096@gmail.com <mailto:dcollins4096@gmail.com>> wrote: Hi, Everybody--
This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.
I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj? I'd like to retain all the high resolution data, if possible.
Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way?
This is buried a few layers deep in my code, but I use this to generate radial profiles from an image:
https://bitbucket.org/ngoldbaum/galaxy_analysis/src/eda50ae6dd8315bb23aab4ba... <https://bitbucket.org/ngoldbaum/galaxy_analysis/src/eda50ae6dd8315bb23aab4ba...>
In lieu of a docstring on that function, 'data' is an image, 'weight' is a weight image (if you are doing a weighted profile), and x_bin_edges is a specification for bin edges that should be passed to np.histogram.
Thanks! d.
On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com <mailto:jzuhone@gmail.com>> wrote: This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.
Use the export_fits method:
my_frb.export_fits("myfile.fits", fields)
Then:
ds = yt.load("my_file.fits")
I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.
The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.
Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave. <>, 37-582G Cambridge, MA 02139 <> (w) 617-253-2354 <tel:617-253-2354> (m) 781-708-5004 <tel:781-708-5004> jzuhone@space.mit.edu <mailto:jzuhone@space.mit.edu> jzuhone@gmail.com <mailto:jzuhone@gmail.com> http://www.jzuhone.com <http://www.jzuhone.com/>
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com <mailto:bthompson2090@gmail.com>> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben
On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com <mailto:brittonsmith@gmail.com>> wrote: Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson <bthompson2090@gmail.com <mailto:bthompson2090@gmail.com>> wrote: Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>

Also, I know that you’re talking about the projection object itself, but for completeness, this was merged in yesterday:
https://bitbucket.org/yt_analysis/yt/pull-request/1593/export-fixedresolutio...
Thanks, John-- I'm working with a mix of FRBs and projections, this definitely solves the former. That's looks great.
Which takes an FRB and makes a dataset out of it.
Best,
John
On Jun 2, 2015, at 1:54 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Jun 2, 2015 at 8:21 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everybody--
This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.
I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj? I'd like to retain all the high resolution data, if possible.
Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way?
This is buried a few layers deep in my code, but I use this to generate radial profiles from an image:
https://bitbucket.org/ngoldbaum/galaxy_analysis/src/eda50ae6dd8315bb23aab4ba...
In lieu of a docstring on that function, 'data' is an image, 'weight' is a weight image (if you are doing a weighted profile), and x_bin_edges is a specification for bin edges that should be passed to np.histogram.
Thanks! d.
On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com> wrote:
This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.
Use the export_fits method:
my_frb.export_fits("myfile.fits", fields)
Then:
ds = yt.load("my_file.fits")
I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.
The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.
Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote:
Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson <bthompson2090@gmail.com
wrote:
Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.

Thanks, Nathan. I'll digest that and get back to you. On Tue, Jun 2, 2015 at 1:54 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Jun 2, 2015 at 8:21 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everybody--
This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.
I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj? I'd like to retain all the high resolution data, if possible.
Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way?
This is buried a few layers deep in my code, but I use this to generate radial profiles from an image:
https://bitbucket.org/ngoldbaum/galaxy_analysis/src/eda50ae6dd8315bb23aab4ba...
In lieu of a docstring on that function, 'data' is an image, 'weight' is a weight image (if you are doing a weighted profile), and x_bin_edges is a specification for bin edges that should be passed to np.histogram.
Thanks! d.
On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com> wrote:
This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.
Use the export_fits method:
my_frb.export_fits("myfile.fits", fields)
Then:
ds = yt.load("my_file.fits")
I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.
The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.
Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote:
Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson <bthompson2090@gmail.com
wrote:
Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.

Dave, Just to clarify, you want to make a phase plot of a projected object? So you want something like how column density varies with density-weighted temperature in a 2D plot? Or something like this? I only ever did a radial profile of projected fields (column density, or metal column density, etc.), but I could try to help you put something together. The FRB idea suggested by John might be the easiest approach depending on what you want. On Tue, Jun 2, 2015 at 8:21 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everybody--
This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.
I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj? I'd like to retain all the high resolution data, if possible.
Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way?
Thanks! d.
On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com> wrote:
This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.
Use the export_fits method:
my_frb.export_fits("myfile.fits", fields)
Then:
ds = yt.load("my_file.fits")
I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.
The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.
Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote:
Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org

Just to clarify, you want to make a phase plot of a projected object? So you want something like how column density varies with density-weighted temperature in a 2D plot? Or something like this? I only ever did a radial
That's exactly right. I'll give the FRB a shot first. Since the ultimate goal is comparison to the sky, FRB is probably just fine. How different was your code?
profile of projected fields (column density, or metal column density, etc.), but I could try to help you put something together. The FRB idea suggested by John might be the easiest approach depending on what you want.
On Tue, Jun 2, 2015 at 8:21 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everybody--
This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.
I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj? I'd like to retain all the high resolution data, if possible.
Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way?
Thanks! d.
On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com> wrote:
This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.
Use the export_fits method:
my_frb.export_fits("myfile.fits", fields)
Then:
ds = yt.load("my_file.fits")
I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.
The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.
Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote:
Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson <bthompson2090@gmail.com
wrote:
Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.

My script basically did this: 1) Make a projection (of a galaxy) 2) Identify a central point (ie the center of the galaxy i cared about) 3) Measure the projected distance from the central point to each pixel in the projection. 4) Bin these projected pixels into radial bins 5) Take the median value of different projected fields for each radial bin (e.g. column density, density-weighted temperature, etc.) 6) Plot up each of these fields as they vary for projected radius If I were to do it again, I'd probably rely on the new FRB interface as it seems cleaner. And, it looks like it would better address what you're trying to do right now. Cameron On Tue, Jun 2, 2015 at 1:57 PM, David Collins <dcollins4096@gmail.com> wrote:
Just to clarify, you want to make a phase plot of a projected object? So you want something like how column density varies with density-weighted temperature in a 2D plot? Or something like this? I only ever did a radial
That's exactly right. I'll give the FRB a shot first. Since the ultimate goal is comparison to the sky, FRB is probably just fine.
How different was your code?
profile of projected fields (column density, or metal column density, etc.), but I could try to help you put something together. The FRB idea suggested by John might be the easiest approach depending on what you want.
On Tue, Jun 2, 2015 at 8:21 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everybody--
This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.
I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj? I'd like to retain all the high resolution data, if possible.
Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way?
Thanks! d.
On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com> wrote:
This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.
Use the export_fits method:
my_frb.export_fits("myfile.fits", fields)
Then:
ds = yt.load("my_file.fits")
I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.
The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.
Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote:
Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson < bthompson2090@gmail.com> wrote:
Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org

I recall we’ve batted around the idea of using slice and projection objects directly as datasets—I suspect there probably is some way to load them as in-memory AMR datasets, but I’m not sure how easy that is. Anyone else care to comment? In general, when I make FRBs for anything other than imaging, I make sure that the resolution matches the finest cell size, and that it matches the layout of the underlying AMR grids (e.g., no partial overlaps between FRB resolution elements and AMR cells). Something tells me we ought to have a short-hand of some kind for creating an FRB in this way.
On Jun 2, 2015, at 5:14 PM, Cameron Hummels <chummels@gmail.com> wrote:
My script basically did this:
1) Make a projection (of a galaxy) 2) Identify a central point (ie the center of the galaxy i cared about) 3) Measure the projected distance from the central point to each pixel in the projection. 4) Bin these projected pixels into radial bins 5) Take the median value of different projected fields for each radial bin (e.g. column density, density-weighted temperature, etc.) 6) Plot up each of these fields as they vary for projected radius
If I were to do it again, I'd probably rely on the new FRB interface as it seems cleaner. And, it looks like it would better address what you're trying to do right now.
Cameron
On Tue, Jun 2, 2015 at 1:57 PM, David Collins <dcollins4096@gmail.com <mailto:dcollins4096@gmail.com>> wrote:
Just to clarify, you want to make a phase plot of a projected object? So you want something like how column density varies with density-weighted temperature in a 2D plot? Or something like this? I only ever did a radial
That's exactly right. I'll give the FRB a shot first. Since the ultimate goal is comparison to the sky, FRB is probably just fine.
How different was your code?
profile of projected fields (column density, or metal column density, etc.), but I could try to help you put something together. The FRB idea suggested by John might be the easiest approach depending on what you want.
On Tue, Jun 2, 2015 at 8:21 AM, David Collins <dcollins4096@gmail.com <mailto:dcollins4096@gmail.com>> wrote: Hi, Everybody--
This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.
I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj? I'd like to retain all the high resolution data, if possible.
Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way?
Thanks! d.
On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com <mailto:jzuhone@gmail.com>> wrote: This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.
Use the export_fits method:
my_frb.export_fits("myfile.fits", fields)
Then:
ds = yt.load("my_file.fits")
I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.
The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.
Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave. <>, 37-582G Cambridge, MA 02139 <> (w) 617-253-2354 <tel:617-253-2354> (m) 781-708-5004 <tel:781-708-5004> jzuhone@space.mit.edu <mailto:jzuhone@space.mit.edu> jzuhone@gmail.com <mailto:jzuhone@gmail.com> http://www.jzuhone.com <http://www.jzuhone.com/>
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com <mailto:bthompson2090@gmail.com>> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben
On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com <mailto:brittonsmith@gmail.com>> wrote: Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson <bthompson2090@gmail.com <mailto:bthompson2090@gmail.com>> wrote: Hello everyone.
I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).
Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.
This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)
center = cylinder.get_field_parameter("center") normal = cylinder.get_field_parameter("normal") image_width = (100,"kpc") three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1]) left = center - image_width right = center + image_width region = shot.region(center, left, right)
proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")
the error arrises here
prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )
where I get the error
/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional) 1304 else: 1305 raise NotImplementedError -> 1306 bin_fields = data_source._determine_fields(bin_fields) 1307 fields = data_source._determine_fields(fields) 1308 if units is not None:
AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'
Any ideas how to get around this error?
Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org <http://chummels.org/> _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org <mailto:yt-users@lists.spacepope.org> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org <http://chummels.org/>_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

On Tue, Jun 2, 2015 at 2:25 PM, John Zuhone <jzuhone@gmail.com> wrote:
I recall we’ve batted around the idea of using slice and projection objects directly as datasets—I suspect there probably is some way to load them as in-memory AMR datasets, but I’m not sure how easy that is. Anyone else care to comment?
Probably doable as a 2D dataset, loading the quadtree in-memory. Would take some work.
In general, when I make FRBs for anything other than imaging, I make sure that the resolution matches the finest cell size, and that it matches the layout of the underlying AMR grids (e.g., no partial overlaps between FRB resolution elements and AMR cells). Something tells me we ought to have a short-hand of some kind for creating an FRB in this way.
This is basically a reduced dimensionality covering grid. I don't think we have such a thing yet but I think it would be a worthwhile addition, I could see it being useful to not need to think about aligning a FRB with cell boundaries.
On Jun 2, 2015, at 5:14 PM, Cameron Hummels <chummels@gmail.com> wrote:
My script basically did this:
1) Make a projection (of a galaxy) 2) Identify a central point (ie the center of the galaxy i cared about) 3) Measure the projected distance from the central point to each pixel in the projection. 4) Bin these projected pixels into radial bins 5) Take the median value of different projected fields for each radial bin (e.g. column density, density-weighted temperature, etc.) 6) Plot up each of these fields as they vary for projected radius
If I were to do it again, I'd probably rely on the new FRB interface as it seems cleaner. And, it looks like it would better address what you're trying to do right now.
Cameron
On Tue, Jun 2, 2015 at 1:57 PM, David Collins <dcollins4096@gmail.com> wrote:
Just to clarify, you want to make a phase plot of a projected object? So you want something like how column density varies with density-weighted temperature in a 2D plot? Or something like this? I only ever did a radial
That's exactly right. I'll give the FRB a shot first. Since the ultimate goal is comparison to the sky, FRB is probably just fine.
How different was your code?
profile of projected fields (column density, or metal column density, etc.), but I could try to help you put something together. The FRB idea suggested by John might be the easiest approach depending on what you want.
On Tue, Jun 2, 2015 at 8:21 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everybody--
This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.
I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj? I'd like to retain all the high resolution data, if possible.
Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way?
Thanks! d.
On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com> wrote:
This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.
Use the export_fits method:
my_frb.export_fits("myfile.fits", fields)
Then:
ds = yt.load("my_file.fits")
I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.
The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.
Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote:
Hi Ben,
I seem to recall people on this list doing similar things in the past with their own external code. Does anyone still have their 2D radial profile code around anymore?
Would it perhaps work to create a uniform grid dataset from an FRB array?
Britton
On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson < bthompson2090@gmail.com> wrote:
> Hello everyone. > > I was wondering if anyone has had experience with producing a > profile plot from a 2d projection object (FRB object). > > Essentially, what I am trying to do is plot the stellar surface > density of a galaxy as a function of radius. > > This is achieved by doing the following from a disk YT object called > cylinder (in which the origional simulation object is called shot) > > center = cylinder.get_field_parameter("center") > normal = cylinder.get_field_parameter("normal") > image_width = (100,"kpc") > three_image_width = YTArray((image_width[0], image_width[0], > image_width[0]),image_width[1]) > left = center - image_width > right = center + image_width > region = shot.region(center, left, right) > > proj = > yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc") > > the error arrises here > > prof = > yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None > ) > > where I get the error > > > /gpfs/home/........./profiles.pyc in create_profile(data_source, > bin_fields, fields, n_bins, extrema, logs, units, weight_field, > accumulation, fractional) > 1304 else: > 1305 raise NotImplementedError > -> 1306 bin_fields = data_source._determine_fields(bin_fields) > 1307 fields = data_source._determine_fields(fields) > 1308 if units is not None: > > AttributeError: 'FixedResolutionBuffer' object has no attribute > '_determine_fields' > > Any ideas how to get around this error? > > > Also some other things to add as a postscript. Since how the > projection works, if I provide weights=None as a keyword argument within > the ProjectionPlot object, I get a surface density (g/cm^2). But also a > "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to > do another projection where weights="ones", get the radius values out of > that profile.. and then in matplotlib, useing the surface density array > from the former profile, and the radius bin array from the latter... > Produce a plot of the surface density as a function of radius from those > two arrays (I might check by hand afterwards to see if this does the > trick). This seems kinda convoluted so I am wondering if there is an easier > way than this. > > > > _______________________________________________ > yt-users mailing list > yt-users@lists.spacepope.org > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org > >
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hi Nathan, On Tue, Jun 2, 2015 at 4:28 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:
On Tue, Jun 2, 2015 at 2:25 PM, John Zuhone <jzuhone@gmail.com> wrote:
I recall we’ve batted around the idea of using slice and projection objects directly as datasets—I suspect there probably is some way to load them as in-memory AMR datasets, but I’m not sure how easy that is. Anyone else care to comment?
Probably doable as a 2D dataset, loading the quadtree in-memory. Would take some work.
Yes, this is totally doable, but would as you note take some work. I can see a few possible ways to it, all of which we should consider, but the main obstacle is likely going to be an impedance mismatch between the quadtree and the octree, which were developed at different times in different ways. There'll be a visitor this Summer who's interested in this type of thing, and I'll see if we can collaborate to pull it together.
In general, when I make FRBs for anything other than imaging, I make sure that the resolution matches the finest cell size, and that it matches the layout of the underlying AMR grids (e.g., no partial overlaps between FRB resolution elements and AMR cells). Something tells me we ought to have a short-hand of some kind for creating an FRB in this way.
This is basically a reduced dimensionality covering grid. I don't think we have such a thing yet but I think it would be a worthwhile addition, I could see it being useful to not need to think about aligning a FRB with cell boundaries.
On Jun 2, 2015, at 5:14 PM, Cameron Hummels <chummels@gmail.com> wrote:
My script basically did this:
1) Make a projection (of a galaxy) 2) Identify a central point (ie the center of the galaxy i cared about) 3) Measure the projected distance from the central point to each pixel in the projection. 4) Bin these projected pixels into radial bins 5) Take the median value of different projected fields for each radial bin (e.g. column density, density-weighted temperature, etc.) 6) Plot up each of these fields as they vary for projected radius
If I were to do it again, I'd probably rely on the new FRB interface as it seems cleaner. And, it looks like it would better address what you're trying to do right now.
Cameron
On Tue, Jun 2, 2015 at 1:57 PM, David Collins <dcollins4096@gmail.com> wrote:
Just to clarify, you want to make a phase plot of a projected object? So you want something like how column density varies with density-weighted temperature in a 2D plot? Or something like this? I only ever did a radial
That's exactly right. I'll give the FRB a shot first. Since the ultimate goal is comparison to the sky, FRB is probably just fine.
How different was your code?
profile of projected fields (column density, or metal column density, etc.), but I could try to help you put something together. The FRB idea suggested by John might be the easiest approach depending on what you want.
On Tue, Jun 2, 2015 at 8:21 AM, David Collins <dcollins4096@gmail.com> wrote:
Hi, Everybody--
This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.
I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj? I'd like to retain all the high resolution data, if possible.
Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way?
Thanks! d.
On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com> wrote:
This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.
Use the export_fits method:
my_frb.export_fits("myfile.fits", fields)
Then:
ds = yt.load("my_file.fits")
I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.
The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.
Kavli Center for Astrophysics and Space Research Massachusetts Institute of Technology 77 Massachusetts Ave., 37-582G Cambridge, MA 02139 (w) 617-253-2354 (m) 781-708-5004 jzuhone@space.mit.edu jzuhone@gmail.com http://www.jzuhone.com
On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com> wrote:
Hey guys.
I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.
Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.
Ben
On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote: > > Hi Ben, > > I seem to recall people on this list doing similar things in the past > with their own external code. Does anyone still have their 2D radial > profile code around anymore? > > Would it perhaps work to create a uniform grid dataset from an FRB > array? > > Britton > > On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson > <bthompson2090@gmail.com> wrote: >> >> Hello everyone. >> >> I was wondering if anyone has had experience with producing a >> profile plot from a 2d projection object (FRB object). >> >> Essentially, what I am trying to do is plot the stellar surface >> density of a galaxy as a function of radius. >> >> This is achieved by doing the following from a disk YT object called >> cylinder (in which the origional simulation object is called shot) >> >> center = cylinder.get_field_parameter("center") >> normal = cylinder.get_field_parameter("normal") >> image_width = (100,"kpc") >> three_image_width = YTArray((image_width[0], image_width[0], >> image_width[0]),image_width[1]) >> left = center - image_width >> right = center + image_width >> region = shot.region(center, left, right) >> >> proj = >> yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc") >> >> the error arrises here >> >> prof = >> yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None >> ) >> >> where I get the error >> >> >> /gpfs/home/........./profiles.pyc in create_profile(data_source, >> bin_fields, fields, n_bins, extrema, logs, units, weight_field, >> accumulation, fractional) >> 1304 else: >> 1305 raise NotImplementedError >> -> 1306 bin_fields = data_source._determine_fields(bin_fields) >> 1307 fields = data_source._determine_fields(fields) >> 1308 if units is not None: >> >> AttributeError: 'FixedResolutionBuffer' object has no attribute >> '_determine_fields' >> >> Any ideas how to get around this error? >> >> >> Also some other things to add as a postscript. Since how the >> projection works, if I provide weights=None as a keyword argument within the >> ProjectionPlot object, I get a surface density (g/cm^2). But also a >> "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to >> do another projection where weights="ones", get the radius values out of >> that profile.. and then in matplotlib, useing the surface density array from >> the former profile, and the radius bin array from the latter... Produce a >> plot of the surface density as a function of radius from those two arrays (I >> might check by hand afterwards to see if this does the trick). This seems >> kinda convoluted so I am wondering if there is an easier way than this. >> >> >> >> _______________________________________________ >> yt-users mailing list >> yt-users@lists.spacepope.org >> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org >> > > > _______________________________________________ > yt-users mailing list > yt-users@lists.spacepope.org > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org > _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Probably doable as a 2D dataset, loading the quadtree in-memory. Would take some work.
Yes, this is totally doable, but would as you note take some work. I can see a few possible ways to it, all of which we should consider,
That would be awesome if it were possible. For now I think John's FRB at max res. will be the way I go for me. I'm already looking at FRBs like that, so it's a straight forward method. Thanks a ton for the input! d.
but the main obstacle is likely going to be an impedance mismatch between the quadtree and the octree, which were developed at different times in different ways. There'll be a visitor this Summer who's interested in this type of thing, and I'll see if we can collaborate to pull it together.
In general, when I make FRBs for anything other than imaging, I make
that the resolution matches the finest cell size, and that it matches
layout of the underlying AMR grids (e.g., no partial overlaps between FRB resolution elements and AMR cells). Something tells me we ought to have a short-hand of some kind for creating an FRB in this way.
This is basically a reduced dimensionality covering grid. I don't think we have such a thing yet but I think it would be a worthwhile addition, I could see it being useful to not need to think about aligning a FRB with cell boundaries.
On Jun 2, 2015, at 5:14 PM, Cameron Hummels <chummels@gmail.com> wrote:
My script basically did this:
1) Make a projection (of a galaxy) 2) Identify a central point (ie the center of the galaxy i cared about) 3) Measure the projected distance from the central point to each pixel
in
the projection. 4) Bin these projected pixels into radial bins 5) Take the median value of different projected fields for each radial bin (e.g. column density, density-weighted temperature, etc.) 6) Plot up each of these fields as they vary for projected radius
If I were to do it again, I'd probably rely on the new FRB interface as it seems cleaner. And, it looks like it would better address what you're trying to do right now.
Cameron
On Tue, Jun 2, 2015 at 1:57 PM, David Collins <dcollins4096@gmail.com> wrote:
Just to clarify, you want to make a phase plot of a projected object? So you want something like how column density varies with
density-weighted
temperature in a 2D plot? Or something like this? I only ever did a radial
That's exactly right. I'll give the FRB a shot first. Since the ultimate goal is comparison to the sky, FRB is probably just fine.
How different was your code?
profile of projected fields (column density, or metal column density, etc.), but I could try to help you put something together. The FRB
idea
suggested by John might be the easiest approach depending on what you want.
On Tue, Jun 2, 2015 at 8:21 AM, David Collins <dcollins4096@gmail.com
wrote:
Hi, Everybody--
This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.
I'd like a PhasePlot from a projected region. Earlier FRBs were discussed; has anyone successfully done the same on a
YTQuadTreeProj? I'd
like to retain all the high resolution data, if possible.
Cameron, back in Jan you mentioned you had a script. Did you manage to track it down, and/or would you be willing to send it my way?
Thanks! d.
On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone <jzuhone@gmail.com> wrote: > > This is a bit of a long way around, but you could write the FRB to a > FITS file and read it in as a dataset. You would get the coordinate system, > units, etc., and the whole YT machinery. > > Use the export_fits method: > > my_frb.export_fits("myfile.fits", fields) > > Then: > > ds = yt.load("my_file.fits") > > I'm not at a computer so I don't remember the exact signature, but it > should be in the code and you can check using help(my_frb.export_fits). If > you're interested I can write back with more info later. > > The other advantage of this is that you can store the data to disk. > You'll have to install the AstroPy package. > > Kavli Center for Astrophysics and Space Research > Massachusetts Institute of Technology > 77 Massachusetts Ave., 37-582G > Cambridge, MA 02139 > (w) 617-253-2354 > (m) 781-708-5004 > jzuhone@space.mit.edu > jzuhone@gmail.com > http://www.jzuhone.com > > On Jan 16, 2015, at 8:34 PM, Ben Thompson <bthompson2090@gmail.com> > wrote: > > Hey guys. > > I have a solution together for myself involving the new > particle_position_relative_[xyz] fields and multiple instances of > np.histogram and np.linspace which seems to do the trick. > > Although I would not complain if a piece of code that would be more > native to the inner workings of YT existed that made use of the FRB data > objects :). So that would be very nice Cameron. Don't feel the need to rush > with it though, as I made a numpy solution for myself. But I would be > interested to see that code. > > Ben > > On 17 Jan 2015 01:27, "Britton Smith" <brittonsmith@gmail.com> wrote: >> >> Hi Ben, >> >> I seem to recall people on this list doing similar things in the
>> with their own external code. Does anyone still have their 2D radial >> profile code around anymore? >> >> Would it perhaps work to create a uniform grid dataset from an FRB >> array? >> >> Britton >> >> On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson >> <bthompson2090@gmail.com> wrote: >>> >>> Hello everyone. >>> >>> I was wondering if anyone has had experience with producing a >>> profile plot from a 2d projection object (FRB object). >>> >>> Essentially, what I am trying to do is plot the stellar surface >>> density of a galaxy as a function of radius. >>> >>> This is achieved by doing the following from a disk YT object called >>> cylinder (in which the origional simulation object is called shot) >>> >>> center = cylinder.get_field_parameter("center") >>> normal = cylinder.get_field_parameter("normal") >>> image_width = (100,"kpc") >>> three_image_width = YTArray((image_width[0], image_width[0], >>> image_width[0]),image_width[1]) >>> left = center - image_width >>> right = center + image_width >>> region = shot.region(center, left, right) >>> >>> proj = >>> yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc") >>> >>> the error arrises here >>> >>> prof = >>> yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None >>> ) >>> >>> where I get the error >>> >>> >>> /gpfs/home/........./profiles.pyc in create_profile(data_source, >>> bin_fields, fields, n_bins, extrema, logs, units, weight_field, >>> accumulation, fractional) >>> 1304 else: >>> 1305 raise NotImplementedError >>> -> 1306 bin_fields = data_source._determine_fields(bin_fields) >>> 1307 fields = data_source._determine_fields(fields) >>> 1308 if units is not None: >>> >>> AttributeError: 'FixedResolutionBuffer' object has no attribute >>> '_determine_fields' >>> >>> Any ideas how to get around this error? >>> >>> >>> Also some other things to add as a postscript. Since how the >>> projection works, if I provide weights=None as a keyword argument within the >>> ProjectionPlot object, I get a surface density (g/cm^2). But also a >>> "cylindrical_r" in cm^2 as well. I *think* the way to get around
>>> do another projection where weights="ones", get the radius values out of >>> that profile.. and then in matplotlib, useing the surface density array from >>> the former profile, and the radius bin array from the latter... Produce a >>> plot of the surface density as a function of radius from those two arrays (I >>> might check by hand afterwards to see if this does the trick). This seems >>> kinda convoluted so I am wondering if there is an easier way than
sure the past this is to this.
>>> >>> >>> >>> _______________________________________________ >>> yt-users mailing list >>> yt-users@lists.spacepope.org >>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org >>> >> >> >> _______________________________________________ >> yt-users mailing list >> yt-users@lists.spacepope.org >> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org >> > _______________________________________________ > yt-users mailing list > yt-users@lists.spacepope.org > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org > > > _______________________________________________ > yt-users mailing list > yt-users@lists.spacepope.org > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org >
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Cameron Hummels Postdoctoral Researcher Steward Observatory University of Arizona http://chummels.org _______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- -- Sent from a computer.
participants (8)
-
Ben Thompson
-
Britton Smith
-
Cameron Hummels
-
David Collins
-
John Zuhone
-
John ZuHone
-
Matthew Turk
-
Nathan Goldbaum