utils.py - Mission auxiliary routines

K2-specific auxiliary routines. These are not generally called from the top level of the code.

everest.missions.k2.utils.Campaign(EPIC, **kwargs)

Returns the campaign number(s) for a given EPIC target. If target is not found, returns None.

Parameters:EPIC (int) – The EPIC number of the target.
everest.missions.k2.utils.GetK2Stars(clobber=False)

Download and return a dict of all K2 stars organized by campaign. Saves each campaign to a .stars file in the everest/missions/k2/tables directory.

Parameters:clobber (bool) – If True, download and overwrite existing files. Default False

Note

The keys of the dictionary returned by this function are the (integer) numbers of each campaign. Each item in the dict is a list of the targets in the corresponding campaign, and each item in that list is in turn a list of the following: EPIC number (int), Kp magnitude (float), CCD channel number (int), and short cadence available (bool).

everest.missions.k2.utils.GetK2Campaign(campaign, clobber=False, split=False, epics_only=False, cadence='lc')

Return all stars in a given K2 campaign.

Parameters:
  • campaign – The K2 campaign number. If this is an int, returns all targets in that campaign. If a float in the form X.Y, runs the Y^th decile of campaign X.
  • clobber (bool) – If True, download and overwrite existing files. Default False
  • split (bool) – If True and campaign is an int, returns each of the subcampaigns as a separate list. Default False
  • epics_only (bool) – If True, returns only the EPIC numbers. If False, returns metadata associated with each target. Default False
  • cadence (str) – Long (lc) or short (sc) cadence? Default lc.
everest.missions.k2.utils.Channel(EPIC, campaign=None)

Returns the channel number for a given EPIC target.

everest.missions.k2.utils.RemoveBackground(EPIC, campaign=None)

Returns True or False, indicating whether or not to remove the background flux for the target. If campaign < 3, returns True, otherwise returns False.

everest.missions.k2.utils.GetNeighboringChannels(channel)

Returns all channels on the same module as channel.

everest.missions.k2.utils.GetSources(ID, darcsec=None, stars_only=False)

Grabs the EPIC coordinates from the TPF and searches MAST for other EPIC targets within the same aperture.

Parameters:
  • ID (int) – The 9-digit EPIC number of the target
  • darcsec (float) – The search radius in arcseconds. Default is four times the largest dimension of the aperture.
  • stars_only (bool) – If True, only returns objects explicitly designated as “stars” in MAST. Default False
Returns:

A list of Source instances containing other EPIC targets within or close to this target’s aperture

everest.missions.k2.utils.GetHiResImage(ID)

Queries the Palomar Observatory Sky Survey II catalog to obtain a higher resolution optical image of the star with EPIC number ID.

everest.missions.k2.utils.GetCustomAperture(data)

Warning

Routine not yet implemented.

class everest.missions.k2.utils.StatsPicker(axes, x, y, epic, model='PLD', compare_to='k2sff', cadence='lc', campaign=None)

A class that enables clicking on the individual points on the k2.Statistics() scatter plots.

Parameters:
  • axes – A matplotlib.pyplot axis instance or a list of axis instances
  • x – An array or a list of arrays corresponding to the abscissa of axes
  • y – An array or a list of arrays corresponding to the ordinate of axes
  • epic (array_like) – A list of EPIC target numbers for each of the plotted points
  • model (str) – The name of the current everest model. Default “PLD”
  • compare_to (str) – The name of the model against which the data is being compared. Default “k2sff”
everest.missions.k2.utils.SaturationFlux(EPIC, campaign=None, **kwargs)

Returns the well depth for the target. If any of the target’s pixels have flux larger than this value, they are likely to be saturated and cause charge bleeding. The well depths were obtained from Table 13 of the Kepler instrument handbook. We assume an exposure time of 6.02s.

everest.missions.k2.utils.Module(EPIC, campaign=None)

Returns the module number for a given EPIC target.

everest.missions.k2.utils.Channels(module)

Returns the channels contained in the given K2 module.