3-D Mass power spectra
Dear yt Can current yt calculate 3-D Mass power spectra? I checked the website but I didn't find any information. I think calculating 3-D Mass power spectra is a very useful for cosmological simulations. So I guess maybe yt supports this function now....? Thanks in advance
We have an example in our docs that shows how to create a kinetic energy power spectrum with the numpy FFT: http://yt-project.org/doc/cookbook/calculating_information.html#making-a-tur... I think this could be adapted for your needs. Right now there isn't an analysis routine explicitly for computing power spectra in yt. If someone wanted to add it (or just wanted to add more examples to the docs of how to compute power spectra using e.g. pyfftw) I think that would be a very welcome contribution. -Nathan On Wed, Jul 12, 2017 at 11:10 AM, 梁家豪 <setsuna@phys.tw> wrote:
Dear yt
Can current yt calculate 3-D Mass power spectra? I checked the website but I didn't find any information. I think calculating 3-D Mass power spectra is a very useful for cosmological simulations. So I guess maybe yt supports this function now....?
Thanks in advance
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Nathan, I want to use this sample analyses (kinetic energy power spectrum, which you posted here) for plotting the magnetic energy power spectrum. I guess this is also possible to adapt the code for my case. First of all, I tried just to use this code and plot kinetic energy power spectrum. The code gave me the error: "EnzoDataset' object has no attribute 'ref_factors' ", Is this code still functional? Thanks, Salome
Hello again, Apologize, I have just been told that I just need to write instead of ref = int(np.product(ds.ref_factors[0:max_level])) , ref = 2**max_level since ENZO only refines with the factor of 2. Thanks, Salome
Yup, that's correct, I believe ref_factors is only defined for boxlib data like that example. If you'd like to make a pull request to improve that example I think it would be readily accepted. The source code for that example lives here: https://github.com/yt-project/yt/blob/master/doc/source/cookbook/power_spect... There are instructions for how to make a pull request in our contributor's guide: https://yt-project.org/doc/developing/developing.html#making-and-sharing-cha... On Mon, Jun 3, 2019 at 3:17 PM Salome Mtchedlidze <salomchedlidze@gmail.com> wrote:
Hello again,
Apologize, I have just been told that I just need to write instead of
ref = int(np.product(ds.ref_factors[0:max_level])) ,
ref = 2**max_level
since ENZO only refines with the factor of 2.
Thanks, Salome _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
I think I wrote that original example, and for our data sets, the refinement ratio is variable and can change between levels, hence the general approach there. Maybe there is a way to make it work for all frontends? because if you modify the example to take out the ref_factor, then it will break AMReX codes. On Mon, Jun 3, 2019 at 3:24 PM Nathan Goldbaum <nathan12343@gmail.com> wrote:
Yup, that's correct, I believe ref_factors is only defined for boxlib data like that example.
If you'd like to make a pull request to improve that example I think it would be readily accepted. The source code for that example lives here: https://github.com/yt-project/yt/blob/master/doc/source/cookbook/power_spect...
There are instructions for how to make a pull request in our contributor's guide:
https://yt-project.org/doc/developing/developing.html#making-and-sharing-cha...
On Mon, Jun 3, 2019 at 3:17 PM Salome Mtchedlidze < salomchedlidze@gmail.com> wrote:
Hello again,
Apologize, I have just been told that I just need to write instead of
ref = int(np.product(ds.ref_factors[0:max_level])) ,
ref = 2**max_level
since ENZO only refines with the factor of 2.
Thanks, Salome _______________________________________________ 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
-- Michael Zingale Associate Professor Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale github: http://github.com/zingale
Right, I was suggesting to add a comment explaining how to adapt it for non-AMReX codes. Another option would be to define a ref_factor property on the base dataset class that just returns an array filled with 2s and then AMReX could override that. That way ds.ref_factor would always be valid. On Mon, Jun 3, 2019 at 3:33 PM Michael Zingale < michael.zingale@stonybrook.edu> wrote:
I think I wrote that original example, and for our data sets, the refinement ratio is variable and can change between levels, hence the general approach there. Maybe there is a way to make it work for all frontends? because if you modify the example to take out the ref_factor, then it will break AMReX codes.
On Mon, Jun 3, 2019 at 3:24 PM Nathan Goldbaum <nathan12343@gmail.com> wrote:
Yup, that's correct, I believe ref_factors is only defined for boxlib data like that example.
If you'd like to make a pull request to improve that example I think it would be readily accepted. The source code for that example lives here: https://github.com/yt-project/yt/blob/master/doc/source/cookbook/power_spect...
There are instructions for how to make a pull request in our contributor's guide:
https://yt-project.org/doc/developing/developing.html#making-and-sharing-cha...
On Mon, Jun 3, 2019 at 3:17 PM Salome Mtchedlidze < salomchedlidze@gmail.com> wrote:
Hello again,
Apologize, I have just been told that I just need to write instead of
ref = int(np.product(ds.ref_factors[0:max_level])) ,
ref = 2**max_level
since ENZO only refines with the factor of 2.
Thanks, Salome _______________________________________________ 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale github: http://github.com/zingale
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
defining that in the base class might be the best approach, since it is more general (more general still would be to allow different ref ratios in different coordinate directions, but I am not aware of any codes that do that). On Mon, Jun 3, 2019 at 3:55 PM Nathan Goldbaum <nathan12343@gmail.com> wrote:
Right, I was suggesting to add a comment explaining how to adapt it for non-AMReX codes.
Another option would be to define a ref_factor property on the base dataset class that just returns an array filled with 2s and then AMReX could override that. That way ds.ref_factor would always be valid.
On Mon, Jun 3, 2019 at 3:33 PM Michael Zingale < michael.zingale@stonybrook.edu> wrote:
I think I wrote that original example, and for our data sets, the refinement ratio is variable and can change between levels, hence the general approach there. Maybe there is a way to make it work for all frontends? because if you modify the example to take out the ref_factor, then it will break AMReX codes.
On Mon, Jun 3, 2019 at 3:24 PM Nathan Goldbaum <nathan12343@gmail.com> wrote:
Yup, that's correct, I believe ref_factors is only defined for boxlib data like that example.
If you'd like to make a pull request to improve that example I think it would be readily accepted. The source code for that example lives here: https://github.com/yt-project/yt/blob/master/doc/source/cookbook/power_spect...
There are instructions for how to make a pull request in our contributor's guide:
https://yt-project.org/doc/developing/developing.html#making-and-sharing-cha...
On Mon, Jun 3, 2019 at 3:17 PM Salome Mtchedlidze < salomchedlidze@gmail.com> wrote:
Hello again,
Apologize, I have just been told that I just need to write instead of
ref = int(np.product(ds.ref_factors[0:max_level])) ,
ref = 2**max_level
since ENZO only refines with the factor of 2.
Thanks, Salome _______________________________________________ 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale github: http://github.com/zingale
_______________________________________________ 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
-- Michael Zingale Associate Professor Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale github: http://github.com/zingale
participants (4)
-
Michael Zingale
-
Nathan Goldbaum
-
Salome Mtchedlidze
-
梁家豪