Skip to content

IPAC table read error  #4684

Description

@astropatel

Hell everyone,

I'm having a problem with reading this IPAC table. It gives me the following error:

WARNING: OverflowError converting to IntType for column cntr, using string instead. [astropy.io.ascii.core]

When presenting these commands:

>> from astropy.io import ascii as ai

> > fl = 'IPAC_Example.dat'
> > ip = ascii.Ipac('right')
> > testdat = ip.read(fl)

I get this error no matter how I initiate "ip" -- whether leaving it default or otherwise. This isn't the only column to which this occurred and I deleted previous ones that created the problem in case that was the issue.

Any thoughts?

-Rahul Patel

Activity

  1. taldcroft commented on Mar 11, 2016

    @taldcroft
    Member

    Can you provide a minimal snippet of the file that fails so we can reproduce your problem?

  2. astropatel commented on Mar 11, 2016

    @astropatel
    Author

    My apologies. I thought I had. I have uploaded it now.

    IPAC_Example.tbl.zip

  3. taldcroft commented on Mar 11, 2016

    @taldcroft
    Member

    I'm guessing now that you are on Windows, where the default numpy int is 32-bits. We need to think about a good way of addressing this, but on windows by default when you read int data it will come out as 32 bits. In your case the values are larger than 32 bits can support so that's why you see the warning. Here is a workaround that you can try:

    In [24]: from astropy.io import ascii
    In [26]: ascii.core.TableOutputter.default_converters[0] = ascii.core.convert_numpy(np.int64)
    In [27]: t = Table.read('IPAC_Example.tbl', format='ascii.ipac')
    
    In [28]: t
    Out[28]: 
    <Table masked=True length=32>
        source_id_mf          ra        dec       nb    na  ...       z         spt_ind      htm20        dist     angle   
                             deg        deg                 ...                                          arcsec     deg    
           str20           float64    float64   int64 int64 ...    float64       int64       int64      float64   float64  
    -------------------- ----------- ---------- ----- ----- ... -------------- --------- -------------- -------- ----------
    3052p318_ac51-055314 305.7726835 32.4414689     1     0 ... 0.536437752827 203323010 14272479624209 1.067433 208.287782
    3052p318_ac51-055314 305.7726835 32.4414689     1     0 ... 0.536437752827 203323010 14272479624209 1.067433 208.287782
    
  4. astropatel commented on Mar 11, 2016

    @astropatel
    Author

    Indeed I am working on a windows. Thank you! That worked.

  5. taldcroft commented on Mar 12, 2016

    @taldcroft
    Member

    See #4686 for a potential fix.

  6. bsipocz commented on Jun 19, 2019

    @bsipocz
    Member

    Following the links through, I suppose that #5347 has addressed this issue.
    Please reopen if you find otherwise, I can't test it locally (as it works as expected on non-windows).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions