How to use the pyorbital.geoloc.compute_pixels function in pyorbital

To help you get started, we’ve selected a few pyorbital examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pytroll / satpy / satpy / satin / hrpt_hmf.py View on Github external
avhrr_inst = np.vstack(((scan_points / 1023.5 - 1)
                            * np.deg2rad(-scan_angle),
                            np.zeros((len(scan_points),)))).T
    avhrr_inst = np.tile(avhrr_inst, [scans_nb, 1])

    offset = hrpttimes

    times = (np.tile(scan_points * 0.000025, [scans_nb, 1])
             + np.expand_dims(offset, 1))

    sgeom = ScanGeometry(avhrr_inst, times.ravel())

    s_times = sgeom.times(first_time)

    rpy = (0, 0, 0)
    pixels_pos = compute_pixels((orb.tle._line1, orb.tle._line2), sgeom, s_times, rpy)
    pos_time = get_lonlatalt(pixels_pos, s_times)
    return pos_time
github pytroll / satpy / satpy / readers / hrpt.py View on Github external
self.times = time_seconds(self._data["timecode"], self.year)
        scanline_nb = len(self.times)
        scan_points = np.arange(0, 2048, 32)
        # scan_points = np.arange(2048)

        sgeom = avhrr(scanline_nb, scan_points, apply_offset=False)
        # no attitude error
        rpy = [0, 0, 0]
        s_times = sgeom.times(
            self.times[:, np.newaxis]).ravel()
        # s_times = (np.tile(sgeom._times[0, :], (scanline_nb, 1)).astype(
        #    'timedelta64[s]') + self.times[:, np.newaxis]).ravel()

        orb = Orbital(self.platform_name)

        pixels_pos = compute_pixels(orb, sgeom, s_times, rpy)
        lons, lats, alts = get_lonlatalt(pixels_pos, s_times)
        self.lons, self.lats = geo_interpolate(
            lons.reshape((scanline_nb, -1)), lats.reshape((scanline_nb, -1)))

        return self.lons, self.lats