Catalog of Custom Functions
These functions encapsulate complex python code, allowing you to implement sophisticated data manipulations and calculations with ease.
Last updated
Was this helpful?
These functions encapsulate complex python code, allowing you to implement sophisticated data manipulations and calculations with ease.
Last updated
Was this helpful?
GeoPard offers a comprehensive Catalog of Custom Functions designed to enhance the readability and functionality of Equation-based Analytics. These functions encapsulate complex python
code, allowing you to implement sophisticated data manipulations and calculations with ease.
The list of available pre-built functions to create more intuitive and maintainable Equations within the GeoPard platform is incorporated in the geopard
package:
geopard.fill_gaps_with_k_neighbors(input_data, k=3)
This function restores data gaps or zeros in a dataset using the K-Neighbors algorithm. By specifying the input_data
variable (as Dataset with the selected attribute) and the number of neighbors k
, you can seamlessly fill in missing values, ensuring data continuity and integrity.
This function works well when data gaps are distributed across the field and not allocated to any particular part of the field boundary.
geopard.determine_data_similarity(data_layer_1, data_layer_2)
Use this function to calculate the per-pixel similarity between two Datasets. The variables data_layer_1
and data_layer_2
should represent the same measurement in the same units to ensure meaningful comparison. By providing variables data_layer_1
and data_layer_2
associated with Datasets, you can generate a similarity map with values ranging from 0 to 1, facilitating comparative studies and pattern recognition.
geopard.determine_data_similarity_from_normalized(data_layer_1, data_layer_2)
Use this function to calculate the per-pixel similarity between two normalized datasets. Normalization is recommended when the original data_layer_1
and data_layer_2
have different scales or units. By providing these datasets as input, the function generates a similarity map with values ranging from 0 to 1, making it suitable for comparative studies, pattern recognition, and spatial consistency analysis.
geopard.determine_low_high_similarity(data_layer_1, data_layer_2)
This function assesses the low-high similarity between two Datasets. By inputting variables data_layer_1
and data_layer_2
associated with Datasets, you receive a categorized similarity map indicating combinations such as low-low, low-high, high-low, and high-high, which is useful for nuanced data classification.
geopard.get_value_for_zone(data_layer, zones_layer, zone_id)
Extract values from the Dataset attribute for a selected Zone using this function. By providing data_layer
representing Dataset attribute, zones_layer
representing Dataset with Zones, and zone_id
as a Zone id number, you can isolate and analyze attributes like yield, application rates, or seed rates within a designated geographical area (zone).
geopard.drop_value(data_layer, value_to_drop)
This function allows you to remove specific values from a Dataset attribute. By specifying data_layer
associated with a Dataset attribute and value_to_drop
as a number, you can cleanse the Dataset attribute data by eliminating them from the result (technically replacing unwanted values with NaN
).
geopard.normalize_data(data_layer)
Normalize your Dataset attribute efficiently with this function. By inputting data_layer
associated with the Dataset attribute, you can scale the data to a standardized range from 0 to 1, facilitating comparison and integration across different Datasets.
geopard.calculate_total_applied_fertilizer(application_list, active_ingredient_coefficient_list)
Calculate the Total Applied Fertilizer in units per area (for example in kg/ha, l/ha, gal/ac, etc). By providing application_list
of Datasets with AppliedRate attributes and corresponding active_ingredient_coefficient_list
with fertilizer products to get the actually total applied fertilizer in units (for example in kg, l, gal, etc).
geopard.calculate_total_applied_nitrogen(application_list, active_ingredient_coefficient_list)
geopard.calculate_nitrogen_uptake(yield_wet_tha, moisture_pct, protein_pct, protein_crop_correction_coefficient)
geopard.calculate_nitrogen_use_efficiency(N_total_applied, N_uptake)
geopard.calculate_costs(application_rate_list, price_per_unit_list)
geopard.calculate_revenue(yield_as_mass, yield_price_per_unit)
geopard.calculate_profit(revenue, costs)
geopard.fill_value_for_range(input, min_value, max_value, value_to_fill)
This function filters values within a specified range in the input
array. By providing the input
array, along with optional min_value
and optional max_value
thresholds, you can isolate values that fall within the desired range. The value_to_fill
parameter allows for replacing out-of-range values with a specified value, enhancing data filtering and normalization processes.
geopard.calculate_per_pixel_mae(dataset_1, dataset_2)
Use this function to compute the Mean Absolute Error (MAE) per pixel between two datasets. It provides a spatial map of absolute differences. The "absolute difference" is simply the size of the gap between corresponding pixel values, ignoring whether one is higher or lower.
The function helps to identify areas with larger discrepancies.
geopard.calculate_per_pixel_relative_deviation(dataset_1, dataset_2)
This function computes the relative deviation for each pixel between two datasets, expressing the difference as a percentage of the value in dataset_1
. Essentially, it shows how much one pixel's value deviates from the corresponding value in dataset_1
in proportional terms.
This approach is particularly valuable when analyzing variations in soil properties, crop yield, or remote sensing data, allowing quickly spotting areas with significant proportional differences.
geopard.calculate_difference(dataset_1, dataset_2)
This function subtracts one dataset from another to create a difference map. It highlights areas where the values in one dataset are higher or lower compared to the other, making it easier to spot trends and changes over time.
This tool is especially useful for visualizing variations in soil properties, crop yield, or remote sensing data, helping quickly identify key areas that may require further analysis or intervention.
geopard.calculate_relative_difference(dataset_1, dataset_2)
This function computes the relative difference for each pixel by normalizing the difference between the datasets using the values from dataset_2
. This means it shows how significant the change is in relation to the magnitude of dataset_2
.
Such a proportional comparison is especially useful when dealing with datasets of varying scales, helping to reveal relative shifts in soil properties, crop yields, or sensor outputs. This approach enables to pinpointing of areas with notable variations.
geopard.calculate_normalized_difference(dataset_1, dataset_2)
This function computes the normalized difference for each pixel by scaling both datasets against their global maximum value. This process makes the datasets directly comparable even if they originally have different ranges.
The resulting map provides a clear view of variations in soil properties, crop yield, and remote sensing data, allowing quickly identify and assess key differences.
Calculate the Total Applied Nitrogen in kg/ha using this function. By providing application_list
of Datasets with AppliedRate attributes and a corresponding active_ingredient_coefficient_list
with nitrogen products to convert actual nitrogen to kg/ha, you can accurately compute Total Applied Nitrogen, essential for agricultural planning and sustainability assessments. The output is used as N_total_applied
in.
Determine Nitrogen Uptake in kg/ha with this function. By supplying yield_wet_tha
, moisture_pct
, protein_pct
from Yield Dataset and a protein_crop_correction_coefficient
represented the linkage protein to uptaken nitrogen, you can assess the Nitrogen Use Efficiency in crop production. The output is used as N_uptake
in .
Evaluate Nitrogen Use Efficiency as a percentage using this function. By inputting and variables (from previous functions), you can measure the effectiveness of nitrogen application, aiding in optimizing fertilizer usage.
Compute Total Costs based on application rates and prices with this function. By providing a application_rate_list
of Datasets with the AppliedRate attributes and a corresponding price_per_unit_list
, you can aggregate expenses related to various agricultural activities, supporting budget management and financial planning. The output is used as costs
in.
Calculate Revenue from the Yield Dataset using this function. By inputting yield_as_mass
associated with the Yield Dataset attribute and the yield_price_per_unit
, you can estimate income generated from crop production, facilitating economic evaluations. The output is used as costs
in .
Determine Profit by subtracting Costs from Revenue using this function. By providing the and variables (from previous functions), you can easily compute the financial gain from their agricultural operations, supporting profitability analysis and strategic decision-making.