Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to calculate NenuFAR sensitivity #68

Open
ebonnassieux opened this issue Feb 5, 2024 · 5 comments
Open

Error trying to calculate NenuFAR sensitivity #68

ebonnassieux opened this issue Feb 5, 2024 · 5 comments

Comments

@ebonnassieux
Copy link

Hi,

I am trying to estimate the sensitivity of NenuFAR (independent of confusion noise) at a variety of frequencies. For this purpose, I am trying to follow the example provided here: https://nenupy.readthedocs.io/en/latest/instru/instrument_properties.html#Sensitivity

I pip upgraded by nenupy install, and ran this code:

from nenupy.instru.interferometer import ObservingMode
from nenupy.instru import MiniArray, NenuFAR, instrument_temperature
import astropy.units as u
import numpy as np
ma = MiniArray()
sens=ma.sensitivity(
frequency=50u.MHz,
mode=ObservingMode.BEAMFORMING,
dt=3600
u.s,
df=25u.MHz,
elevation=70
u.deg,
efficiency=1.,
decoherence=1.,
lna_filter=0
)
print(sens)

there seems to be a problem with arguments passed to the sefd function:

File "/home/ebonnassieux/.local/lib/python3.10/site-packages/nenupy/init.py", line 96, in wrapper
result = func(*args, **kwargs)
File "/home/ebonnassieux/.local/lib/python3.10/site-packages/nenupy/instru/interferometer.py", line 798, in system_temperature
t_inst = self.instrument_temperature(frequency, **kwargs)
File "/home/ebonnassieux/.local/lib/python3.10/site-packages/nenupy/init.py", line 90, in wrapper
funcArgs = inspect.signature(func).bind(*args, **kwargs).arguments
File "/usr/lib/python3.10/inspect.py", line 3186, in bind
return self._bind(args, kwargs)
File "/usr/lib/python3.10/inspect.py", line 3125, in _bind
raise TypeError(
TypeError: multiple values for argument 'lna_filter'

This is independent of using the IMAGING mode, NenuFAR or mini-arrays, etc. It also arises when I try to call the sefd independently, although I am able to get a set of temperatures. Am I doing something obviously wrong here?

@AlanLoh
Copy link
Owner

AlanLoh commented Feb 5, 2024

Hey Etienne, can you tell me which version of nenupy you are using? You are running the method on nancep?
I have just tried this piece of code (while adding * before the units - which renders as italic outside of code-mode here -) and it works without any issue. This method is also unit-tested (it's rare enough within nenupy to be noted ^^), although if I understand your issue, I may end up strengthening the tests as well.

@ebonnassieux
Copy link
Author

Hi Alan, I'm running this locally on my laptop - the version is 2.6.7. I am guessing I did not get the correct version? I am running it in Python 3.10.12. I tried with both of these installs methods with the same result:

pip3 install --user --upgrade https://github.com/AlanLoh/nenupy/tarball/master
pip install --upgrade nenupy

and my pip is

pip 24.0 from /home/ebonnassieux/.local/lib/python3.10/site-packages/pip (python 3.10)

Should I try a specific install method?

@AlanLoh
Copy link
Owner

AlanLoh commented Feb 5, 2024

Hi again,
Thanks for your help and pointing this out. It seems the error arises while using python 3.10. The automatic tests are made using python 3.9 and below, that's why it never appeared. I will try to correct that.

AlanLoh added a commit that referenced this issue Feb 6, 2024
@AlanLoh
Copy link
Owner

AlanLoh commented Feb 6, 2024

Hi Etienne, I removed some stuff that was capturing some class methods's arguments and keyword arguments. For some reason this was not pleasing python3.10. Rather than fixing it, since it was not super useful anyways, I just commented out the offending lines. You should be good to go with version nenupy 2.6.8, tell me if this solves your troubles.

@AlanLoh
Copy link
Owner

AlanLoh commented Feb 21, 2024

@ebonnassieux has it solved your problem, can I close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants