Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def lc(self, value):
# this enables `lc` to be either a string
# or an object from KeplerLightCurveFile
if isinstance(value, str):
self._lc = KeplerLightCurveFile(value).PDCSAP_FLUX
elif isinstance(value, KeplerLightCurveFile):
self._lc = value.SAP_FLUX
elif isinstance(value, KeplerLightCurve):
self._lc = value
else:
raise ValueError("lc must be either a string, a KeplerLightCurve or a"
" KeplerLightCurveFile instance, got {}.".format(value))
def lc(self, value):
# this enables `lc` to be either a string
# or an object from KeplerLightCurveFile
if isinstance(value, str):
self._lc = KeplerLightCurveFile(value).PDCSAP_FLUX
elif isinstance(value, KeplerLightCurveFile):
self._lc = value.SAP_FLUX
elif isinstance(value, KeplerLightCurve):
self._lc = value
else:
raise ValueError("lc must be either a string, a KeplerLightCurve or a"
" KeplerLightCurveFile instance, got {}.".format(value))
def __init__(self, path, quality_bitmask='default', **kwargs):
super(KeplerLightCurveFile, self).__init__(path, **kwargs)
# check to make sure the correct filetype has been provided
filetype = detect_filetype(self.header())
if filetype == 'TessLightCurveFile':
warnings.warn("A TESS data product is being opened using the "
"`KeplerLightCurveFile` class. "
"Please use `TessLightCurveFile` instead.",
LightkurveWarning)
elif filetype is None:
warnings.warn("Given fits file not recognized as Kepler or TESS "
"observation.", LightkurveWarning)
elif "TargetPixelFile" in filetype:
warnings.warn("A `TargetPixelFile` object is being opened as a "
"`KeplerLightCurveFile`. "
"Please use `KeplerTargetPixelFile` instead.",
LightkurveWarning)
def lc(self, value):
# this enables `lc` to be either a string
# or an object from KeplerLightCurveFile
if isinstance(value, str):
self._lc = KeplerLightCurveFile(value).PDCSAP_FLUX
elif isinstance(value, KeplerLightCurveFile):
self._lc = value.SAP_FLUX
elif isinstance(value, KeplerLightCurve):
self._lc = value
else:
raise ValueError("lc must be either a string, a KeplerLightCurve or a"
" KeplerLightCurveFile instance, got {}.".format(value))
def lc(self, value):
# this enables `lc` to be either a string
# or an object from KeplerLightCurveFile
if isinstance(value, str):
self._lc = KeplerLightCurveFile(value).PDCSAP_FLUX
elif isinstance(value, KeplerLightCurveFile):
self._lc = value.SAP_FLUX
elif isinstance(value, KeplerLightCurve):
self._lc = value
else:
raise ValueError("lc must be either a string, a KeplerLightCurve or a"
" KeplerLightCurveFile instance, got {}.".format(value))