[yt-users] Problem dealing with FITS data in yt

Nathan Goldbaum nathan12343 at gmail.com
Fri Sep 8 14:15:57 PDT 2017


You shouldn't be doing "sudo pip install", that means you're invoking the
pip associated with the root account, not the pip associated with your
anaconda installation. Try doing "conda update cython". Also make sure you
have pip installed in your conda environment, "conda install pip".

On Fri, Sep 8, 2017 at 4:10 PM, tazkera haque <h.tazkera at gmail.com> wrote:

> Hi Nathan ,
>
> I encountered an error after
>
> $pip install -e .
>
> RuntimeError: Building yt from source requires Cython 0.24 or newer but
>     Cython 0.23.4 is installed. Please update Cython using the appropriate
>
> so i did
> $ cdh
> $ sudo pip install --upgrade Cython
> $ Requirement already up-to-date: Cython in /usr/local/lib/python2.7/dist-
> packages
> Cleaning up...
> $ cython --version
> $ Cython version 0.23.4
>
> so how do I upgrade to cython 0.24? DO I need to do that inside the yt
> directory?
>
> On Fri, Sep 8, 2017 at 3:36 PM, Nathan Goldbaum <nathan12343 at gmail.com>
> wrote:
>
>> Then you already have a directory named "yt". Delete it and make the
>> clone, or clone to a new directory:
>>
>> $ git clone https://github.com/yt-project/yt ./yt-repo
>>
>> On Fri, Sep 8, 2017 at 2:35 PM, tazkera haque <h.tazkera at gmail.com>
>> wrote:
>>
>>> OK Thanks. I $conda uninstall yt and then
>>>
>>> $ git clone https://github.com/yt-project/yt
>>> fatal: destination path 'yt' already exists and is not an empty
>>> directory.
>>>
>>>
>>>
>>>
>>> On Fri, Sep 8, 2017 at 3:28 PM, Nathan Goldbaum <nathan12343 at gmail.com>
>>> wrote:
>>>
>>>> The fix is only available if you build yt from the git repository for
>>>> now. We will do a release sometime in the next few weeks to make the fix
>>>> generally available.
>>>>
>>>> For now, you can install yt from git following these steps:
>>>>
>>>> $ conda uninstall yt
>>>> $ git clone https://github.com/yt-project/yt
>>>> $ cd yt
>>>> $ pip install -e .
>>>>
>>>> -Nathan
>>>>
>>>> On Fri, Sep 8, 2017 at 2:21 PM, tazkera haque <h.tazkera at gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Nathan,
>>>>>
>>>>> Thanks. I see the bug has been fixed according to the post, but I am
>>>>> still getting the same error with that file. I updated yt to the latest
>>>>> version and rebooted my laptop. Do I need to do anything else to get it
>>>>> work out?
>>>>>
>>>>> Best
>>>>> Tazkera
>>>>>
>>>>> On Thu, Sep 7, 2017 at 3:37 PM, Nathan Goldbaum <nathan12343 at gmail.com
>>>>> > wrote:
>>>>>
>>>>>> I've opened an issue, let's move discussion over there:
>>>>>>
>>>>>> https://github.com/yt-project/yt/issues/1552
>>>>>>
>>>>>> Tazkera, you can subscribe to notifications on the issue by clicking
>>>>>> the subscribe button.
>>>>>>
>>>>>> On Thu, Sep 7, 2017 at 2:35 PM, John Zuhone <jzuhone at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Tazkera,
>>>>>>>
>>>>>>> Thanks for uploading your file—it will make it far simpler to debug.
>>>>>>> I’ll have a look at this and get back to you.
>>>>>>>
>>>>>>> Best,
>>>>>>>
>>>>>>> John
>>>>>>>
>>>>>>> On Sep 7, 2017, at 3:24 PM, tazkera haque <h.tazkera at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> HI People,
>>>>>>>
>>>>>>> I am sorry to ask you a very novice question, but I am new to deal
>>>>>>> with FITS data and I wanted to load it into yt to do some processing. I
>>>>>>> uploaded my file here.
>>>>>>>
>>>>>>> First of all, I am trying to load my first FITS data in yt and it
>>>>>>> returns me an error which I don't understand:
>>>>>>>
>>>>>>> *import yt*
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *ds = yt.load("signal_wfilt_sn.fits")ds.print_stats()*
>>>>>>>
>>>>>>>
>>>>>>> *the error:*
>>>>>>>
>>>>>>> yt : [WARNING  ] 2017-09-07 15:12:42,963 Cannot find time
>>>>>>> yt : [INFO     ] 2017-09-07 15:12:42,965 Detected these axes: RA---TAN DEC--TAN
>>>>>>> yt : [WARNING  ] 2017-09-07 15:12:42,979 No length conversion provided. Assuming 1 = 1 cm.
>>>>>>> yt : [INFO     ] 2017-09-07 15:12:42,996 Parameters: current_time              = 0.0
>>>>>>> yt : [INFO     ] 2017-09-07 15:12:42,997 Parameters: domain_dimensions         = [1629 1629    1]
>>>>>>> yt : [INFO     ] 2017-09-07 15:12:43,001 Parameters: domain_left_edge          = [ 0.5  0.5  0.5]
>>>>>>> yt : [INFO     ] 2017-09-07 15:12:43,004 Parameters: domain_right_edge         = [  1.62950000e+03   1.62950000e+03   1.50000000e+00]
>>>>>>> yt : [INFO     ] 2017-09-07 15:12:43,006 Parameters: cosmological_simulation   = 0.0
>>>>>>>
>>>>>>> ---------------------------------------------------------------------------IndexError                                Traceback (most recent call last)<ipython-input-38-71d5999c6b09> in <module>()      1 import yt      2 ds2 = yt.load("/home/trina/Documents/ASTRO_732/A-01/signal_wfilt_sn.fits")----> 3 ds2.print_stats()
>>>>>>> /home/trina/anaconda2/lib/python2.7/site-packages/yt/utilities/parallel_tools/parallel_analysis_interface.pyc in root_only(*args, **kwargs)    318     def root_only(*args, **kwargs):    319         if not parallel_capable:--> 320             return func(*args, **kwargs)    321         comm = _get_comm(args)    322         rv = None
>>>>>>> /home/trina/anaconda2/lib/python2.7/site-packages/yt/data_objects/static_output.pyc in print_stats(self)    455     @parallel_root_only    456     def print_stats(self):--> 457         self.index.print_stats()    458     459     @property
>>>>>>> /home/trina/anaconda2/lib/python2.7/site-packages/yt/data_objects/static_output.pyc in index(self)    417                 raise RuntimeError("You should not instantiate Dataset.")    418             self._instantiated_index = self._index_class(--> 419                 self, dataset_type=self.dataset_type)    420             # Now we do things that we need an instantiated index for    421             # ...first off, we create our field_info now.
>>>>>>> /home/trina/anaconda2/lib/python2.7/site-packages/yt/frontends/fits/data_structures.pyc in __init__(self, ds, dataset_type)     90         self._handle = ds._handle     91         self.float_type = np.float64---> 92         GridIndex.__init__(self,ds,dataset_type)     93      94     def _initialize_data_storage(self):
>>>>>>> /home/trina/anaconda2/lib/python2.7/site-packages/yt/geometry/geometry_handler.pyc in __init__(self, ds, dataset_type)     56         # potentially quite expensive, and should be done with the indexing.     57         mylog.debug("Detecting fields.")---> 58         self._detect_output_fields()     59      60     def _initialize_state_variables(self):
>>>>>>> /home/trina/anaconda2/lib/python2.7/site-packages/yt/frontends/fits/data_structures.pyc in _detect_output_fields(self)    171                     continue    172                 if self._ensure_same_dims(hdu):--> 173                     units = self._determine_image_units(hdu.header, known_units)    174                     try:    175                         # Grab field name from btype
>>>>>>> /home/trina/anaconda2/lib/python2.7/site-packages/yt/frontends/fits/data_structures.pyc in _determine_image_units(self, header, known_units)    116                     n += 1    117             if n != len(units): field_units = "dimensionless"--> 118             if field_units[0] == "/":    119                 field_units = "1%s" % field_units    120             return field_units
>>>>>>> IndexError: string index out of range
>>>>>>>
>>>>>>> Can you Please suggest me how to load and work on this data?
>>>>>>>
>>>>>>> My goal is to create an image from the signal to noise data in the data file 'signal_wfilt_sn.fits' using only data
>>>>>>> within 20 arcminutes of the center of the image. the pixel size is 3x3 arc second
>>>>>>>
>>>>>>> I had an initial code in mind which will create a sphere with a radius of 20 arcminute:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> *import ytds = yt.load("signal_wfilt_sn.fits")ds.print_stats()sp = ds.sphere(ds.domain_center, (400, 'code_length'))*
>>>>>>>
>>>>>>> However, I first need to be able to load and explore the data. Your help and suggestion is greatly appreciated.
>>>>>>>
>>>>>>> Thanks a lot
>>>>>>>
>>>>>>>
>>>>>>> Tazkera
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ​​
>>>>>>> <signal_wfilt_sn.fits>______________________________________
>>>>>>> _________
>>>>>>> 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
>>
>>
>
> _______________________________________________
> 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/20170908/80601939/attachment.html>


More information about the yt-users mailing list