desihub / specsim

Quick simulations of spectrograph response
2 stars 9 forks source link

Review observatory coordinates #27

Open dkirkby opened 8 years ago

dkirkby commented 8 years ago

The specsim.transform.observatories dictionary gives astropy coordinates of APO, KPNO, LSST by name, as a convenience. This issue is to verify that these are correct and investigate if there is an alternative source of this info that should be used instead. This was prompted by my recent discovery that astropy has an extensive database that is accessible via EarthLocation.of_site() and stored in a json file.

However, taking the case of APO, it is not clear what the right answer should be since there are two different telescopes (2.5m and 3.5m). Are the differences between their locations negligible for all applications? The APO home page quotes:

Latitude 32° 46' 49" N, Longitude 105° 49' 13" W
Elevation 2788 meters

while the astropy db uses (from the IRAF Observatory Database):

"elevation": 2798,
"latitude": 32.78,
"longitude": 254.17999999999998,

and Don's nightly science plans assume:

Longitude:  105.820 degrees       Altitude:  2819.000 meters
 Latitude:    32.780 degrees      UT-Civil:     7.000 hours

Finally, the (e)BOSS plate design code uses:

if n_elements(lat) EQ 0 then lat = 32.7797556D
if n_elements(height) EQ 0 then height = 2797.D
dmargala commented 8 years ago

Currently, EarthLocation.of_site() requires an active internet connection to look up APO.

dkirkby commented 8 years ago

It looks like the download only happens the first time and then is cached:

https://github.com/astropy/astropy/blob/v1.1.x/astropy/coordinates/earth.py#L258

dmargala commented 8 years ago

Hmm, I can't reproduce the error now but this was the error I encountered a few days ago:

WARNING: Could not access the online site list. Falling back on the built-in version, which is rather limited. If you want to retry the download, do EarthLocation._get_site_registry(force_download=True) [astropy.coordinates.earth]
Traceback (most recent call last):
...
    self.where = astropy.coordinates.EarthLocation.of_site('apo')
  File "/Users/Daniel/anaconda/lib/python2.7/site-packages/astropy/coordinates/earth.py", line 220, in of_site
    raise UnknownSiteException(e.site, 'EarthLocation.get_site_names', close_names=e.close_names)
astropy.coordinates.errors.UnknownSiteException: u"Site 'apo' not in database. Use EarthLocation.get_site_names to see available sites."