question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Column' object has no 'mask' on transforming coordinates

See original GitHub issue

I can’t figure out why this code

from astropy.coordinates import EarthLocation
from astropy.time import Time
from astropy import units as u
from astropy.coordinates import SkyCoord, AltAz, ICRS
from astropy.table import Table

t0=Time('2019-06-9 1:00:00')
local= EarthLocation(lat='45d31m59.85s', lon='9d13m33.03s', height=144*u.m)
alt='66.2d'
azimuth='91.3d'
coord_aa=(SkyCoord(azimuth, alt, frame=AltAz(location=local,obstime=t0)))
coord_aa.transform_to('icrs')

is giving me this: AttributeError: 'Column' object has no attribute 'mask'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Jun 14, 2019

@pllim Solved it! It was just a download-related problem, thank you.

1reaction
ghostcommented, Jun 14, 2019

@pllim ok I removed the __pycache__ before. Now that I did

rm -r .astropy/cache

I downloaded again the 3.2M file (but with a moderate wifi connection, I’m not home rn), but still error occur! This time is a different one:

Traceback (most recent call last):
  File "/Users/nigresson/Documents/Test.py", line 12, in <module>
    coord_aa.transform_to('icrs')
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/astropy/coordinates/sky_coordinate.py", line 443, in transform_to
    new_coord = trans(self.frame, generic_frame)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/astropy/coordinates/transformations.py", line 1377, in __call__
    curr_coord = t(curr_coord, curr_toframe)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/astropy/coordinates/transformations.py", line 980, in __call__
    return supcall(fromcoord, toframe)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/astropy/coordinates/builtin_frames/cirs_observed_transforms.py", line 91, in altaz_to_cirs
    xp, yp = get_polar_motion(altaz_coo.obstime)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/astropy/coordinates/builtin_frames/utils.py", line 41, in get_polar_motion
    xp, yp, status = iers.IERS_Auto.open().pm_xy(time, return_status=True)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/astropy/utils/iers/iers.py", line 660, in open
    cls.iers_table = cls.read(file=filename)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/astropy/utils/iers/iers.py", line 507, in read
    table = cls._combine_a_b_columns(iers_a)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/astropy/utils/iers/iers.py", line 470, in _combine_a_b_columns
    table.meta['predictive_index'] = np.min(np.flatnonzero(is_predictive))
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 2618, in amin
    initial=initial)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation minimum which has no identity

I’m start thinking of a bad downloading of the file (?). I’ll try later tonight with ethernet cable at home

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - How to test if coordinates are inside a label or mask
You can use NumPy indexing of the mask with the coordinates after a bit of massaging. coords_int = np.round(coords).astype(int) # or ...
Read more >
Using the SkyCoord High-Level Class — Astropy v5.2
At present, SkyCoord objects can use only coordinate frames that have transformations defined in the astropy.coordinates.frame_transform_graph transform ...
Read more >
MATLAB poly2mask - MathWorks
This MATLAB function computes a binary region of interest (ROI) mask, BW, of size m-by-n, from an ROI polygon with vertices at coordinates...
Read more >
Aperture Photometry (photutils.aperture) — photutils 1.6.0
If the apertures were defined completely in sky coordinates, their shapes would not be preserved when converting to or from pixel coordinates.
Read more >
SDO_RELATE
Uses the spatial index to identify either the spatial objects that have a ... If the geometry2 column is not spatially indexed, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found