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

Telescope.from_known_telescopes breaks if the known telescope doesn't have enough info #1460

Open
steven-murray opened this issue Jul 9, 2024 · 4 comments

Comments

@steven-murray
Copy link
Contributor

Currently there's no nice way to supply extra info when calling Telescope.from_known_telescopes(). For example, if I do Telescope.from_known_telescopes('PAPER'), it errors, because PAPER doesn't have the antenna position info. The easiest way to solve this would be to allow a **kwargs that can set the extra attributes.

@bhazelton
Copy link
Member

I think you can prevent it from erroring if you set run_check=False.

I think you can pretty naturally achieve what you want using Telescope.new() (which accepts all the attributes you might want to pass in) and setting the location parameter of that method using the known_telescope_location function.

@steven-murray
Copy link
Contributor Author

@bhazelton are you suggesting doing something like:

tel = Telescope.from_known_telescopes("PAPER", run_check=False)
tel.antenna_positions = np.array([...])

and/or:

tel = Telescope.new(
    telescope_positions=np.array([..]),
    run_check=False,
    **other_params
)
tel.upddate_from_known_telescopes('PAPER')

?

If so, I guess that works, but it seems mightily clunky compared to

tel = Telescope.from_known_telescopes('PAPER', antenna_positions=np.array([...]))

@bhazelton
Copy link
Member

I was thinking something like:

tel = Telescope.new(
    location=telescope.known_telescope_location("PAPER"),
    run_check=False,
    **other_params
)

@steven-murray
Copy link
Contributor Author

Note that this doesn't work because it's not only the location that I need. I think just allowing **kwargs into .from_known_telescopes should be the preferred method.

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

No branches or pull requests

2 participants