Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Add support for Barycentric Julian Dates #109

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open

Add support for Barycentric Julian Dates #109

wants to merge 31 commits into from

Conversation

vterron
Copy link
Owner

@vterron vterron commented Apr 11, 2020

Add support for Barycentric Julian Dates in Barycentric Dynamical Time (BJD_TDB). Since internally LEMON uses Unix timestamps in UTC, the values read from the FITS keyword must be first converted to JD in UTC (via Jason Eastman's server at the Ohio State University), and from there to Unix timestamps. This approach is admittedly not optimal, as we rely on the availability of the remote server for the pipeline to be able to reduce data, but it is enough for the initial prototype. Longer term we may switch to installing and using bjd2utc.pro locally.

This feature is gated via the two new flags of the photometry command: --use_barycentric (to enable Barycentric Julian Dates) and --bjdk (the FITS keyword from which the BJD value is read, by default, BJD_TDB). The remaining steps of the data reduction process don't need these flags as the input of the commands (e.g. diffphot) is the output .LEMONdB from the previous step.

Fixes #108

Víctor Terrón added 24 commits March 7, 2020 22:05
Also, hardcode expected values instead of using helper functions strptime_utc() and unstrip(), per https://testing.googleblog.com/2014/07/testing-on-toilet-dont-put-logic-in.html (Don't Put Logic in Tests).
This is an example of a FITS image with BJD_TDB in the header.

Contributed by David Valls-Gabaud.
At the same time, read_barycentric_date() becomes private. In this manner, FITSImage.date() is the single entry point, branching to either _read_uncorrected_date() (for the regular code path) or _read_barycentric_date() to read Baycentric Julian Dates. This allows us to extend the existing interface to add support for the BJD_TDB FITS keyword without having to update the rest of the pipeline.
HH MM SS.ss and DD MM SS.ss are not standard, but common enough to merit support.
Don't talk to production in tests.
@vterron vterron marked this pull request as ready for review April 11, 2020 12:09
@vterron vterron assigned javierblasco and unassigned javierblasco Apr 11, 2020
Víctor Terrón added 2 commits April 13, 2020 09:43
This fixes the "Permission denied (publickey)" error:

```
Cloning into '/home/travis/build/vterron/lemon/barycorr'...
Warning: Permanently added the RSA host key for IP address '140.82.112.3' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
```

https://stackoverflow.com/q/15674064/184363
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Barycentric Julian Date
2 participants