AlanLoh / nenupy

NenuFAR python package
MIT License
10 stars 6 forks source link

instru.analog_pointing incompatible with astropy < 4 #51

Open flomertens opened 3 years ago

flomertens commented 3 years ago

When using astropy 3.2 I have the following issue when calling analog_pointing:

[...] File "/home/fmertens/nenucal-cd/lib/python3.6/site-packages/nenupy/beam/beam.py", line 376, in beam_values az, el = analog_pointing(self.azana, el) File "/home/fmertens/nenucal-cd/lib/python3.6/site-packages/nenupy/instru/instru.py", line 321, in analog_pointing phi_idx = (azimuth.value/0.05 - 0.5).astype(int) AttributeError: 'float' object has no attribute 'astype'

The same code works fine with astropy 4. The issue is that azimuth.value is a python native float object in astropy 3, which do not have a method astype, while in astropy 4 it is a numpy float object which then have a method astype.

One fix would be to change the code that check whatever azimuth/elevation is a scalar to check azimuth.value instead of azimuth.