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

More efficient memory consumption in telescope_functions.py? #58

Closed
FurenDeng opened this issue Dec 28, 2024 · 1 comment
Closed

More efficient memory consumption in telescope_functions.py? #58

FurenDeng opened this issue Dec 28, 2024 · 1 comment

Comments

@FurenDeng
Copy link

I notice that in line 148 of telescope_functions.py

    all_rotated_Nbase = np.array([earth_rotation_effect(Nbase, i, int_time, declination) for i in time_indices])

you create an array which contain all baselines for all time points which could be rather large. It seems like that making it a generator, i.e.

    all_rotated_Nbase =(earth_rotation_effect(Nbase, i, int_time, declination) for i in time_indices)

would be more efficient for memory usage because the baseline vectors would only be created when they are going to be used.
In following calculation you just loop over time indices and do not use the time dimension in a vectorized way. I cannot see the improvement on speed by making it an array.

@sambit-giri
Copy link
Owner

Thank you for this useful suggestion. I will update the script.

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