UCBerkeleySETI / blimpy

Breakthrough Listen I/O Methods for Python
https://blimpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
46 stars 40 forks source link

Better handling of telescope_id and telescope locations #112

Closed telegraphic closed 4 years ago

telegraphic commented 4 years ago

At the moment we've hardcoded the mapping between the telescope_id in the sigproc header, and the telescope name / coords. Presto also does this.

I suggest we add a file ephemeris/observatories.py (or CSV) and add a dictionary of observatories, with the mapping coded in a saner way.

dan-rds commented 4 years ago

Sounds easy enough, where are the telescope locations recorded? I assume you mean lat/long coords and I can't find those in presto unless it's somewhere deep in the fortran

siemion commented 4 years ago

If you grep the sigproc and presto source for GB or AO you will find some of the entries. There are a few different ways these are used, including by tempo or pint for barycentering. For sigproc they are in src/aliases.c, in tempo they are found in the file obsys.dat and presto has them in src/sigproc_fb.c. Note you will also find the telescope ids and names used in various other places as well, sometimes using hardcoded definitions in some other source file. You also often find differences in these definitions depending on which lineage your particular version of sigproc/presto descends from.

One idea would be to have some kind of a database that could be centrally updated, and then have an update_defs script for each of the tools.

dan-rds commented 4 years ago

To be clear the Observatory class should have the following fields: telescope_id, short_id, telescope_name, dish_diam (if applicable), lat, lon. Anything else?

telegraphic commented 4 years ago

Those are probably Geocentric XYZ coordinates in metres (cartesian coordinates with from Earth's centre at the origin). There's a standard coordinate conversion to convert XYZ coordinates into (latitude, longitude, elevation).

It is probably better practice to store (X, Y, Z), because (lat, lon, elev) depends on the WGS84 'prolate spheroid' model of the Earth, which is updated every now and again.

So I would have columns and a header something like:

#### observatories.csv ### 
# Geodetic locations of Earth-based observatories 
# 
### Table fields ###
# TELESCOPE: Name of telescope
# SIGPROC_ID: Identifier as assigned by sigproc standard
# ...
# TELESCOPE SIGPROC_ID  SHORT_SIGPROC_ID   X    Y    Z   DISH_DIAMETER REFERENCE DATE_ADDED ADDED_BY
#                                         (m)  (m)  (m)      (m)

Where REFERENCE points to a url or a publication so we know where the hell the numbers come from. If we're doing it 'properly', I think a text header that is human readable that fully describes the data is important.

PS: Astropy class that might be useful

PPS: I suggest writing the data out to a human-readable standard that Python pandas can parse with a one-liner (e.g. read_csv).

dan-rds commented 4 years ago

I opened up a pr #114 with a class and csv file. The csv file is missing: In presto but not sigproc (missing x,y,z)

The following are telescopes from sigproc that aren't in presto so I don't know what to include.

siemion commented 4 years ago

Good sleuthing - I think we want to be able to include all of these facilities in a consistent way, and have a ready way to include others. As an aside, this is useful (read: critical) for multi-site SETI observations as well.

On Jan 1, 2020, at 2:10 PM, Daniel Richards notifications@github.com wrote:

I opened up a pr #114 https://github.com/UCBerkeleySETI/blimpy/pull/114 with a class and csv file. The csv file is missing: In presto but not sigproc (missing x,y,z)

21,"FAST",350.0 64,"MeerKAT",-1 65,"KAT-7",-1 2,"Ooty",-1 The following are telescopes from sigproc that aren't in presto so I don't know what to include.

QUABBIN Tasmania PRINCETON VLA2 GB-G1 GB-G3 GB-G8 NORTHERN MOST WSRT LWA1 — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/UCBerkeleySETI/blimpy/issues/112?email_source=notifications&email_token=AACHZEGLKBP2YITEHRCQTU3Q3UID7A5CNFSM4JBTXQD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH5NQ5I#issuecomment-570087541, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACHZEAREH4BTJ26K5SPSMDQ3UID7ANCNFSM4JBTXQDQ.