Skip to content

Commit

Permalink
Moderize get_ifot a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
taldcroft committed Feb 14, 2024
1 parent 82a946f commit 8083445
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions kadi/occweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from pathlib import Path

import configobj
import numpy as np
import requests
from astropy.io import ascii
from astropy.table import Table
Expand Down Expand Up @@ -99,10 +98,47 @@ def get_url(page, timeout=TIMEOUT):


def get_ifot(
event_type, start=None, stop=None, props=[], columns=[], timeout=TIMEOUT, types={}
event_type,
start=None,
stop=None,
props=None,
columns=None,
timeout=TIMEOUT,
types=None,
):
"""Get the iFOT event table for a given event type.
Parameters
----------
event_type : str
Event type (e.g. "ECLIPSE", "LOADSEG", "CAP")
start : str, CxoTimeLike
Start time for query
stop : str, CxoTimeLike
Stop time for query
props : list of str
List of iFOT properties to return
columns : list of str
List of columns to return
timeout : float
Timeout for the request
types : dict
Dictionary of column types
Returns
-------
dat : astropy.table.Table
Table of iFOT events
"""
start = DateTime("1998:001:12:00:00" if start is None else start)
stop = DateTime(stop)
if props is None:
props = []
if columns is None:
columns = []
if types is None:
types = {}

event_props = ".".join([event_type] + props)

params = odict(
Expand Down

0 comments on commit 8083445

Please sign in to comment.