# pyresample.data_reduce module

Reduce data sets based on geographical information.

pyresample.data_reduce.get_valid_index_from_cartesian_grid(cart_grid, lons, lats, radius_of_influence)

  Calculate relevant data indices using coarse data reduction of swath data by comparison with cartesian grid.

  Parameters:

    - chart_grid (numpy array) – Grid of area cartesian coordinates

    - lons (numpy array) – Swath lons

    - lats (numpy array) – Swath lats

    - data (numpy array) – Swath data

    - radius_of_influence (float) – Cut off distance in meters

  Returns:

    valid_index – Boolean array of same size as lons and lats indicating relevant indices

  Return type:

    numpy array

pyresample.data_reduce.get_valid_index_from_lonlat_boundaries(boundary_lons, boundary_lats, lons, lats, radius_of_influence)

  Find relevant indices from grid boundaries using the winding number theorem.

pyresample.data_reduce.get_valid_index_from_lonlat_grid(grid_lons, grid_lats, lons, lats, radius_of_influence)

  Calculate relevant data indices using coarse data reduction of swath data by comparison with lon lat grid.

  Parameters:

    - chart_grid (numpy array) – Grid of area cartesian coordinates

    - lons (numpy array) – Swath lons

    - lats (numpy array) – Swath lats

    - data (numpy array) – Swath data

    - radius_of_influence (float) – Cut off distance in meters

  Returns:

    valid_index – Boolean array of same size as lon and lat indicating relevant indices

  Return type:

    numpy array

pyresample.data_reduce.swath_from_cartesian_grid(cart_grid, lons, lats, data, radius_of_influence)

  Make coarse data reduction of swath data by comparison with cartesian grid.

  Parameters:

    - chart_grid (numpy array) – Grid of area cartesian coordinates

    - lons (numpy array) – Swath lons

    - lats (numpy array) – Swath lats

    - data (numpy array) – Swath data

    - radius_of_influence (float) – Cut off distance in meters

  Returns:

    (lons, lats, data) – Reduced swath data and coordinate set

  Return type:

    list of numpy arrays

pyresample.data_reduce.swath_from_lonlat_boundaries(boundary_lons, boundary_lats, lons, lats, data, radius_of_influence)

  Make coarse data reduction of swath data by comparison with lon lat boundary.

  Parameters:

    - boundary_lons (numpy array) – Grid of area lons

    - boundary_lats (numpy array) – Grid of area lats

    - lons (numpy array) – Swath lons

    - lats (numpy array) – Swath lats

    - data (numpy array) – Swath data

    - radius_of_influence (float) – Cut off distance in meters

  Returns:

    (lons, lats, data) – Reduced swath data and coordinate set

  Return type:

    list of numpy arrays

pyresample.data_reduce.swath_from_lonlat_grid(grid_lons, grid_lats, lons, lats, data, radius_of_influence)

  Make coarse data reduction of swath data by comparison with lon lat grid.

  Parameters:

    - grid_lons (numpy array) – Grid of area lons

    - grid_lats (numpy array) – Grid of area lats

    - lons (numpy array) – Swath lons

    - lats (numpy array) – Swath lats

    - data (numpy array) – Swath data

    - radius_of_influence (float) – Cut off distance in meters

  Returns:

    (lons, lats, data) – Reduced swath data and coordinate set

  Return type:

    list of numpy arrays