def set_jds(self, val1, val2):
        """

        Parse the time strings contained in val1 and set jd1, jd2

        :param val1: array of strings to parse into JD format
        :param val2: not used for string conversions but passed regardless
        """
        n_times = len(val1)  # val1,2 already checked to have same len
        iy = numpy.empty(n_times, dtype=numpy.intc)
        im = numpy.empty(n_times, dtype=numpy.intc)
        iday = numpy.empty(n_times, dtype=numpy.intc)
        ihr = numpy.empty(n_times, dtype=numpy.intc)
        imin = numpy.empty(n_times, dtype=numpy.intc)
        dsec = numpy.empty(n_times, dtype=numpy.double)

        # Select subformats based on current self.in_subfmt
        subfmts = self._select_subfmts(self.in_subfmt)

        for i, timestr in enumerate(val1):
            # Assume that anything following "." on the right side is a
            # floating fraction of a day.
            try:
                idot = timestr.rindex('.')
            except:
                fracday = 0.0
            else:
                timestr, fracday = timestr[:idot], timestr[idot:]
                fracday = float(fracday)

            for _, strptime_fmt, _ in subfmts:
                try:
                    tm = time.strptime(timestr, strptime_fmt)
                except ValueError:
                    pass
                else:
                    iy[i] = tm.tm_year
                    im[i] = tm.tm_mon
                    iday[i] = tm.tm_mday
                    ihr[i] = tm.tm_hour + int(24 * fracday)
                    imin[i] = tm.tm_min + int(60 * (24 * fracday - ihr[i]))
                    dsec[i] = tm.tm_sec + 60 * (60 * (24 * fracday - ihr[i]) - imin[i])
                    break
            else:
                raise ValueError('Time {0} does not match {1} format'
                .format(timestr, self.name))

        self.jd1, self.jd2 = sofa_time.dtf_jd(self.scale.upper().encode('utf8'),
                                              iy, im, iday, ihr, imin, dsec)
        return
def set_jds ( self , val1 , val2 ) : n_times = len ( val1 ) iy = numpy . empty ( n_times , dtype = numpy . intc ) im = numpy . empty ( n_times , dtype = numpy . intc ) iday = numpy . empty ( n_times , dtype = numpy . intc ) ihr = numpy . empty ( n_times , dtype = numpy . intc ) imin = numpy . empty ( n_times , dtype = numpy . intc ) dsec = numpy . empty ( n_times , dtype = numpy . double ) subfmts = self . _select_subfmts ( self . in_subfmt ) for i , timestr in enumerate ( val1 ) : try : idot = timestr . rindex ( '.' ) except : fracday = 0.0 else : timestr , fracday = timestr [ : idot ] , timestr [ idot : ] fracday = float ( fracday ) for _ , strptime_fmt , _ in subfmts : try : tm = time . strptime ( timestr , strptime_fmt ) except ValueError : pass else : iy [ i ] = tm . tm_year im [ i ] = tm . tm_mon iday [ i ] = tm . tm_mday ihr [ i ] = tm . tm_hour + int ( 24 * fracday ) imin [ i ] = tm . tm_min + int ( 60 * ( 24 * fracday - ihr [ i ] ) ) dsec [ i ] = tm . tm_sec + 60 * ( 60 * ( 24 * fracday - ihr [ i ] ) - imin [ i ] ) break else : raise ValueError ( 'Time {0} does not match {1} format' . format ( timestr , self . name ) ) self . jd1 , self . jd2 = sofa_time . dtf_jd ( self . scale . upper ( ) . encode ( 'utf8' ) , iy , im , iday , ihr , imin , dsec ) return
Parse the time strings contained in val1 and set jd1, jd2

        :param val1: array of strings to parse into JD format
        :param val2: not used for string conversions but passed regardless