This code provides a set of utility functions for working with satellite imagery using Google Earth Engine (GEE). It includes functions for manipulating image metadata, merging image collections, and applying various transformations and calculations to the images.
## Dependencies
-`lodash/pick`: Used for picking specific properties from objects.
-`../../services/earth-engine`: Custom service for interacting with Google Earth Engine.
-`../../common/metadata`: Common metadata constants.
-`../../common/indices`: Common indices for image processing.
## Functions
### `addGridPosition(satellite)`
Adds a grid position to an image based on the satellite's computed grid position.
-**Parameters:**
-`satellite`: The satellite object used to compute the grid position.
-**Returns:** A function that takes an image element and returns the image with the grid position set.
### `getDate(image)`
Retrieves the date from an image's metadata.
-**Parameters:**
-`image`: The image from which to retrieve the date.
-**Returns:** The date of the image.
### `mergeFootprints(collection)`
Merges the footprints of a collection of images into a single geometry.
-**Parameters:**
-`collection`: The collection of images.
-**Returns:** The merged geometry of the collection.
### `retrieveExtremes(collection)`
Retrieves the earliest and latest images in a collection based on their start time.
-**Parameters:**
-`collection`: The collection of images.
-**Returns:** An object containing the earliest and latest dates.
### `mergeProperties(collection)`
Merges properties of a collection of images, including the earliest date and footprint.
-**Parameters:**
-`collection`: The collection of images.
-**Returns:** An object containing merged properties such as name, footprint, start time, and sensor ID.
### `combineReducers(...reducers)`
Combines multiple reducers into a single reducer.
-**Parameters:**
-`...reducers`: The reducers to combine.
-**Returns:** The combined reducer.
### `serializeList(subject)`
Serializes a list into a string format.
-**Parameters:**
-`subject`: The list to serialize.
-**Returns:** The serialized string.
### `generateVisualizationParams(mission)`
Generates visualization parameters for a mission.
-**Parameters:**
-`mission`: The mission object containing band information and visualization parameters.
-**Returns:** An object containing the visualization parameters.