[yt-users] add particle information to ds

Nathan Goldbaum nathan12343 at gmail.com
Thu Aug 11 11:08:33 PDT 2016


On Thu, Aug 11, 2016 at 12:47 PM, Chang-Goo Kim <cgkim at astro.princeton.edu>
wrote:

> Thanks, there's no hurry for this specific case.
>
> I have another problem with magnetic field units. I set unit conversion
> factors with 'unit_override' keyword. These are the units I'm using
>
> >>> print ya.unit_base
>
> {'length_unit': (1.0, 'pc'),
>  'mass_unit': (2.38858753789e-24, 'g/cm**3*pc**3'),
>  'time_unit': (1.0, 's*pc/km')}
>
> This should set the magnetic field unit as follows:
>
> >>> mu=yt.YTQuantity(ya.unit_base['mass_unit'][0],ya.unit_base['
> mass_unit'][1])
> >>> lu=yt.YTQuantity(ya.unit_base['length_unit'][0],ya.unit_
> base['length_unit'][1])
> >>> tu=yt.YTQuantity(ya.unit_base['time_unit'][0],ya.unit_base['
> time_unit'][1])
> >>> mag_unit=(np.sqrt(4*np.pi*mu/lu)/tu)
> >>> print mag_unit.convert_to_units('gauss')
>
> 5.4786746797e-07 gauss
>
> But, what I found in the unit_registry is a bit strange number.
>
> >>> print ds.unit_registry['code_magnetic']
>
> (3.5449077018110318,
>  sqrt((mass))/(sqrt((length))*(time)),
>  0.0,
>  '\\rm{code\\ magnetic}')
>
> It seems that "magnetic_unit" was set correctly in
> yt/frontends/athena/data_structures.py:
>
>         self.magnetic_unit = np.sqrt(4*np.pi * self.mass_unit /
>                                      (self.time_unit**2 *
> self.length_unit))
>         self.magnetic_unit.convert_to_units("gauss")
>
> I don't know what's wrong here. Do you have any idea?
>

Sounds like a bug. It might be that the overriden units aren't applied
until after the magnetic_unit is calculated.

Would you mind opening an issue to track this?

https://bitbucket.org/yt_analysis/yt/issues/new


>
> Thanks,
> Chang-Goo
>
>
> On Thu, Aug 11, 2016 at 12:12 PM, John Zuhone <jzuhone at gmail.com> wrote:
>
>> We can add in a particle_file keyword argument like we do for FLASH
>> data.
>>
>> I can help out with this, but I might not be able to get to it until
>> early next week.
>>
>> On Aug 11, 2016, at 12:11 PM, Nathan Goldbaum <nathan12343 at gmail.com>
>> wrote:
>>
>>
>>
>> On Thu, Aug 11, 2016 at 11:03 AM, Chang-Goo Kim <
>> cgkim at astro.princeton.edu> wrote:
>>
>>> Hi Nathan,
>>>
>>> Thanks for the reply. Adding particles to the athena frontend will not
>>> be easy since there is no unified (and well settled) data dump for
>>> particles. Star particles are not in the public release. Let me find other
>>> ways at this point.
>>>
>>>
>> Ah, in that case we should probably add a way for you to supply your own
>> particle data. You won't get chunked particle IO but if that's sufficient
>> it should probably be straightforward to load the data in as a keyword
>> argument for the load() command.
>>
>> John might have some insight on what's best to do here, he's the
>> maintainer of the athena frontend.
>>
>> -Nathan
>>
>>
>>> Thanks,
>>> Chang-Goo
>>>
>>>
>>> On Thu, Aug 11, 2016 at 11:35 AM, Nathan Goldbaum <nathan12343 at gmail.com
>>> > wrote:
>>>
>>>> I think we'd need to add support for reading particle data to the
>>>> athena frontend. I think the main reason this hasn't been done yet is lack
>>>> of available test datasets. If you'd like to make one or more test datasets
>>>> available to us (they will live on yt-project.org/data so we can use
>>>> them for testing and debugging going forward), someone could try to add
>>>> support for reading particle data to the Athena frontend.
>>>>
>>>> To answer your question, no, there isn't a way to add particle fields
>>>> to an athena dataset without modifying the athena frontend.
>>>>
>>>> That said, you might be able to cheat and load in the particle fields
>>>> using the stream frontend to reload your data as an in-memory dataset - in
>>>> particular load_uniform_grid or load_amr_grids. Of course this is sort of a
>>>> hack, ideally we'd just add particle support to the athena frontend.
>>>>
>>>> -Nathan
>>>>
>>>> -Nathan
>>>>
>>>> On Thu, Aug 11, 2016 at 10:32 AM, Chang-Goo Kim <
>>>> cgkim at astro.princeton.edu> wrote:
>>>>
>>>>> Sorry for confusion.
>>>>>
>>>>> I have a separate vtk file for star particles. Just wonder whether I
>>>>> can add this to original dataset as fields to handle them together.
>>>>>
>>>>> Thanks,
>>>>> Chang-Goo
>>>>>
>>>>> On Wed, Aug 10, 2016 at 3:19 PM, John Zuhone <jzuhone at gmail.com> wro
>>>>> te:
>>>>>
>>>>>> Hi Chang-Goo,
>>>>>>
>>>>>> > When I load the dataset from Athena and I have star particle mass,
>>>>>> position, velocity, age information separately,
>>>>>>
>>>>>> Sorry, I’m a bit confused as to what you mean by this, because as far
>>>>>> as I know we don’t have particle support for Athena data yet. Do you
>>>>>> actually see the particle data when you load the dataset? Also, is this the
>>>>>> old Athena or Athena++?
>>>>>>
>>>>>> > how can I add particle information to yt dataset.
>>>>>>
>>>>>> I think by this you mean getting the particle fields into yt,
>>>>>> correct? Just making sure.
>>>>>>
>>>>>> Is the data part of the Athena file itself or is it in a separate
>>>>>> file?
>>>>>>
>>>>>> Best,
>>>>>>
>>>>>> John
>>>>>>
>>>>>> > On Aug 10, 2016, at 2:24 PM, Chang-Goo Kim <changgoo at princeton.edu>
>>>>>> wrote:
>>>>>> >
>>>>>> > Hi all,
>>>>>> >
>>>>>> > I'm analysing data from Athena simulations with star particles.
>>>>>> When I load the dataset from Athena and I have star particle mass,
>>>>>> position, velocity, age information separately, how can I add particle
>>>>>> information to yt dataset. I tried to look up the hep, but I cannot find
>>>>>> any good reference for this issue.
>>>>>> >
>>>>>> > Thanks,
>>>>>> > Chang-Goo
>>>>>> > _______________________________________________
>>>>>> > yt-users mailing list
>>>>>> > yt-users at lists.spacepope.org
>>>>>> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>>>
>>>>>> _______________________________________________
>>>>>> yt-users mailing list
>>>>>> yt-users at lists.spacepope.org
>>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> yt-users mailing list
>>>>> yt-users at lists.spacepope.org
>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> yt-users mailing list
>>>> yt-users at lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>
>>>>
>>>
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160811/0210ce25/attachment.htm>


More information about the yt-users mailing list