AstroUtils API¶
-
class
utils.AstroUtils.AstroUtils[source]¶ -
static
distance(l1, b1, l2, b2)[source]¶ Computes the angular distance between two galatic coordinates.
- Parameters
l1 (float) – longitude of first coordinate
b1 (float) – latitude of first coordinate
l2 (float) – longitude of second coordinate
b2 (float) – latitude of second coordinate
- Returns
the angular distance between (l1, b1) and (l2, b2)
-
static
AP_filter(filename, threshold, tstart, tstop, outpath)[source]¶ This function filters an aperture photometry file using a threshold value for exposure, it discards the rows lower than threshold and returns a new file merging the continous rows.
- Parameters
filename (str) – path of the aperture photometry file
threshold (float) – exposure threshold
tstart (float) – time start in UTC
tstop (float) – time stop in UTC
- Returns
A filtered file result.txt
-
static
time_mjd_to_tt(timemjd)[source]¶ Convert mjd to tt. Tolerance = 0.001 s
- Parameters
timemjd (float) – time in mjd format
- Returns
the input converted in tt format.
-
static
time_tt_to_mjd(timett)[source]¶ Convert tt to mjd. Tolerance = 0.0000001 s
- Parameters
timett (float) – time in tt format
- Returns
the input converted in mjd format.
-
static
time_tt_to_utc(timett)[source]¶ Convert tt to utc. Tolerance = 1 s
- Parameters
timett (float) – time in tt format
- Returns
input converted in utc format (string).
-
static
to_jd(dt, fmt='jd')[source]¶ Converts a given datetime object to Julian date (jd o mjd). Tolerance = 0.00000001 days
- Parameters
dt (datetime) – time in datetime format
fmt (str) – jd or mjd
- Returns
input converted in jd format (jd o mjd).
-
static
time_utc_to_tt(timeutc)[source]¶ Convert utc to tt. Tolerance = 0.0001 s
- Parameters
timeutc (str) – time in utc format
- Returns
input converted in tt format.
-
static
day_fraction_to_time(fr)[source]¶ Convert a fractional day to [hours, minutes, seconds, fraction_of_a_second] :param fr: fractional day :type fr: float
- Returns
input converted to [hours, minutes, seconds, fraction_of_a_second] (List).
-
static
time_to_day_fraction(h, min, s)[source]¶ Convert hours,minutes and seconds to a fraction of day.
- Parameters
timeutc (float) – time in utc format
timeutc – time in utc format
timeutc – time in utc format
- Returns
input converted in a fraction of day.
-
static
jd_to_civil(jd)[source]¶ Convert a Julian Day Number to a Civil Date. Tolerance = 0.043 days
- Parameters
jd (float) – the Julian Day Number.
- Returns
Returns the corresponding [year, month, day_of_month] as a List.
-
static