Does anyone out there have a technique for getting the variance out of
a profile object? A profile object is good at getting <X> vs. B, I'd
then like to get < (X - <X>)^2 > vs B. Matt and I had spittballed the
possibility some time ago, but I was wondering if anyone out there had
successfully done it.
Sent from my computer.
I am trying to create radial profile of a halo. I can create e.g. temperature, density, B profile but if I add a new field then it does not give me the profile; The code is here:
ds = yt.load('Dataset')
dd = ds.all_data()
Halo_ds = "catalog.h5"
File = h5py.File(Halo_ds, 'r')
n = 0
radius = File["virial_radius"][n]/float(ds.domain_width.in_units("cm")) #code units
x = File["particle_position_x"][n]/float(ds.domain_width.in_units("cm")) #Code units
y = File["particle_position_y"][n]/float(ds.domain_width.in_units("cm"))
z = File["particle_position_z"][n]/float(ds.domain_width.in_units("cm"))
center = ds.arr([x, y, z], 'code_length')
rvir = radius
sph = ds.sphere(center, rvir)
#Define new field
B = dd['gas','magnetic_field_magnitude']
B_f = B - B.mean()
def _B_fluc(field, dd):
ds.add_field(("gas", "B_fluc"), function=_B_fluc, units="gauss")
prof = yt.create_profile(sph, ["radius"], fields=["B_fluc"], n_bins=64)
The error is:
"Profile fields must have same shape: ('index', 'radius') has shape (6530,) and ('gas', 'B_flucc') has shape (9533574,)."
So, I am wondering, is there a way to define this added field only inside the sphere?
I think this message will not come as a surprise to anyone. In light of the
COVID-19 pandemic, we have decided to cancel the yt user/developer workshop
at the University of Edinburgh this summer. There is not yet a specific
plan for a workshop at a later date, but we will make a go at having one in
summer 2021. In the meantime, we will also look into the possibility of
hosting an online yt workshop sometime this summer.
Stay safe and stay connected.
In memory of John Hunter, we are pleased to announce the John Hunter
Excellence in Plotting Contest for 2020. This open competition aims to
highlight the importance of data visualization to scientific progress and
showcase the capabilities of open source software.
Participants are invited to submit scientific plots to be judged by a
panel. The winning entries will be announced and displayed at SciPy 2020 or
announced in the John Hunter Excellence in Plotting Contest website and
John Hunter’s family are graciously sponsoring cash prizes for the winners
in the following amounts:
1st prize: $1000
2nd prize: $750
3rd prize: $500
Entries must be submitted by June 1st to the form at
Winners will be announced at Scipy 2020 in Austin, TX or publicly on the
John Hunter Excellence in Plotting Contest website and youtube channel
Participants do not need to attend the Scipy conference.
Entries may take the definition of “visualization” rather broadly.
Entries may be, for example, a traditional printed plot, an interactive
visualization for the web, a dashboard, or an animation.
Source code for the plot must be provided, in the form of Python code
and/or a Jupyter notebook, along with a rendering of the plot in a widely
used format. The rendering may be, for example, PDF for print, standalone
original data can not be shared for reasons of size or licensing, "fake"
data may be substituted, along with an image of the plot using real data.
Each entry must include a 300-500 word abstract describing the plot and
its importance for a general scientific audience.
Entries will be judged on their clarity, innovation and aesthetics, but
most importantly for their effectiveness in communicating a real-world
problem. Entrants are encouraged to submit plots that were used during the
course of research or work, rather than merely being hypothetical.
SciPy and the John Hunter Excellence in Plotting Contest organizers
reserves the right to display any and all entries, whether prize-winning or
not, at the conference, use in any materials or on its website, with
attribution to the original author(s).
Past entries can be found at https://jhepc.github.io/
Questions regarding the contest can be sent to jhepc.organizers(a)gmail.com
John Hunter Excellence in Plotting Contest Co-Chairs
Just a quick question on how to read out/plot star formation rate/histories from ramses outputs using yt. I assume the file to be read is the infoxxxx.txt but not sure which module is used to get the SFR/SFH.
I am trying to place the Colorbar of a yt.Sliceplot on the top of the image. I was looking at yt examples (under "a few complex plots") and the use of AxesGrid objects. Below is what I used,
fig = plt.figure()
grid = AxesGrid(fig, 111,
nrows_ncols = (1, 1),
axes_pad = 1.0,
label_mode = "L",
share_all = True,
slc = yt.SlicePlot(ds,'z','density')
plot = slc.plots['density']
plot.figure = fig
plot.axes = grid.axes
plot.cax = grid.cbar_axes
The Colorbar is placed at the top but the labeling and ticks (of the Colorbar) are still aligned to the right of the Colorbar (as apposed to below the Colorbar). Is there something I'm missing or is there a simpler way to do this?
Thank you in advance,
Hi yt community,
I'd like to start scheduling yt triage meetings for the next few months. If
you're interested in yt development, in discussing your recently submitted
PR, or you've encountered a bug but you're not sure quite how to start
fixing it, then we'd love for you to attend the triage meetings!
To be more inclusive to developers a breadth of timezones, we'll alternate
triage meeting times every other week. I'll choose one early morning time
and afternoon time (based on US central time), which together should cover
more developers' availability. If you're interested in attending at all,
please respond to the polls I'm sending out!
Meetings will be on Fridays. Report your general Friday availability, not
just the availability for March 06.
Morning meeting poll: http://whenisgood.net/7cbrt49
Afternoon meeting poll: http://whenisgood.net/t3hci7j
There are two different polls -- if you know for sure you won't be
attending one of the meetings (if you're in Europe and don't like or plan
on attending a meeting in the evening, for example), please do not respond
to the poll for that time at all and only respond to the one where you plan
to attend. Make sure to update the time zone of the poll to be where you're
These triage meetings will build off of the ones we had in the fall, but
I'd like to expand their scope a bit. The first purpose of the meetings
will be to do day-to-day yt maintenance work (triage issues, review PRs,
respond to issues, etc.), then if we have time the rest of the time can be
spent either coworking or talking about where to direct our developer
resources over the coming week (which bugs we should focus on fixing, what
features need improvement, etc.). We have the yt-4.0 release and yt 3.6
releases on the horizon, so supporting the project moving towards these
releases will keep things going!
I will pick times for yt triage meetings based on whoever has filled out
the poll by Wednesday, March 11th. Our first triage meeting will be on
Friday, March 13th (👻)! I'm looking forward to triaging, PRing, and
community-ing with you all!
The yt User/Developer Workshop to be held at the University of
Edinburgh (June 29-July 3) is now accepting applications for financial
support. If you would like to request support, please visit the
follow the instructions under "Requesting
Financial Support." The deadline to request support is Friday March
27, 2020. After that time, the workshop will be open for
As the situation with the COVID-19 virus continues to evolve, it's
difficult to say for certain what will happen between now and the
workshop. For the moment, we will continue under the assumption that
the workshop will happen as scheduled. If needs be, we will extend
deadlines to allow for as much flexibility as possible.
I look forward to seeing you in Edinburgh this summer!
I'm trying to change the axis of a Phaseplot from log to linear scale. I looked at the documentation and didn't find an option to do so (like the x_log function argument in ProfilePlot).
I tried using the set_log option in yt.visualization.plot_container.ImagePlotContainer to False but it always returned log scale axis.
Is there a way to change the scale?