示例#1
0
    def _getCoeffsOther(self, ephs):
        """Calculate coefficients for the ra/dec values of a single objects ephemerides.

        Parameters
        ----------
        ephs : numpy.ndarray
            The structured array returned by PyOrbEphemerides holding ephemeris values, for one object.

        Returns
        -------
        dict
            Dictionary containing the coefficients for each of 'delta', 'vmag', 'elongation'
        dict
            Dictionary containing the max residual values for each of 'delta', 'vmag', 'elongation'.
        """
        coeffs = {}
        max_resids = {}
        for key, ephValue in zip(('delta', 'vmag', 'elongation'),
                                 ('delta', 'magV', 'solarelon')):
            coeffs[key], resid, rms, max_resids[key] = cheb.chebfit(
                ephs['time'],
                ephs[ephValue],
                dxdt=None,
                xMultiplier=self.multipliers[key][0],
                dxMultiplier=self.multipliers[key][1],
                nPoly=self.nCoeff[key])
        return coeffs, max_resids
示例#2
0
    def _getCoeffsPosition(self, ephs):
        """Calculate coefficients for the ra/dec values of a single objects ephemerides.

        Parameters
        ----------
        times : numpy.ndarray
            The times of the ephemerides.
        ephs : numpy.ndarray
            The structured array returned by PyOrbEphemerides holding ephemeris values, for one object.

        Returns
        -------
        numpy.ndarray
            The ra coefficients
        numpy.ndarray
            The dec coefficients
        float
            The positional error residuals between fit and ephemeris values, in mas.
        """
        dradt_coord = ephs['dradt'] / np.cos(np.radians(ephs['dec']))
        coeff_ra, resid_ra, rms_ra_resid, max_ra_resid = cheb.chebfit(
            ephs['time'],
            three_sixty_to_neg(ephs['ra']),
            dxdt=dradt_coord,
            xMultiplier=self.multipliers['position'][0],
            dxMultiplier=self.multipliers['position'][1],
            nPoly=self.nCoeff['position'])
        coeff_dec, resid_dec, rms_dec_resid, max_dec_resid = cheb.chebfit(
            ephs['time'],
            ephs['dec'],
            dxdt=ephs['ddecdt'],
            xMultiplier=self.multipliers['position'][0],
            dxMultiplier=self.multipliers['position'][1],
            nPoly=self.nCoeff['position'])
        max_pos_resid = np.max(
            np.sqrt(resid_dec**2 +
                    (resid_ra * np.cos(np.radians(ephs['dec'])))**2))
        # Convert position residuals to mas.
        max_pos_resid *= 3600.0 * 1000.0
        return coeff_ra, coeff_dec, max_pos_resid
    def _getCoeffsPosition(self, ephs):
        """Calculate coefficients for the ra/dec values of a single objects ephemerides.

        Parameters
        ----------
        times : numpy.ndarray
            The times of the ephemerides.
        ephs : numpy.ndarray
            The structured array returned by PyOrbEphemerides holding ephemeris values, for one object.

        Returns
        -------
        numpy.ndarray
            The ra coefficients
        numpy.ndarray
            The dec coefficients
        float
            The positional error residuals between fit and ephemeris values, in mas.
        """
        dradt_coord = ephs['dradt'] / np.cos(np.radians(ephs['dec']))
        coeff_ra, resid_ra, rms_ra_resid, max_ra_resid = cheb.chebfit(ephs['time'],
                                                                      three_sixty_to_neg(ephs['ra']),
                                                                      dxdt=dradt_coord,
                                                                      xMultiplier=self.multipliers['position'][0],
                                                                      dxMultiplier=self.multipliers['position'][1],
                                                                      nPoly=self.nCoeff['position'])
        coeff_dec, resid_dec, rms_dec_resid, max_dec_resid = cheb.chebfit(ephs['time'], ephs['dec'],
                                                                          dxdt=ephs['ddecdt'],
                                                                          xMultiplier=self.multipliers['position'][0],
                                                                          dxMultiplier=self.multipliers['position'][1],
                                                                          nPoly=self.nCoeff['position'])
        max_pos_resid = np.max(np.sqrt(resid_dec**2 +
                                       (resid_ra * np.cos(np.radians(ephs['dec'])))**2))
        # Convert position residuals to mas.
        max_pos_resid *= 3600.0 * 1000.0
        return coeff_ra, coeff_dec, max_pos_resid
    def _getCoeffsOther(self, ephs):
        """Calculate coefficients for the ra/dec values of a single objects ephemerides.

        Parameters
        ----------
        ephs : numpy.ndarray
            The structured array returned by PyOrbEphemerides holding ephemeris values, for one object.

        Returns
        -------
        dict
            Dictionary containing the coefficients for each of 'delta', 'vmag', 'elongation'
        dict
            Dictionary containing the max residual values for each of 'delta', 'vmag', 'elongation'.
        """
        coeffs = {}
        max_resids = {}
        for key, ephValue in zip(('delta', 'vmag', 'elongation'), ('delta', 'magV', 'solarelon')):
            coeffs[key], resid, rms, max_resids[key] = cheb.chebfit(ephs['time'], ephs[ephValue],
                                                                    dxdt=None,
                                                                    xMultiplier=self.multipliers[key][0],
                                                                    dxMultiplier=self.multipliers[key][1],
                                                                    nPoly=self.nCoeff[key])
        return coeffs, max_resids