Contents

Pynomic library.

class Pynomic.Pynomicplotter(summary)[source]

class for ploting the data in Pynomicproject.

RGB_image_timeline(band_name, n_id, Red: str, Green: str, Blue: str, Size=(), ax=None, days=False, vmin=0, vmax=255, **kwargs)[source]

Generate a time line of images with line plot showing a RGB function by default.

Parameters:
  • band_name (str) – the name of the band in ldata to plot.

  • n_id (str) – id of the plot.

  • Red (str) – red band name

  • Green (str) – green band name

  • Blue (str) – blue band name

  • days (bool) – default False converts the x axis.

  • function (a function that takes as input the array of the plots) – and returns an array to be ploted.

  • vmin (int) – minimum value to be plotted.

  • vmax (int) – maximium value to be plotted.

Return type:

plot and axis

image_timeline(band_name, n_id, function, ax=None, days=False, vmin=0, vmax=255, **kwargs)[source]

Generate a time line of images with line plot.

Parameters:
  • band_name (str) – the name of the band in ldata to plot.

  • n_id (str) – id of the plot.

  • days (bool) – default False converts the x axis.

  • function (function) – a function that takes as input the array of the plots and returns an array to be ploted.

  • vmin (int) – minimum value to be plotted.

  • vmax (int) – maximium value to be plotted.

Return type:

plot and axis

timeline(band_name, n_id, ax=None, days=False, **kwargs)[source]

Plots a time line of a particular band.

Parameters:
  • band_name (str) – the name of the band in ldata to plot.

  • n_id (str) – id of the plot.

  • days (bool) – default False converts the x axis.

Return type:

plot axis

class Pynomic.Pynomicproject(raw_data: Group, ldata: DataFrame, n_dates: int, dates: list, n_bands: int, bands_name: list)[source]

Contains all the extracted bands from each plot and dates.

Parameters:
  • raw_data (zarr.hierarchy.Group) – contains all the data.

  • ldata (Pandas Dataframe) – contains all the procesed data.

Calcualte_TI_GLCM(distances: list, angles: list)[source]

Calculates texturial indices from bands.

be aweare the O = (n_dist * n_bands)^n_angles. time and number of variables can scale very quckly.

Parameters:
  • distances (list) – list of distances to work usaly 2 or 3 .

  • algles (lsit) – list of angles to work.

Return type:

geodataframe.

Calcualte_green_pixels(Red: str, Blue: str, Green: str, image_shape: tuple, min_val=30, max_val=75, to_data=False)[source]

Extracts the green and non-green pixels from each image HSL.

Parameters:
  • Red (str) – name of the column that contains the red band.

  • Blue (str) – name of the column that contains the blue band.

  • Green (str) – name of the column that contains the green band.

  • image_shape (tuple) – (top, bottom, left, right) indicates the area

  • min_val (int) – in HUE range.

  • max_val (int) – in HUE range

Return type:

geodataframe.

Multispectral_VI(Red, Blue, Green, Red_edge, Nir)[source]

Calculates Multispectral Vegetation index.

Parameters:
  • Red (str) – name of the column that contains the red band.

  • Blue (str) – name of the column that contains the blue band.

  • Green (str) – name of the column that contains the green band.

  • Red_edge (str) – name of the column that contains the Red edge band.

  • NIR (str) – name of the column that contains thee NIR band.

Return type:

geodataframe

RGB_VI(Red, Blue, Green)[source]

Calculates RGB Vegetation index.

Parameters:
  • Red (str) – name of the column that contains the red band.

  • Blue (str) – name of the column that contains the blue band.

  • Green (str) – name of the column that contains the green band.

Return type:

geodataframe

generate_unique_feature(function, features_names: list, to_data=False)[source]

Higher order function that iterate through the flight dates.

Parameters:
  • function (function) – function that contains a formula and returns a list.

  • new_name (list) – name of the new features.

  • to_data (bool) – merges it with the project data.

Return type:

geodataframe.

get_senescens_Loess_predictions(band: str, threshold: float, frac_val=0.5, to_data: bool = False, from_day=0)[source]

Generates predictions of senecense by providing threshold.

Parameters:
  • band (str) – Band name to be used in the prediciton.

  • threshold (float) – value to determen if a plot is dry or not.

  • to_data (bool) – boolean value to save or not the predictions.

Return type:

Geodataframe

get_senescens_Splines_predictions(band: str, threshold: float, to_data: bool = False, from_day=0)[source]

Generates predictions of senecense by providing threshold using the spline method.

Parameters:
  • band (str) – Band name to be used in the prediciton.

  • threshold (float) – value to determen if a plot is dry or not.

  • to_data (bool) – boolean value to save or not the predictions.

Return type:

Geodataframe

get_threshold_estimation(band: str, threshold: float, to_data: bool = False, from_day=0)[source]

Generates predictions of senecense by providing threshold and index.

Parameters:
  • band (str) – Band name to be used in the prediciton.

  • threshold (float) – value to determen if a plot is dry or not.

  • to_data (bool) – boolean value to save or not the predictions.

Return type:

Geodataframe

property plot

Generate plots from spectra.

save(path)[source]

Function to save project in a directory.

Parameters:

path (str) – Name of the directory.

Return type:

A directory with the Pynomicproject folders.

save_indiv_plots_images(folder_path, fun, identification_col, file_type: str)[source]

Creates as many folders as dates in path provided and saves the plot images.

Parameters:
  • folder_path (str) – Path where to save the images.

  • fun (function) – function to use to stack the bands.

  • identification_col (str) – Column of ldata where the ids are.

  • file_type (str) – tiff or jpg

Return type:

folder with images.

Pynomic.process_stack_tiff(folder_path, grid_path, col_id: str, bands_n=None)[source]

Process all the .tiff files in a folder.

Parameters:
  • folder_path (str) – folder that contains the .tiff files.

  • grid_path (str) – path of the geojson grid.

  • col_id (str) – unique column name identifier from the grid.

  • bands_n (str) – list like with the bands names ordered.

Return type:

PynomicsProject object.

Pynomic.read_zarr(path)[source]

Reads a zarr project previously saved from pynomics.

Parameters:

path (str) – a path to the directory

Return type:

Pynomicproject object