コード例 #1
0
    def _process_current_day(
            self, light_curve_data_day: LightCurve, queryable_criteria: int,
            days_since_last_observation: int, telescope_names: list,
            telescope_sizes: list, spectroscopic_snr: int,
            min_available_points: int = 4, **kwargs):
        """
        Processes data for current day

        Parameters
        ----------
        light_curve_data_day
            An instance of LightCurve class
        queryable_criteria
            Criteria to determine if an obj is queryable.
            1 -> r-band cut on last measured photometric point.
            2 -> last obs was further than a given limit,
                 use Bazin estimate of flux today. Otherwise, use
                 the last observed point.
        days_since_last_observation
            Day since last observation to consider for spectroscopic
            follow-up without the need to extrapolate light curve.
        telescope_names
            Names of the telescopes under consideration for spectroscopy.
            Only used if "get_cost == True".
        telescope_sizes
            Primary mirrors diameters of potential spectroscopic telescopes.
            Only used if "get_cost == True".
        spectroscopic_snr
            SNR required for spectroscopic follow-up.
        kwargs
            Any input required by ExpTimeCalc.findexptime function.
        min_available_points
            minimum number of survived points
        """
        photo_flag = (
                light_curve_data_day.photometry['mjd'].values <= self._today)

        if np.sum(photo_flag) > min_available_points:
            light_curve_data_day.photometry = light_curve_data_day.photometry[
                photo_flag]
            light_curve_data_day.fit_bazin_all()

            if (len(light_curve_data_day.bazin_features) > 0 and
                    'None' not in light_curve_data_day.bazin_features):

                light_curve_data_day.queryable = self._check_queryable(
                    light_curve_data_day, queryable_criteria,
                    days_since_last_observation)
                light_curve_data_day = self._update_queryable_if_get_cost(
                    light_curve_data_day, telescope_names, telescope_sizes,
                    spectroscopic_snr, **kwargs)
                light_curve_data_day.queryable = bool(sum(get_query_flags(
                    light_curve_data_day, telescope_names
                )))

                return light_curve_data_day

        return None
コード例 #2
0
    def _process_each_light_curve(
            self,
            light_curve_data: LightCurve,
            queryable_criteria: int,
            days_since_last_observation: int,
            telescope_names: list,
            telescope_sizes: list,
            spectroscopic_snr: int,
            kwargs: dict,
            min_available_points: int = 5) -> Union[LightCurve, None]:
        """
        Processes each light curve files.

        Parameters
        ----------
        light_curve_data: resspect.LightCurve
            An instance of LightCurve class
        queryable_criteria: int
            Criteria to determine if an obj is queryable.
            1 -> r-band cut on last measured photometric point.
            2 -> last obs was further than a given limit,
                 use Bazin estimate of flux today. Otherwise, use
                 the last observed point.
        days_since_last_observation: int
            Day since last observation to consider for spectroscopic
            follow-up without the need to extrapolate light curve.
        telescope_names: list
            Names of the telescopes under consideration for spectroscopy.
            Only used if "get_cost == True".
        telescope_sizes: list
            Primary mirrors diameters of potential spectroscopic telescopes.
            Only used if "get_cost == True".
        spectroscopic_snr: int
            SNR required for spectroscopic follow-up.
        kwargs: dict (optional)
            Any input required by ExpTimeCalc.findexptime function.
        min_available_points: int (optional)
            minimum number of survived points. Default is 5.
        """
        photo_flag = light_curve_data.photometry['mjd'].values <= self._today
        if sum(photo_flag) >= min_available_points:
            light_curve_data.photometry = light_curve_data.photometry[
                photo_flag]
            light_curve_data.fit_bazin_all()

            if (len(light_curve_data.bazin_features) > 0
                    and 'None' not in light_curve_data.bazin_features):
                light_curve_data.queryable = self._check_queryable(
                    light_curve_data, queryable_criteria,
                    days_since_last_observation)
                light_curve_data = self._update_queryable_if_get_cost(
                    light_curve_data, telescope_names, telescope_sizes,
                    spectroscopic_snr, kwargs)
                light_curve_data.queryable = bool(
                    sum(get_query_flags(light_curve_data, telescope_names)))
                return light_curve_data
        return None