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

Update sites.json #145

Merged
merged 2 commits into from
Oct 23, 2024
Merged

Update sites.json #145

merged 2 commits into from
Oct 23, 2024

Conversation

amillssma
Copy link
Contributor

Added Sub-millimeter Array (SMA) on Mauna Kea, Hawaii to sites

Description

This pull request is to address ...

Fixes #

Added Sub-millimeter Array (SMA) on Mauna Kea, Hawaii to sites
@hamogu
Copy link
Member

hamogu commented Oct 18, 2024

Hi @amillssma!
Thanks for contributing to the list and making it more complete for everyone. I'm not a radio astronomer and I don't actually know how the "location of an array" is defined for arrays that consist of several different dishes.
All I can do it to check on google and see if there is actually a telescope at the location given: https://www.google.com/maps/@19.8248372,-155.4724211,537m/data=!3m1!1e3

It's definitely the right mountain, but I don't see a dish at that location in the middle of the screen. Again, that's probably OK, I just want to ask you to double-check one more time before I merge this that there are no typos in the coordinates! Can you just comment and let me know? Then I'm ready to merge this!

Copy link
Contributor

@dhomeier dhomeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hamogu there seems to be a typo in your lat/lon, or an inconsistency with Google coordinates – OpenStreetmap actually displays this centred right on the control building, with (some configurations of) the array actually visible to the NW.

@amillssma
Copy link
Contributor Author

Hi, thanks for checking that! You're right, that GPS must be in the control building, I didn't bother to check. The reference antenna would be a better lat/long, and I've been informed the elevation of the control building should be close enough. I'll make those changes. Thanks again!

Changed the latitude and longitude from the control building of the sma to the antenna pad used for the reference antenna in observations.
@hamogu hamogu merged commit c54bed4 into astropy:gh-pages Oct 23, 2024
2 checks passed
@amillssma
Copy link
Contributor Author

amillssma commented Oct 23, 2024 via email

@amillssma
Copy link
Contributor Author

amillssma commented Oct 24, 2024 via email

@pllim
Copy link
Member

pllim commented Oct 24, 2024

Hello, @amillssma , what package is Observer.at_site from? Should bring this issue to that package maintainer.

@amillssma
Copy link
Contributor Author

amillssma commented Oct 24, 2024 via email

@amillssma
Copy link
Contributor Author

amillssma commented Oct 25, 2024 via email

@hamogu
Copy link
Member

hamogu commented Oct 25, 2024

It works for me:

Python 3.13.0 | packaged by conda-forge | (main, Oct 17 2024, 12:32:35) [Clang 17.0.6 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.29.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from astropy.coordinates import EarthLocation

In [2]: ErtchLocation.of_site("SMA")
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[2], line 1
----> 1 ErtchLocation.of_site("SMA")

NameError: name 'ErtchLocation' is not defined

In [3]: EarthLocation.of_site("SMA")
Downloading http://data.astropy.org/coordinates/sites.json
|===================================================================================================================================================|  47k/ 47k (100.00%)         0s
Out[3]: <EarthLocation (-5464564.46944247, -2492931.81645504, 2150799.71399166) m>

Are you behind some kind of firewall or so that does not allow you to update the sites.json file from Python?

@dhomeier
Copy link
Contributor

dhomeier commented Oct 25, 2024

There seems to be an issue at least with the documentation. Can you try

EarthLocation.get_site_names(refresh_cache='http://data.astropy.org/coordinates/sites.json')

which will point it directly to the repository URL?

This is an alternative setting for force_download in _get_site_registry
https://github.com/astropy/astropy/blob/d7a6b978d1323e8bda860e50159819165b582a10/astropy/coordinates/earth.py#L574-L579
unfortunately not documented in the calling functions, but actually appears to be the only form that works, since True will be simply discarded here – did someone maybe miss that get_downloaded_sites itself is also using caching?
[Why does it seem Github is always taking 12 hour or more to update comments these days?]

@dhomeier
Copy link
Contributor

It works for me:

Have you used EarthLocation before the update on that system (resp. after last clearing your cache)?
It looks like not, as it was downloading even without enforcing.
I could confirm that

>>> 'sma' in EarthLocation.get_site_names(refresh_cache=True)
False
>>> 'sma' in EarthLocation.get_site_names(refresh_cache='http://data.astropy.org/coordinates/sites.json')
Downloading http://data.astropy.org/coordinates/sites.json
|===========================================================================================================================|  47k/ 47k (100.00%)         0s
True
>>> EarthLocation.of_site('sma')
<EarthLocation (-5464564.46944247, -2492931.81645504, 2150799.71399166) m>
>>> 'sma' in EarthLocation.get_site_names(refresh_cache=True)
False
>>> EarthLocation.of_site('sma')
Traceback (most recent call last):
 <UnknownSiteException>

so passing the URL does enforce the download, but only for the present session without updating the (persistent) cache, and running with refresh_cache=True even wipes that copy.
I don't really know how the whole caching mechanisms (are supposed to) work, but also noted that directly calling
get_pkg_data_contents('coordinates/sites.json', cache=False) is triggering a download, but still not updating the cache – even afterwards, get_pkg_data_filename('coordinates/sites.json') on my system was pointing to a subdir in ~/astropy/cache with > 3 year old files!

So the only reliable way to get this to work seems to manually wipe the cache with

from astropy.utils.data import clear_download_cache
clear_download_cache(hashorurl='http://data.astropy.org/coordinates/sites.json')

but that can't really be the way this is supposed to work.

@amillssma
Copy link
Contributor Author

amillssma commented Oct 26, 2024 via email

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

Successfully merging this pull request may close these issues.

4 participants