need to set omega_baryon in yt-3

Hi folks, I am using yt-3, and attempting to make a ProjectionPlot of the derived field 'baryon_overdensity' (using an Enzo dataset). The line in question is this: plot1 = yt.ProjectionPlot(ds,'z',"baryon_overdensity",weight_field="baryon_overdensity",center=c,data_source=my_region) (with c, my_region being previously defined). When I do this, it complains: yt.fields.field_exceptions.NeedsParameter: (['omega_baryon']) which certainly makes sense from a physical perspective, and which Enzo doesn't natively carry around. I tried to set this by hand:

er, sorry, hit send before I finished. Completed message is below! Hi folks, I am using yt-3, and attempting to make a ProjectionPlot of the derived field 'baryon_overdensity' (using an Enzo dataset). The line in question is this: plot1 = yt.ProjectionPlot(ds,'z',"baryon_overdensity",weight_field="baryon_overdensity",center=c,data_source=my_region) (with c, my_region being previously defined). When I do this, it complains: yt.fields.field_exceptions.NeedsParameter: (['omega_baryon']) which certainly makes sense from a physical perspective, and which Enzo doesn't natively carry around. I tried to set this by hand: ds.parameters['omega_baryon'] = 0.046 which was done prior to calling yt.ProjectionPlots. This does not seem to fix the problem. Any thoughts? Thanks! --Brian

Hi Brian, On Mon, Aug 18, 2014 at 8:34 PM, Brian O'Shea <bwoshea@gmail.com> wrote:
Hi folks,
I am using yt-3, and attempting to make a ProjectionPlot of the derived field 'baryon_overdensity' (using an Enzo dataset). The line in question is this:
plot1 = yt.ProjectionPlot(ds,'z',"baryon_overdensity",weight_field="baryon_overdensity",center=c,data_source=my_region)
You should set it via "field_parameters = {'omega_baryon': your_favorite_cosmology}" in this function call. There was some recent back and forth about this in a pull request and whether or not it goes into my_region, but this should certainly work. -Matt
(with c, my_region being previously defined). When I do this, it complains:
yt.fields.field_exceptions.NeedsParameter: (['omega_baryon'])
which certainly makes sense from a physical perspective, and which Enzo doesn't natively carry around. I tried to set this by hand:
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hi Matt,
plot1 =
yt.ProjectionPlot(ds,'z',"baryon_overdensity",weight_field="baryon_overdensity",center=c,data_source=my_region)
You should set it via "field_parameters = {'omega_baryon': your_favorite_cosmology}" in this function call. There was some recent back and forth about this in a pull request and whether or not it goes into my_region, but this should certainly work.
That did the trick, thank you! Now, followup question: I am also attempting to create a 2D phase plot of the same quantity (baryon_overdensity vs. temperature), and yt.PhasePlot does not seem to take the field_parameters dictionary, and neither does yt.create_profile. Should I try another avenue to create a phase plot? --Brian
-Matt
(with c, my_region being previously defined). When I do this, it
complains:
yt.fields.field_exceptions.NeedsParameter: (['omega_baryon'])
which certainly makes sense from a physical perspective, and which Enzo doesn't natively carry around. I tried to set this by hand:
_______________________________________________ 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

On Mon, Aug 18, 2014 at 7:02 PM, Brian O'Shea <bwoshea@gmail.com> wrote:
Hi Matt,
plot1 =
yt.ProjectionPlot(ds,'z',"baryon_overdensity",weight_field="baryon_overdensity",center=c,data_source=my_region)
You should set it via "field_parameters = {'omega_baryon': your_favorite_cosmology}" in this function call. There was some recent back and forth about this in a pull request and whether or not it goes into my_region, but this should certainly work.
That did the trick, thank you!
Now, followup question: I am also attempting to create a 2D phase plot of the same quantity (baryon_overdensity vs. temperature), and yt.PhasePlot does not seem to take the field_parameters dictionary, and neither does yt.create_profile. Should I try another avenue to create a phase plot?
--Brian
You should be able to call set_field_parameter on the data object you use to create the phase plot. Presumably we could add a field_parameters keyword argument to make these APIs consistent, but it makes less sense here since you are directly passing in a data source to create a PhasePlot or a ProfileND object.
-Matt
(with c, my_region being previously defined). When I do this, it
complains:
yt.fields.field_exceptions.NeedsParameter: (['omega_baryon'])
which certainly makes sense from a physical perspective, and which Enzo doesn't natively carry around. I tried to set this by hand:
_______________________________________________ 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

On Aug 18, 2014 9:02 PM, "Brian O'Shea" <bwoshea@gmail.com> wrote:
Hi Matt,
plot1 =
You should set it via "field_parameters = {'omega_baryon': your_favorite_cosmology}" in this function call. There was some recent back and forth about this in a pull request and whether or not it goes into my_region, but this should certainly work.
That did the trick, thank you!
Now, followup question: I am also attempting to create a 2D phase plot of
yt.ProjectionPlot(ds,'z',"baryon_overdensity",weight_field="baryon_overdensity",center=c,data_source=my_region) the same quantity (baryon_overdensity vs. temperature), and yt.PhasePlot does not seem to take the field_parameters dictionary, and neither does yt.create_profile. Should I try another avenue to create a phase plot?
Nope, you can supply it to your data source when you create it. They all take the same field_parameters argument. Matt
--Brian
-Matt
(with c, my_region being previously defined). When I do this, it
complains:
yt.fields.field_exceptions.NeedsParameter: (['omega_baryon'])
which certainly makes sense from a physical perspective, and which Enzo doesn't natively carry around. I tried to set this by hand:
_______________________________________________ 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

Now, followup question: I am also attempting to create a 2D phase plot
of the same quantity (baryon_overdensity vs. temperature), and yt.PhasePlot does not seem to take the field_parameters dictionary, and neither does yt.create_profile. Should I try another avenue to create a phase plot?
Nope, you can supply it to your data source when you create it. They all take the same field_parameters argument.
Hmm. So when I tried that, using: ad = ds.region(center=[0.5,0.5,0.5],left_edge=[0,0,0],right_edge=[1,1,1],field_parameters = {'omega_baryon':0.046}) (as ds.all_data() does not accept any additional arguments), I get this error: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-a78c8b2667cc> in <module>() ----> 1 ad = ds.region(center=[0.5,0.5,0.5],left_edge=[0,0,0],right_edge=[1,1,1],field_parameters = {'omega_baryon':0.046}) /Users/bwoshea/Desktop/yt-3.0/src/yt-hg/yt/data_objects/selection_data_containers.pyc in __init__(self, center, left_edge, right_edge, fields, ds, **kwargs) 577 def __init__(self, center, left_edge, right_edge, fields = None, 578 ds = None, **kwargs): --> 579 YTSelectionContainer3D.__init__(self, center, fields, ds, **kwargs) 580 if not isinstance(left_edge, YTArray): 581 self.left_edge = self.ds.arr(left_edge, 'code_length') TypeError: __init__() got multiple values for keyword argument 'field_parameters' Is that expected behavior, or do I misunderstand what you're saying? Thanks, Brian
Matt
--Brian
-Matt
(with c, my_region being previously defined). When I do this, it
complains:
yt.fields.field_exceptions.NeedsParameter: (['omega_baryon'])
which certainly makes sense from a physical perspective, and which
Enzo
doesn't natively carry around. I tried to set this by hand:
_______________________________________________ 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

HI Brian, ds.all_data is a just a wrapper around ds.region that uses ds.domain_left_edge and ds.domain_right_edge. Looking at the source, I can see that it wasn't set up to accept any additional keyword arguments and pass them to region. This can be fixed easily in yt/data_objects/static_output.py (line 575), but in the mean time, you can just replace your ds.all_data call with: ds.region((ds.domain_right_edge + ds.domain_left_edge)/2., ds.domain_left_edge, ds.domain_right_edge) and add your field_parameters keyword there. Britton On Tue, Aug 19, 2014 at 10:51 AM, Brian O'Shea <bwoshea@gmail.com> wrote:
Now, followup question: I am also attempting to create a 2D phase plot
of the same quantity (baryon_overdensity vs. temperature), and yt.PhasePlot does not seem to take the field_parameters dictionary, and neither does yt.create_profile. Should I try another avenue to create a phase plot?
Nope, you can supply it to your data source when you create it. They all take the same field_parameters argument.
Hmm. So when I tried that, using:
ad = ds.region(center=[0.5,0.5,0.5],left_edge=[0,0,0],right_edge=[1,1,1],field_parameters = {'omega_baryon':0.046})
(as ds.all_data() does not accept any additional arguments), I get this error:
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-a78c8b2667cc> in <module>() ----> 1 ad = ds.region(center=[0.5,0.5,0.5],left_edge=[0,0,0],right_edge=[1,1,1],field_parameters = {'omega_baryon':0.046})
/Users/bwoshea/Desktop/yt-3.0/src/yt-hg/yt/data_objects/selection_data_containers.pyc in __init__(self, center, left_edge, right_edge, fields, ds, **kwargs) 577 def __init__(self, center, left_edge, right_edge, fields = None, 578 ds = None, **kwargs): --> 579 YTSelectionContainer3D.__init__(self, center, fields, ds, **kwargs) 580 if not isinstance(left_edge, YTArray): 581 self.left_edge = self.ds.arr(left_edge, 'code_length')
TypeError: __init__() got multiple values for keyword argument 'field_parameters'
Is that expected behavior, or do I misunderstand what you're saying?
Thanks, Brian
Matt
--Brian
-Matt
(with c, my_region being previously defined). When I do this, it
complains:
yt.fields.field_exceptions.NeedsParameter: (['omega_baryon'])
which certainly makes sense from a physical perspective, and which
Enzo
doesn't natively carry around. I tried to set this by hand:
_______________________________________________ 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
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org

Hi Britton, That's basically what I'm doing - I was already using ds.region. When I call ds.region() with these inputs: ad = ds.region((ds.domain_right_edge + ds.domain_left_edge)/2., ds.domain_left_edge, ds.domain_right_edge,field_parameters = {'omega_baryon':0.046} ) (so, modifying ds.region in the way you suggested, though it's functionally equivalent to what I was doing), I get: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-5-6daee9cdd9b5> in <module>() ----> 1 ad = ds.region((ds.domain_right_edge + ds.domain_left_edge)/2., ds.domain_left_edge, ds.domain_right_edge,field_parameters = {'omega_baryon':0.046} ) /Users/bwoshea/Desktop/yt-3.0/src/yt-hg/yt/data_objects/selection_data_containers.py in __init__(self, center, left_edge, right_edge, fields, ds, **kwargs) 577 def __init__(self, center, left_edge, right_edge, fields = None, 578 ds = None, **kwargs): --> 579 YTSelectionContainer3D.__init__(self, center, fields, ds, **kwargs) 580 if not isinstance(left_edge, YTArray): 581 self.left_edge = self.ds.arr(left_edge, 'code_length') TypeError: __init__() got multiple values for keyword argument 'field_parameters' Am I doing something wrong with how I use field_parameters in this circumstance? Thanks, Brian On Tue, Aug 19, 2014 at 5:59 AM, Britton Smith <brittonsmith@gmail.com> wrote:
HI Brian,
ds.all_data is a just a wrapper around ds.region that uses ds.domain_left_edge and ds.domain_right_edge. Looking at the source, I can see that it wasn't set up to accept any additional keyword arguments and pass them to region. This can be fixed easily in yt/data_objects/static_output.py (line 575), but in the mean time, you can just replace your ds.all_data call with: ds.region((ds.domain_right_edge + ds.domain_left_edge)/2., ds.domain_left_edge, ds.domain_right_edge) and add your field_parameters keyword there.
Britton
On Tue, Aug 19, 2014 at 10:51 AM, Brian O'Shea <bwoshea@gmail.com> wrote:
Now, followup question: I am also attempting to create a 2D phase plot
of the same quantity (baryon_overdensity vs. temperature), and yt.PhasePlot does not seem to take the field_parameters dictionary, and neither does yt.create_profile. Should I try another avenue to create a phase plot?
Nope, you can supply it to your data source when you create it. They all take the same field_parameters argument.
Hmm. So when I tried that, using:
ad = ds.region(center=[0.5,0.5,0.5],left_edge=[0,0,0],right_edge=[1,1,1],field_parameters = {'omega_baryon':0.046})
(as ds.all_data() does not accept any additional arguments), I get this error:
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-a78c8b2667cc> in <module>() ----> 1 ad = ds.region(center=[0.5,0.5,0.5],left_edge=[0,0,0],right_edge=[1,1,1],field_parameters = {'omega_baryon':0.046})
/Users/bwoshea/Desktop/yt-3.0/src/yt-hg/yt/data_objects/selection_data_containers.pyc in __init__(self, center, left_edge, right_edge, fields, ds, **kwargs) 577 def __init__(self, center, left_edge, right_edge, fields = None, 578 ds = None, **kwargs): --> 579 YTSelectionContainer3D.__init__(self, center, fields, ds, **kwargs) 580 if not isinstance(left_edge, YTArray): 581 self.left_edge = self.ds.arr(left_edge, 'code_length')
TypeError: __init__() got multiple values for keyword argument 'field_parameters'
Is that expected behavior, or do I misunderstand what you're saying?
Thanks, Brian
Matt
--Brian
-Matt
(with c, my_region being previously defined). When I do this, it
complains:
yt.fields.field_exceptions.NeedsParameter: (['omega_baryon'])
which certainly makes sense from a physical perspective, and which
Enzo
doesn't natively carry around. I tried to set this by hand:
_______________________________________________ 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
_______________________________________________ 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 Brian, I see the problem. The argument list for the superclass of region takes a different set of arguments that what is being passed in, so one was being interpreted as the field_parameters keyword arg. I have this fixed and will issue a PR now. Britton On Tue, Aug 19, 2014 at 11:36 AM, Brian O'Shea <bwoshea@gmail.com> wrote:
Hi Britton,
That's basically what I'm doing - I was already using ds.region. When I call ds.region() with these inputs:
ad = ds.region((ds.domain_right_edge + ds.domain_left_edge)/2., ds.domain_left_edge, ds.domain_right_edge,field_parameters = {'omega_baryon':0.046} )
(so, modifying ds.region in the way you suggested, though it's functionally equivalent to what I was doing), I get:
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-5-6daee9cdd9b5> in <module>() ----> 1 ad = ds.region((ds.domain_right_edge + ds.domain_left_edge)/2., ds.domain_left_edge, ds.domain_right_edge,field_parameters = {'omega_baryon':0.046} )
/Users/bwoshea/Desktop/yt-3.0/src/yt-hg/yt/data_objects/selection_data_containers.py in __init__(self, center, left_edge, right_edge, fields, ds, **kwargs) 577 def __init__(self, center, left_edge, right_edge, fields = None, 578 ds = None, **kwargs): --> 579 YTSelectionContainer3D.__init__(self, center, fields, ds, **kwargs) 580 if not isinstance(left_edge, YTArray): 581 self.left_edge = self.ds.arr(left_edge, 'code_length')
TypeError: __init__() got multiple values for keyword argument 'field_parameters'
Am I doing something wrong with how I use field_parameters in this circumstance?
Thanks, Brian
On Tue, Aug 19, 2014 at 5:59 AM, Britton Smith <brittonsmith@gmail.com> wrote:
HI Brian,
ds.all_data is a just a wrapper around ds.region that uses ds.domain_left_edge and ds.domain_right_edge. Looking at the source, I can see that it wasn't set up to accept any additional keyword arguments and pass them to region. This can be fixed easily in yt/data_objects/static_output.py (line 575), but in the mean time, you can just replace your ds.all_data call with: ds.region((ds.domain_right_edge + ds.domain_left_edge)/2., ds.domain_left_edge, ds.domain_right_edge) and add your field_parameters keyword there.
Britton
On Tue, Aug 19, 2014 at 10:51 AM, Brian O'Shea <bwoshea@gmail.com> wrote:
Now, followup question: I am also attempting to create a 2D phase
plot of the same quantity (baryon_overdensity vs. temperature), and yt.PhasePlot does not seem to take the field_parameters dictionary, and neither does yt.create_profile. Should I try another avenue to create a phase plot?
Nope, you can supply it to your data source when you create it. They all take the same field_parameters argument.
Hmm. So when I tried that, using:
ad = ds.region(center=[0.5,0.5,0.5],left_edge=[0,0,0],right_edge=[1,1,1],field_parameters = {'omega_baryon':0.046})
(as ds.all_data() does not accept any additional arguments), I get this error:
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-a78c8b2667cc> in <module>() ----> 1 ad = ds.region(center=[0.5,0.5,0.5],left_edge=[0,0,0],right_edge=[1,1,1],field_parameters = {'omega_baryon':0.046})
/Users/bwoshea/Desktop/yt-3.0/src/yt-hg/yt/data_objects/selection_data_containers.pyc in __init__(self, center, left_edge, right_edge, fields, ds, **kwargs) 577 def __init__(self, center, left_edge, right_edge, fields = None, 578 ds = None, **kwargs): --> 579 YTSelectionContainer3D.__init__(self, center, fields, ds, **kwargs) 580 if not isinstance(left_edge, YTArray): 581 self.left_edge = self.ds.arr(left_edge, 'code_length')
TypeError: __init__() got multiple values for keyword argument 'field_parameters'
Is that expected behavior, or do I misunderstand what you're saying?
Thanks, Brian
Matt
--Brian
-Matt
> > (with c, my_region being previously defined). When I do this, it
complains:
> > yt.fields.field_exceptions.NeedsParameter: (['omega_baryon']) > > which certainly makes sense from a physical perspective, and which Enzo > doesn't natively carry around. I tried to set this by hand: > > > _______________________________________________ > 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
_______________________________________________ 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

That fix it. Thank you! On Tue, Aug 19, 2014 at 6:53 AM, Britton Smith <brittonsmith@gmail.com> wrote:
Hi Brian,
I see the problem. The argument list for the superclass of region takes a different set of arguments that what is being passed in, so one was being interpreted as the field_parameters keyword arg. I have this fixed and will issue a PR now.
Britton
On Tue, Aug 19, 2014 at 11:36 AM, Brian O'Shea <bwoshea@gmail.com> wrote:
Hi Britton,
That's basically what I'm doing - I was already using ds.region. When I call ds.region() with these inputs:
ad = ds.region((ds.domain_right_edge + ds.domain_left_edge)/2., ds.domain_left_edge, ds.domain_right_edge,field_parameters = {'omega_baryon':0.046} )
(so, modifying ds.region in the way you suggested, though it's functionally equivalent to what I was doing), I get:
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-5-6daee9cdd9b5> in <module>() ----> 1 ad = ds.region((ds.domain_right_edge + ds.domain_left_edge)/2., ds.domain_left_edge, ds.domain_right_edge,field_parameters = {'omega_baryon':0.046} )
/Users/bwoshea/Desktop/yt-3.0/src/yt-hg/yt/data_objects/selection_data_containers.py in __init__(self, center, left_edge, right_edge, fields, ds, **kwargs) 577 def __init__(self, center, left_edge, right_edge, fields = None, 578 ds = None, **kwargs): --> 579 YTSelectionContainer3D.__init__(self, center, fields, ds, **kwargs) 580 if not isinstance(left_edge, YTArray): 581 self.left_edge = self.ds.arr(left_edge, 'code_length')
TypeError: __init__() got multiple values for keyword argument 'field_parameters'
Am I doing something wrong with how I use field_parameters in this circumstance?
Thanks, Brian
On Tue, Aug 19, 2014 at 5:59 AM, Britton Smith <brittonsmith@gmail.com> wrote:
HI Brian,
ds.all_data is a just a wrapper around ds.region that uses ds.domain_left_edge and ds.domain_right_edge. Looking at the source, I can see that it wasn't set up to accept any additional keyword arguments and pass them to region. This can be fixed easily in yt/data_objects/static_output.py (line 575), but in the mean time, you can just replace your ds.all_data call with: ds.region((ds.domain_right_edge + ds.domain_left_edge)/2., ds.domain_left_edge, ds.domain_right_edge) and add your field_parameters keyword there.
Britton
On Tue, Aug 19, 2014 at 10:51 AM, Brian O'Shea <bwoshea@gmail.com> wrote:
Now, followup question: I am also attempting to create a 2D phase
plot of the same quantity (baryon_overdensity vs. temperature), and yt.PhasePlot does not seem to take the field_parameters dictionary, and neither does yt.create_profile. Should I try another avenue to create a phase plot?
Nope, you can supply it to your data source when you create it. They all take the same field_parameters argument.
Hmm. So when I tried that, using:
ad = ds.region(center=[0.5,0.5,0.5],left_edge=[0,0,0],right_edge=[1,1,1],field_parameters = {'omega_baryon':0.046})
(as ds.all_data() does not accept any additional arguments), I get this error:
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-a78c8b2667cc> in <module>() ----> 1 ad = ds.region(center=[0.5,0.5,0.5],left_edge=[0,0,0],right_edge=[1,1,1],field_parameters = {'omega_baryon':0.046})
/Users/bwoshea/Desktop/yt-3.0/src/yt-hg/yt/data_objects/selection_data_containers.pyc in __init__(self, center, left_edge, right_edge, fields, ds, **kwargs) 577 def __init__(self, center, left_edge, right_edge, fields = None, 578 ds = None, **kwargs): --> 579 YTSelectionContainer3D.__init__(self, center, fields, ds, **kwargs) 580 if not isinstance(left_edge, YTArray): 581 self.left_edge = self.ds.arr(left_edge, 'code_length')
TypeError: __init__() got multiple values for keyword argument 'field_parameters'
Is that expected behavior, or do I misunderstand what you're saying?
Thanks, Brian
Matt
--Brian
> > > -Matt > > > > > (with c, my_region being previously defined). When I do this, it complains: > > > > yt.fields.field_exceptions.NeedsParameter: (['omega_baryon']) > > > > which certainly makes sense from a physical perspective, and which Enzo > > doesn't natively carry around. I tried to set this by hand: > > > > > > _______________________________________________ > > 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
_______________________________________________ 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
participants (4)
-
Brian O'Shea
-
Britton Smith
-
Matthew Turk
-
Nathan Goldbaum