# pyresample.utils package

## Submodules

- pyresample.utils.cartopy module
  - `Projection`
    - `Projection.__init__()`
    - `Projection.boundary`
- pyresample.utils.cf module
  - `load_cf_area()`
- pyresample.utils.errors module
  - `PerformanceWarning`
- pyresample.utils.proj4 module
  - `DaskFriendlyTransformer`
    - `DaskFriendlyTransformer.__init__()`
    - `DaskFriendlyTransformer.from_crs()`
    - `DaskFriendlyTransformer.transform()`
  - `convert_proj_floats()`
  - `get_geodetic_crs_with_no_datum_shift()`
  - `get_geostationary_height()`
  - `ignore_pyproj_proj_warnings()`
  - `proj4_dict_to_str()`
  - `proj4_radius_parameters()`
  - `proj4_str_to_dict()`
- pyresample.utils.rasterio module
  - `get_area_def_from_raster()`
- pyresample.utils.row_appendable_array module
  - `RowAppendableArray`
    - `RowAppendableArray.__init__()`
    - `RowAppendableArray.append_row()`
    - `RowAppendableArray.to_array()`

## Module contents

Miscellaneous utility functions for pyresample.

pyresample.utils.check_and_wrap(lons, lats)

  Wrap longitude to [-180:+180[ and check latitude for validity.

  Parameters:

    - lons (ndarray) – Longitude degrees

    - lats (ndarray) – Latitude degrees

  Returns:

    Longitude degrees in the range [-180:180[ and the original

      latitude array

  Return type:

    lons, lats

  Raises:

    ValueError – If latitude array is not between -90 and 90

pyresample.utils.check_slice_orientation(sli)

  Check that the slice is slicing the right way.

pyresample.utils.convert_def_to_yaml(*args, **kwargs)

  Convert an area definition to yaml representation.

pyresample.utils.create_area_def(*args, **kwargs)

  Create an area definition.

pyresample.utils.fwhm2sigma(fwhm)

  Calculate sigma for gauss function from FWHM (3 dB level).

  Parameters:

    fwhm (float) – FWHM of gauss function (3 dB level of beam footprint)

  Returns:

    sigma – sigma for use in resampling gauss function

  Return type:

    float

pyresample.utils.generate_nearest_neighbour_linesample_arrays(source_area_def, target_area_def, radius_of_influence, nprocs=1)

  Generate linesample arrays for nearest neighbour grid resampling.

  Parameters:

    - source_area_def (object) – Source area definition as geometry definition object

    - target_area_def (object) – Target area definition as geometry definition object

    - radius_of_influence (float) – Cut off distance in meters

    - nprocs (int, optional) – Number of processor cores to be used

  Returns:

    (row_indices, col_indices)

  Return type:

    tuple of numpy arrays

pyresample.utils.generate_quick_linesample_arrays(source_area_def, target_area_def, nprocs=1)

  Generate linesample arrays for quick grid resampling.

  Parameters:

    - source_area_def (object) – Source area definition as geometry definition object

    - target_area_def (object) – Target area definition as geometry definition object

    - nprocs (int, optional) – Number of processor cores to be used

  Returns:

    (row_indices, col_indices)

  Return type:

    tuple of numpy arrays

pyresample.utils.get_area_def(*args, **kwargs)

  Get an area definition.

pyresample.utils.load_area(*args, **kwargs)

  Load an area.

pyresample.utils.parse_area_file(*args, **kwargs)

  Parse an area file.

pyresample.utils.recursive_dict_update(d, u)

  Update dictionary recursively.

  Copied from:

  > http://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionary-of-varying-depth

pyresample.utils.wrap_longitudes(lons)

  Wrap longitudes to the [-180:+180[ validity range (preserves dtype).

  Parameters:

    lons (numpy array) – Longitudes in degrees

  Returns:

    lons – Longitudes wrapped into [-180:+180[ validity range

  Return type:

    numpy array