[yt-users] FRB extraction details

David Collins dcollins4096 at gmail.com
Mon Apr 20 10:57:45 PDT 2015


Hi, Nathan and Everybody--

I've tried several iterations of quantities with and without units and keep
getting errors.  Here are the things I've tried, perhaps there's something
dumb I'm doing.  I won't have any free space for deeper debugging for a few
weeks, but I can look for a fix then. Low priority, I can simply flag out
the zeros for now, but this is where I"m at right now:

Thanks a ton!

>>>  proj = ds.proj("density","z")
>>>  Delta = (0.1,'code_length')
>>>  dx = (1./512,'code_length')
>>> frb=proj.to_frb(Delta,dx)
works great!
>>> frb=proj.to_frb( [Delta, Delta],[dx,dx])
raceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tmp.py", line 22, in <module>
    frb=proj.to_frb( [Delta, Delta],[dx,dx])
  File
"/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/data_containers.py",
line 909, in to_frb
    width = self.ds.quan(w, input_units = u)
  File
"/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/yt_array.py",
line 1153, in __new__
    raise RuntimeError("YTQuantity values must be numeric")
RuntimeError: YTQuantity values must be numeric


Also I tried using a ds.arr:
>>> Delta = ds.arr([0.1,0.1],'code_length')
>>> dx = ds.arr([1./512, 1./512], 'code_length')
>>> frb=proj.to_frb( Delta, dx)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tmp.py", line 26, in <module>
    frb=proj.to_frb( Delta, dx)
  File
"/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/data_containers.py",
line 909, in to_frb
    width = self.ds.quan(w, input_units = u)
  File
"/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/yt_array.py",
line 1155, in __new__
    dtype=dtype)
  File
"/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/yt_array.py",
line 308, in __new__
    input_array.units = Unit(input_units, registry=registry)
  File
"/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/units/unit_object.py",
line 169, in __new__
    % (unit_expr, type(unit_expr)))
yt.units.unit_object.UnitParseError: Unit representation must be a string
or sympy Expr. 0.1 code_length has type <class
'yt.units.yt_array.YTQuantity'>.



On Mon, Apr 20, 2015 at 1:36 PM, Nathan Goldbaum <nathan12343 at gmail.com>
wrote:

>
>
> On Mon, Apr 20, 2015 at 10:32 AM, David Collins <dcollins4096 at gmail.com>
> wrote:
>
>> Sorry, I should clarify--
>>
>> I tried doing
>> >>> frb=proj( (W1,W2), (dx1, dx2))
>> and it complained that the second value wasn't a string.  Is there a way
>> to tell the frb that the tuple isn't a (value, unit) pair?
>>
>>
> This should be accounted for internally.  If it's not doing that right now
> it's should be a straightforward fix.  Can you create a short example
> that's not working for you and file an issue about it, or if you're feeling
> ambitious, submit a PR with a fix?
>
> That said, I think a tuple like `((3, 'pc'), (2, 'pc'))` will work.
>
>
>> Thanks!
>> d.
>>
>> On Mon, Apr 20, 2015 at 1:31 PM, David Collins <dcollins4096 at gmail.com>
>> wrote:
>>
>>> Hi, Matt and Everybody--
>>>
>>> I have another dumb question.  If I want a non-square FRB, is that
>>> possible?
>>>
>>> d.
>>>
>>> On Mon, Apr 20, 2015 at 12:38 PM, David Collins <dcollins4096 at gmail.com>
>>> wrote:
>>>
>>>> Great.  Thanks, Matt!
>>>>
>>>> d.
>>>>
>>>> On Mon, Apr 20, 2015 at 11:44 AM, Matthew Turk <matthewturk at gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Dave,
>>>>>
>>>>> That's how it works by default, except at the boundaries of pixels
>>>>> that don't line up with cell boundaries, where it computes partial
>>>>> contributions. That can be turned off by setting antialias to false.
>>>>>
>>>>> Matt
>>>>>
>>>>> On Mon, Apr 20, 2015, 10:42 AM David Collins <dcollins4096 at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi, Everybody!
>>>>>>
>>>>>> If I make an FRB and have the resolution that of the finest zones,
>>>>>> how doe the coarser zones get filled?  Is it possible for them to be forced
>>>>>> to be piecewise-constant sampling of the coarse data?
>>>>>>
>>>>>> d.
>>>>>>
>>>>>> --
>>>>>> -- Sent from a computer.
>>>>>>  _______________________________________________
>>>>>> 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
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> -- Sent from a computer.
>>>>
>>>
>>>
>>>
>>> --
>>> -- Sent from a computer.
>>>
>>
>>
>>
>> --
>> -- Sent from a computer.
>>
>> _______________________________________________
>> 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
>
>


-- 
-- Sent from a computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150420/d06642f0/attachment.htm>
-------------- next part --------------
_______________________________________________
yt-users mailing list
yt-users at lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org


More information about the yt-users mailing list