Hi everyone,
I have recently started using YT to analyze my simulation data from RAMSES. I would like to plot rotational curves for my simulated galaxy but am not quite sure how to do it. Is there a specific function in YT to do so? Any help is greatly appreciated.
Hi,
The documentation about how to make 1D profiles (a rotation curve is basically <v_theta> vs. r) is located there http://yt-project.org/docs/dev/visualizing/plots.html?highlight=projection#d.... You can get the rotational velocity using e.g. velocity_spherical_xxx or velocity_cylindrical_xxx fields.
I hope that'll help ! Else, don't hesitate to send another mail!
Cheers,
Corentin
On 2018-01-25 12:48, Vadlamani Samhitha wrote:
Hi everyone,
I have recently started using YT to analyze my simulation data from RAMSES. I would like to plot rotational curves for my simulated galaxy but am not quite sure how to do it. Is there a specific function in YT to do so? Any help is greatly appreciated.
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Although this will only give you the rotation curve in the gas, to get the rotation curve from the potential takes a bit more work. Unfortunately, yt doesn’t have much functionality that’s directly helpful for that and the last time I needed this I went ahead and made my own package separate from yt:
https://bitbucket.org/ngoldbaum/galaxy_analysis
For the rotation curve specifically, this code derives it by taking the radial gradient of the potential in a slice at the galaxy’s midplane and then taking the cylindrical average:
https://bitbucket.org/ngoldbaum/galaxy_analysis/src/db50e8f3ae7ea78ba215d5ce...
My code works but is somewhat inefficient and also tuned to my exact simulations. Adding more general support for deriving rotation curves and Toomre Q parameters from simulations of disk galaxies to yt or to an afficiliated package would definitely be worth doing.
On Thu, Jan 25, 2018 at 8:18 AM Corentin CADIOU corentin.cadiou@iap.fr wrote:
Hi,
The documentation about how to make 1D profiles (a rotation curve is basically <v_theta> vs. r) is located there http://yt-project.org/docs/dev/visualizing/plots.html?highlight=projection#d.... You can get the rotational velocity using e.g. velocity_spherical_xxx or velocity_cylindrical_xxx fields.
I hope that'll help ! Else, don't hesitate to send another mail!
Cheers,
Corentin
On 2018-01-25 12:48, Vadlamani Samhitha wrote:
Hi everyone,
I have recently started using YT to analyze my simulation data from RAMSES. I would like to plot rotational curves for my simulated galaxy but am not quite sure how to do it. Is there a specific function in YT to do so? Any help is greatly appreciated.
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
-- Corentin Cadiou PhD student Institut d'Astrophysique de Paris (IAP), desk 142b 98 bis boulevard Arago 75014 Paris, France
phone: +33.6.43.18.66.83
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
I see, How about obtaining the rotational curves for gas and matter separately and then adding them up? Would that be simpler (even if its an approximate) instead of considering the potential directly? I modelled stars and dark matter under particles and gas as fluid on the mesh and I have the following my fields_list: ( I am dealing with cartesian coordinates. So, I don't have the spherical coordinates in my fields_list)
*" ('all', 'particle_extra_field_1')* *('all', 'particle_extra_field_2')* *('all', 'particle_extra_field_3')* *('all', 'particle_extra_field_4')* *('all', 'particle_extra_field_5')* *('all', 'particle_identifier')* *('all', 'particle_mass')* *('all', 'particle_position_x')* *('all', 'particle_position_y')* *('all', 'particle_position_z')* *('all', 'particle_refinement_level')* *('all', 'particle_velocity_x')* *('all', 'particle_velocity_y')* *('all', 'particle_velocity_z')* *('io', 'particle_extra_field_1')* *('io', 'particle_extra_field_2')* *('io', 'particle_extra_field_3')* *('io', 'particle_extra_field_4')* *('io', 'particle_extra_field_5')* *('io', 'particle_identifier')* *('io', 'particle_mass')* *('io', 'particle_position_x')* *('io', 'particle_position_y')* *('io', 'particle_position_z')* *('io', 'particle_refinement_level')* *('io', 'particle_velocity_x')* *('io', 'particle_velocity_y')* *('io', 'particle_velocity_z')* *('ramses', 'Density')* *('ramses', 'Metallicity')* *('ramses', 'Pressure')* *('ramses', 'var6')* *('ramses', 'x-velocity')* *('ramses', 'y-velocity')* *('ramses', 'z-velocity') "*
So, I am thinking that the highlighted fields in the type 'all' could be used to compute circular velocity [sqrt(particle_velocity_x^2+particle_velocity_y^2)] and the radius [sqrt(particle_position_x^2+particle_position_y^2)] for particles. And for gas, 'ramses' fields could be used. However, I am not sure how to get the radius for the gas in this case. Would this be a right approach at all to begin with?
You’re looking for the “particle_radius” field.
On Thu, Jan 25, 2018 at 9:01 AM Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
I see, How about obtaining the rotational curves for gas and matter separately and then adding them up? Would that be simpler (even if its an approximate) instead of considering the potential directly? I modelled stars and dark matter under particles and gas as fluid on the mesh and I have the following my fields_list: ( I am dealing with cartesian coordinates. So, I don't have the spherical coordinates in my fields_list)
*" ('all', 'particle_extra_field_1')* *('all', 'particle_extra_field_2')* *('all', 'particle_extra_field_3')* *('all', 'particle_extra_field_4')* *('all', 'particle_extra_field_5')* *('all', 'particle_identifier')* *('all', 'particle_mass')* *('all', 'particle_position_x')* *('all', 'particle_position_y')* *('all', 'particle_position_z')* *('all', 'particle_refinement_level')* *('all', 'particle_velocity_x')* *('all', 'particle_velocity_y')* *('all', 'particle_velocity_z')* *('io', 'particle_extra_field_1')* *('io', 'particle_extra_field_2')* *('io', 'particle_extra_field_3')* *('io', 'particle_extra_field_4')* *('io', 'particle_extra_field_5')* *('io', 'particle_identifier')* *('io', 'particle_mass')* *('io', 'particle_position_x')* *('io', 'particle_position_y')* *('io', 'particle_position_z')* *('io', 'particle_refinement_level')* *('io', 'particle_velocity_x')* *('io', 'particle_velocity_y')* *('io', 'particle_velocity_z')* *('ramses', 'Density')* *('ramses', 'Metallicity')* *('ramses', 'Pressure')* *('ramses', 'var6')* *('ramses', 'x-velocity')* *('ramses', 'y-velocity')* *('ramses', 'z-velocity') "*
So, I am thinking that the highlighted fields in the type 'all' could be used to compute circular velocity [sqrt(particle_velocity_x^2+particle_velocity_y^2)] and the radius [sqrt(particle_position_x^2+particle_position_y^2)] for particles. And for gas, 'ramses' fields could be used. However, I am not sure how to get the radius for the gas in this case. Would this be a right approach at all to begin with? _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Sorry, I didn't get what you meant.
On Thu, Jan 25, 2018 at 4:04 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
You’re looking for the “particle_radius” field.
On Thu, Jan 25, 2018 at 9:01 AM Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
I see, How about obtaining the rotational curves for gas and matter separately and then adding them up? Would that be simpler (even if its an approximate) instead of considering the potential directly? I modelled stars and dark matter under particles and gas as fluid on the mesh and I have the following my fields_list: ( I am dealing with cartesian coordinates. So, I don't have the spherical coordinates in my fields_list)
*" ('all', 'particle_extra_field_1')* *('all', 'particle_extra_field_2')* *('all', 'particle_extra_field_3')* *('all', 'particle_extra_field_4')* *('all', 'particle_extra_field_5')* *('all', 'particle_identifier')* *('all', 'particle_mass')* *('all', 'particle_position_x')* *('all', 'particle_position_y')* *('all', 'particle_position_z')* *('all', 'particle_refinement_level')* *('all', 'particle_velocity_x')* *('all', 'particle_velocity_y')* *('all', 'particle_velocity_z')* *('io', 'particle_extra_field_1')* *('io', 'particle_extra_field_2')* *('io', 'particle_extra_field_3')* *('io', 'particle_extra_field_4')* *('io', 'particle_extra_field_5')* *('io', 'particle_identifier')* *('io', 'particle_mass')* *('io', 'particle_position_x')* *('io', 'particle_position_y')* *('io', 'particle_position_z')* *('io', 'particle_refinement_level')* *('io', 'particle_velocity_x')* *('io', 'particle_velocity_y')* *('io', 'particle_velocity_z')* *('ramses', 'Density')* *('ramses', 'Metallicity')* *('ramses', 'Pressure')* *('ramses', 'var6')* *('ramses', 'x-velocity')* *('ramses', 'y-velocity')* *('ramses', 'z-velocity') "*
So, I am thinking that the highlighted fields in the type 'all' could be used to compute circular velocity [sqrt(particle_velocity_x^2+particle_velocity_y^2)] and the radius [sqrt(particle_position_x^2+particle_position_y^2)] for particles. And for gas, 'ramses' fields could be used. However, I am not sure how to get the radius for the gas in this case. Would this be a right approach at all to begin with? _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Oh, sorry, you said you wanted the radius of the gas.
You can access the radius of all of the AMR cells with the ("index", "radius") field. For the particle fields, as I said in my previous e-mail, you can access the radii using the ('io', 'particle_radius') field.
Also note that both of these fields depend on the "center" field parameter, which you can set on a data object to control the center the radii are computed with respect to. You can read more about field parameters here:
http://yt-project.org/docs/3.4.0/analyzing/fields.html#field-parameters
On Thu, Jan 25, 2018 at 9:16 AM, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Sorry, I didn't get what you meant.
On Thu, Jan 25, 2018 at 4:04 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
You’re looking for the “particle_radius” field.
On Thu, Jan 25, 2018 at 9:01 AM Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
I see, How about obtaining the rotational curves for gas and matter separately and then adding them up? Would that be simpler (even if its an approximate) instead of considering the potential directly? I modelled stars and dark matter under particles and gas as fluid on the mesh and I have the following my fields_list: ( I am dealing with cartesian coordinates. So, I don't have the spherical coordinates in my fields_list)
*" ('all', 'particle_extra_field_1')* *('all', 'particle_extra_field_2')* *('all', 'particle_extra_field_3')* *('all', 'particle_extra_field_4')* *('all', 'particle_extra_field_5')* *('all', 'particle_identifier')* *('all', 'particle_mass')* *('all', 'particle_position_x')* *('all', 'particle_position_y')* *('all', 'particle_position_z')* *('all', 'particle_refinement_level')* *('all', 'particle_velocity_x')* *('all', 'particle_velocity_y')* *('all', 'particle_velocity_z')* *('io', 'particle_extra_field_1')* *('io', 'particle_extra_field_2')* *('io', 'particle_extra_field_3')* *('io', 'particle_extra_field_4')* *('io', 'particle_extra_field_5')* *('io', 'particle_identifier')* *('io', 'particle_mass')* *('io', 'particle_position_x')* *('io', 'particle_position_y')* *('io', 'particle_position_z')* *('io', 'particle_refinement_level')* *('io', 'particle_velocity_x')* *('io', 'particle_velocity_y')* *('io', 'particle_velocity_z')* *('ramses', 'Density')* *('ramses', 'Metallicity')* *('ramses', 'Pressure')* *('ramses', 'var6')* *('ramses', 'x-velocity')* *('ramses', 'y-velocity')* *('ramses', 'z-velocity') "*
So, I am thinking that the highlighted fields in the type 'all' could be used to compute circular velocity [sqrt(particle_velocity_x^2+particle_velocity_y^2)] and the radius [sqrt(particle_position_x^2+particle_position_y^2)] for particles. And for gas, 'ramses' fields could be used. However, I am not sure how to get the radius for the gas in this case. Would this be a right approach at all to begin with? _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
From what I see from your mail, it looks like you're only listing the field_list. You can get a much more comprehensive list using 'ds.derived_field_list' which include e.g. the angular velocity. These fields aren't directly read from your output but are computed (or derived) quantities, such as the entropy, the dynamical time, … and you an use them for 1D profiles too.
Corentin Cadiou
On 25 janv. 2018, at 16:16, Vadlamani Samhitha vadlamani.samhitha@gmail.com wrote:
Sorry, I didn't get what you meant.
On Thu, Jan 25, 2018 at 4:04 PM, Nathan Goldbaum nathan12343@gmail.com wrote: You’re looking for the “particle_radius” field.
On Thu, Jan 25, 2018 at 9:01 AM Vadlamani Samhitha vadlamani.samhitha@gmail.com wrote: I see, How about obtaining the rotational curves for gas and matter separately and then adding them up? Would that be simpler (even if its an approximate) instead of considering the potential directly? I modelled stars and dark matter under particles and gas as fluid on the mesh and I have the following my fields_list: ( I am dealing with cartesian coordinates. So, I don't have the spherical coordinates in my fields_list)
" ('all', 'particle_extra_field_1') ('all', 'particle_extra_field_2') ('all', 'particle_extra_field_3') ('all', 'particle_extra_field_4') ('all', 'particle_extra_field_5') ('all', 'particle_identifier') ('all', 'particle_mass') ('all', 'particle_position_x') ('all', 'particle_position_y') ('all', 'particle_position_z') ('all', 'particle_refinement_level') ('all', 'particle_velocity_x') ('all', 'particle_velocity_y') ('all', 'particle_velocity_z') ('io', 'particle_extra_field_1') ('io', 'particle_extra_field_2') ('io', 'particle_extra_field_3') ('io', 'particle_extra_field_4') ('io', 'particle_extra_field_5') ('io', 'particle_identifier') ('io', 'particle_mass') ('io', 'particle_position_x') ('io', 'particle_position_y') ('io', 'particle_position_z') ('io', 'particle_refinement_level') ('io', 'particle_velocity_x') ('io', 'particle_velocity_y') ('io', 'particle_velocity_z') ('ramses', 'Density') ('ramses', 'Metallicity') ('ramses', 'Pressure') ('ramses', 'var6') ('ramses', 'x-velocity') ('ramses', 'y-velocity') ('ramses', 'z-velocity') "
So, I am thinking that the highlighted fields in the type 'all' could be used to compute circular velocity [sqrt(particle_velocity_x^2+particle_velocity_y^2)] and the radius [sqrt(particle_position_x^2+particle_position_y^2)] for particles. And for gas, 'ramses' fields could be used. However, I am not sure how to get the radius for the gas in this case. Would this be a right approach at all to begin with? _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Hey thanks, then, are these derived fields computed automatically and available to access when the data is loaded or does the user have to manually compute as in here http://yt-project.org/doc/developing/creating_derived_fields.html?
On Thu, Jan 25, 2018 at 6:06 PM, Contact contact@cphyc.me wrote:
From what I see from your mail, it looks like you're only listing the field_list. You can get a much more comprehensive list using 'ds.derived_field_list' which include e.g. the angular velocity. These fields aren't directly read from your output but are computed (or derived) quantities, such as the entropy, the dynamical time, … and you an use them for 1D profiles too.
Corentin Cadiou
On 25 janv. 2018, at 16:16, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Sorry, I didn't get what you meant.
On Thu, Jan 25, 2018 at 4:04 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
You’re looking for the “particle_radius” field.
On Thu, Jan 25, 2018 at 9:01 AM Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
I see, How about obtaining the rotational curves for gas and matter separately and then adding them up? Would that be simpler (even if its an approximate) instead of considering the potential directly? I modelled stars and dark matter under particles and gas as fluid on the mesh and I have the following my fields_list: ( I am dealing with cartesian coordinates. So, I don't have the spherical coordinates in my fields_list)
*" ('all', 'particle_extra_field_1')* *('all', 'particle_extra_field_2')* *('all', 'particle_extra_field_3')* *('all', 'particle_extra_field_4')* *('all', 'particle_extra_field_5')* *('all', 'particle_identifier')* *('all', 'particle_mass')* *('all', 'particle_position_x')* *('all', 'particle_position_y')* *('all', 'particle_position_z')* *('all', 'particle_refinement_level')* *('all', 'particle_velocity_x')* *('all', 'particle_velocity_y')* *('all', 'particle_velocity_z')* *('io', 'particle_extra_field_1')* *('io', 'particle_extra_field_2')* *('io', 'particle_extra_field_3')* *('io', 'particle_extra_field_4')* *('io', 'particle_extra_field_5')* *('io', 'particle_identifier')* *('io', 'particle_mass')* *('io', 'particle_position_x')* *('io', 'particle_position_y')* *('io', 'particle_position_z')* *('io', 'particle_refinement_level')* *('io', 'particle_velocity_x')* *('io', 'particle_velocity_y')* *('io', 'particle_velocity_z')* *('ramses', 'Density')* *('ramses', 'Metallicity')* *('ramses', 'Pressure')* *('ramses', 'var6')* *('ramses', 'x-velocity')* *('ramses', 'y-velocity')* *('ramses', 'z-velocity') "*
So, I am thinking that the highlighted fields in the type 'all' could be used to compute circular velocity [sqrt(particle_velocity_x^2+particle_velocity_y^2)] and the radius [sqrt(particle_position_x^2+particle_position_y^2)] for particles. And for gas, 'ramses' fields could be used. However, I am not sure how to get the radius for the gas in this case. Would this be a right approach at all to begin with? _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Hey again, I thought of a simpler way to get the rotational curves, basically using the mass enclosed in a sphere http://yt-project.org/doc/cookbook/calculating_information.html to calculate the circular velocity. To be more precise, I do the following:
*filename="output_00010/info_00010.txt" * *ds=yt.simulation(filename)* *G=yt.YTArray(4*np.pi**2,'au**3/yr**2/Msun')* *temp=np.arange(0.5, 40, 0.1)* *x=yt.YTArray(temp,'kpc')* *V_c = np.array([])* *for i in x: * * sp = ds.sphere("c", (i, "kpc"))* * print(i)* *# This recipe constructs a sphere and then sums the total mass in particles and fluids in the sphere*
* baryon_mass, particle_mass = sp.quantities.total_quantity(["cell_mass", "particle_mass"])* * M_total=(baryon_mass+particle_mass).in_units('Msun')* * circular=np.sqrt(G*M_total/i).in_units('km/s')* * V_c=np.append(V_c, circular)* *plt.plot(temp,V_c)* *plt.show()*
but ended up with a curve attached in the link below. But we expect a flat rotation curve and not keplerian decrease. Is this a valid approach to get the rotation curves in YT?
Thanks!
On Fri, Jan 26, 2018 at 2:22 PM, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Hey thanks, then, are these derived fields computed automatically and available to access when the data is loaded or does the user have to manually compute as in here http://yt-project.org/doc/developing/creating_derived_fields.html?
On Thu, Jan 25, 2018 at 6:06 PM, Contact contact@cphyc.me wrote:
From what I see from your mail, it looks like you're only listing the field_list. You can get a much more comprehensive list using 'ds.derived_field_list' which include e.g. the angular velocity. These fields aren't directly read from your output but are computed (or derived) quantities, such as the entropy, the dynamical time, … and you an use them for 1D profiles too.
Corentin Cadiou
On 25 janv. 2018, at 16:16, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Sorry, I didn't get what you meant.
On Thu, Jan 25, 2018 at 4:04 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
You’re looking for the “particle_radius” field.
On Thu, Jan 25, 2018 at 9:01 AM Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
I see, How about obtaining the rotational curves for gas and matter separately and then adding them up? Would that be simpler (even if its an approximate) instead of considering the potential directly? I modelled stars and dark matter under particles and gas as fluid on the mesh and I have the following my fields_list: ( I am dealing with cartesian coordinates. So, I don't have the spherical coordinates in my fields_list)
*" ('all', 'particle_extra_field_1')* *('all', 'particle_extra_field_2')* *('all', 'particle_extra_field_3')* *('all', 'particle_extra_field_4')* *('all', 'particle_extra_field_5')* *('all', 'particle_identifier')* *('all', 'particle_mass')* *('all', 'particle_position_x')* *('all', 'particle_position_y')* *('all', 'particle_position_z')* *('all', 'particle_refinement_level')* *('all', 'particle_velocity_x')* *('all', 'particle_velocity_y')* *('all', 'particle_velocity_z')* *('io', 'particle_extra_field_1')* *('io', 'particle_extra_field_2')* *('io', 'particle_extra_field_3')* *('io', 'particle_extra_field_4')* *('io', 'particle_extra_field_5')* *('io', 'particle_identifier')* *('io', 'particle_mass')* *('io', 'particle_position_x')* *('io', 'particle_position_y')* *('io', 'particle_position_z')* *('io', 'particle_refinement_level')* *('io', 'particle_velocity_x')* *('io', 'particle_velocity_y')* *('io', 'particle_velocity_z')* *('ramses', 'Density')* *('ramses', 'Metallicity')* *('ramses', 'Pressure')* *('ramses', 'var6')* *('ramses', 'x-velocity')* *('ramses', 'y-velocity')* *('ramses', 'z-velocity') "*
So, I am thinking that the highlighted fields in the type 'all' could be used to compute circular velocity [sqrt(particle_velocity_x^2+particle_velocity_y^2)] and the radius [sqrt(particle_position_x^2+particle_position_y^2)] for particles. And for gas, 'ramses' fields could be used. However, I am not sure how to get the radius for the gas in this case. Would this be a right approach at all to begin with? _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Remember that v_c generally depends on mass at larger radii too; it's only a few special cases where you only need to know the mass enclosed in a sphere (e.g. spherical mass distribution, or a Mestel disk). This is discussed in Binney & Tremaine's book in section 2.6.1.
Unfortunately I don't know a good, general way for calculating v_c off the top of my head.
-- Eric Gentry PhD Candidate ISB 159 | ericsgentry.com Astronomy and Astrophysics University of California, Santa Cruz
On Sun, Jan 28, 2018 at 3:58 AM, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Hey again, I thought of a simpler way to get the rotational curves, basically using the mass enclosed in a sphere http://yt-project.org/doc/cookbook/calculating_information.html to calculate the circular velocity. To be more precise, I do the following:
*filename="output_00010/info_00010.txt" * *ds=yt.simulation(filename)* *G=yt.YTArray(4*np.pi**2,'au**3/yr**2/Msun')* *temp=np.arange(0.5, 40, 0.1)* *x=yt.YTArray(temp,'kpc')* *V_c = np.array([])* *for i in x: *
- sp = ds.sphere("c", (i, "kpc"))*
- print(i)*
*# This recipe constructs a sphere and then sums the total mass in particles and fluids in the sphere*
- baryon_mass, particle_mass = sp.quantities.total_quantity(["cell_mass",
"particle_mass"])*
- M_total=(baryon_mass+particle_mass).in_units('Msun')*
- circular=np.sqrt(G*M_total/i).in_units('km/s')*
- V_c=np.append(V_c, circular)*
*plt.plot(temp,V_c)* *plt.show()*
but ended up with a curve attached in the link below. But we expect a flat rotation curve and not keplerian decrease. Is this a valid approach to get the rotation curves in YT?
Thanks!
On Fri, Jan 26, 2018 at 2:22 PM, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Hey thanks, then, are these derived fields computed automatically and available to access when the data is loaded or does the user have to manually compute as in here http://yt-project.org/doc/developing/creating_derived_fields.html?
On Thu, Jan 25, 2018 at 6:06 PM, Contact contact@cphyc.me wrote:
From what I see from your mail, it looks like you're only listing the field_list. You can get a much more comprehensive list using 'ds.derived_field_list' which include e.g. the angular velocity. These fields aren't directly read from your output but are computed (or derived) quantities, such as the entropy, the dynamical time, … and you an use them for 1D profiles too.
Corentin Cadiou
On 25 janv. 2018, at 16:16, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Sorry, I didn't get what you meant.
On Thu, Jan 25, 2018 at 4:04 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
You’re looking for the “particle_radius” field.
On Thu, Jan 25, 2018 at 9:01 AM Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
I see, How about obtaining the rotational curves for gas and matter separately and then adding them up? Would that be simpler (even if its an approximate) instead of considering the potential directly? I modelled stars and dark matter under particles and gas as fluid on the mesh and I have the following my fields_list: ( I am dealing with cartesian coordinates. So, I don't have the spherical coordinates in my fields_list)
*" ('all', 'particle_extra_field_1')* *('all', 'particle_extra_field_2')* *('all', 'particle_extra_field_3')* *('all', 'particle_extra_field_4')* *('all', 'particle_extra_field_5')* *('all', 'particle_identifier')* *('all', 'particle_mass')* *('all', 'particle_position_x')* *('all', 'particle_position_y')* *('all', 'particle_position_z')* *('all', 'particle_refinement_level')* *('all', 'particle_velocity_x')* *('all', 'particle_velocity_y')* *('all', 'particle_velocity_z')* *('io', 'particle_extra_field_1')* *('io', 'particle_extra_field_2')* *('io', 'particle_extra_field_3')* *('io', 'particle_extra_field_4')* *('io', 'particle_extra_field_5')* *('io', 'particle_identifier')* *('io', 'particle_mass')* *('io', 'particle_position_x')* *('io', 'particle_position_y')* *('io', 'particle_position_z')* *('io', 'particle_refinement_level')* *('io', 'particle_velocity_x')* *('io', 'particle_velocity_y')* *('io', 'particle_velocity_z')* *('ramses', 'Density')* *('ramses', 'Metallicity')* *('ramses', 'Pressure')* *('ramses', 'var6')* *('ramses', 'x-velocity')* *('ramses', 'y-velocity')* *('ramses', 'z-velocity') "*
So, I am thinking that the highlighted fields in the type 'all' could be used to compute circular velocity [sqrt(particle_velocity_x^2+particle_velocity_y^2)] and the radius [sqrt(particle_position_x^2+particle_position_y^2)] for particles. And for gas, 'ramses' fields could be used. However, I am not sure how to get the radius for the gas in this case. Would this be a right approach at all to begin with? _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
Hi again,
Thanks for all the responses. As Corentin suggested, I tried a ProfilePlot for just the particles using phi component of the velocity, but I still don't get a rotational curve atleast close to what is expected. Also, the velocity seems unreasonably high (10^4 km/s). Any other possible ideas? " *filename="SIM001/output_00030/info_00030.txt"* *ds=yt.load(filename)* *sp = ds.sphere('c', 100*kpc)* *plot = yt.ProfilePlot(sp, "particle_radius", ["particle_spherical_velocity_phi"], weight_field=None)* *plot.set_unit("particle_spherical_velocity_phi", "km/s")* *plot.set_unit("particle_radius", "kpc")* *plot.save()* " [image: Inline image 1]
On Sun, Jan 28, 2018 at 4:59 PM, Eric Gentry egentry@ucsc.edu wrote:
Remember that v_c generally depends on mass at larger radii too; it's only a few special cases where you only need to know the mass enclosed in a sphere (e.g. spherical mass distribution, or a Mestel disk). This is discussed in Binney & Tremaine's book in section 2.6.1.
Unfortunately I don't know a good, general way for calculating v_c off the top of my head.
-- Eric Gentry PhD Candidate ISB 159 | ericsgentry.com Astronomy and Astrophysics University of California, Santa Cruz
On Sun, Jan 28, 2018 at 3:58 AM, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Hey again, I thought of a simpler way to get the rotational curves, basically using the mass enclosed in a sphere http://yt-project.org/doc/cookbook/calculating_information.html to calculate the circular velocity. To be more precise, I do the following:
*filename="output_00010/info_00010.txt" * *ds=yt.simulation(filename)* *G=yt.YTArray(4*np.pi**2,'au**3/yr**2/Msun')* *temp=np.arange(0.5, 40, 0.1)* *x=yt.YTArray(temp,'kpc')* *V_c = np.array([])* *for i in x: *
- sp = ds.sphere("c", (i, "kpc"))*
- print(i)*
*# This recipe constructs a sphere and then sums the total mass in particles and fluids in the sphere*
- baryon_mass, particle_mass = sp.quantities.total_quantity(["cell_mass",
"particle_mass"])*
- M_total=(baryon_mass+particle_mass).in_units('Msun')*
- circular=np.sqrt(G*M_total/i).in_units('km/s')*
- V_c=np.append(V_c, circular)*
*plt.plot(temp,V_c)* *plt.show()*
but ended up with a curve attached in the link below. But we expect a flat rotation curve and not keplerian decrease. Is this a valid approach to get the rotation curves in YT?
Thanks!
On Fri, Jan 26, 2018 at 2:22 PM, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Hey thanks, then, are these derived fields computed automatically and available to access when the data is loaded or does the user have to manually compute as in here http://yt-project.org/doc/developing/creating_derived_fields.html ?
On Thu, Jan 25, 2018 at 6:06 PM, Contact contact@cphyc.me wrote:
From what I see from your mail, it looks like you're only listing the field_list. You can get a much more comprehensive list using 'ds.derived_field_list' which include e.g. the angular velocity. These fields aren't directly read from your output but are computed (or derived) quantities, such as the entropy, the dynamical time, … and you an use them for 1D profiles too.
Corentin Cadiou
On 25 janv. 2018, at 16:16, Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
Sorry, I didn't get what you meant.
On Thu, Jan 25, 2018 at 4:04 PM, Nathan Goldbaum <nathan12343@gmail.com
wrote:
You’re looking for the “particle_radius” field.
On Thu, Jan 25, 2018 at 9:01 AM Vadlamani Samhitha < vadlamani.samhitha@gmail.com> wrote:
I see, How about obtaining the rotational curves for gas and matter separately and then adding them up? Would that be simpler (even if its an approximate) instead of considering the potential directly? I modelled stars and dark matter under particles and gas as fluid on the mesh and I have the following my fields_list: ( I am dealing with cartesian coordinates. So, I don't have the spherical coordinates in my fields_list)
*" ('all', 'particle_extra_field_1')* *('all', 'particle_extra_field_2')* *('all', 'particle_extra_field_3')* *('all', 'particle_extra_field_4')* *('all', 'particle_extra_field_5')* *('all', 'particle_identifier')* *('all', 'particle_mass')* *('all', 'particle_position_x')* *('all', 'particle_position_y')* *('all', 'particle_position_z')* *('all', 'particle_refinement_level')* *('all', 'particle_velocity_x')* *('all', 'particle_velocity_y')* *('all', 'particle_velocity_z')* *('io', 'particle_extra_field_1')* *('io', 'particle_extra_field_2')* *('io', 'particle_extra_field_3')* *('io', 'particle_extra_field_4')* *('io', 'particle_extra_field_5')* *('io', 'particle_identifier')* *('io', 'particle_mass')* *('io', 'particle_position_x')* *('io', 'particle_position_y')* *('io', 'particle_position_z')* *('io', 'particle_refinement_level')* *('io', 'particle_velocity_x')* *('io', 'particle_velocity_y')* *('io', 'particle_velocity_z')* *('ramses', 'Density')* *('ramses', 'Metallicity')* *('ramses', 'Pressure')* *('ramses', 'var6')* *('ramses', 'x-velocity')* *('ramses', 'y-velocity')* *('ramses', 'z-velocity') "*
So, I am thinking that the highlighted fields in the type 'all' could be used to compute circular velocity [sqrt(particle_velocity_x^2+particle_velocity_y^2)] and the radius [sqrt(particle_position_x^2+particle_position_y^2)] for particles. And for gas, 'ramses' fields could be used. However, I am not sure how to get the radius for the gas in this case. Would this be a right approach at all to begin with? _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org