Module: landsat.js
landsat.js
Module
Comprehensive Analysis of the Module Name:
landsat.js
Primary Objectives:
The primary purpose of this module is to interact with the Google Earth Engine (GEE) to process and analyze Landsat satellite imagery. It focuses on acquiring images based on specific dates, filtering images by cloud cover, and processing collections of images to extract useful metadata.
Critical Functions:
-
addGridPosition(element):
- Role: Adds a grid position to an image based on its path and row metadata.
-
sliceByRevisit(collection, startingDate, days):
- Role: Filters an image collection by a date range starting from a given date and spanning a specified number of days.
-
acquireFromDate(date, mission, geometry):
- Role: Acquires a mosaic image from a specific date, mission, and geometry, and scores it for cloud cover.
-
processCollection(mission, geometry):
- Role: Processes an image collection to compute valid dates for image acquisition based on the mission's revisit cycle and geometry.
-
generateCloudMap(dates, mission, geometry):
- Role: Generates a list of cloud cover percentages for a series of dates.
-
queryAvailable(mission):
- Role: Queries available images for a mission and geometry, returning a dictionary of dates and their corresponding cloud cover.
-
getAvailable(mission):
- Role: Placeholder function for getting available images for a mission and geometry.
-
acquire(mission):
- Role: Acquires an image for a specific date and geometry.
-
format(properties):
- Role: Formats image properties into a readable string.
Key Variables:
- Metadata.GRID_POSITION: Used to store the computed grid position of an image.
- mission.cycle: Represents the revisit cycle of the satellite mission.
- geometry: The geographical area of interest for image acquisition and processing.
Interdependencies:
- Google Earth Engine (GEE): The module heavily relies on GEE for image collection, filtering, and processing.
-
Utility Functions: Functions like
mergeProperties
,retrieveExtremes
, andgetDate
from theutils
module are used for various processing tasks. -
Imagery Functions: The
scoreClouds
function from theimagery
module is used to evaluate cloud cover in images. -
Metadata Module: Common metadata operations are handled by the
metadata
module.
Core vs. Auxiliary Operations:
-
Core Operations:
- Image acquisition (
acquireFromDate
,acquire
) - Image collection processing (
processCollection
) - Cloud cover evaluation (
generateCloudMap
)
- Image acquisition (
-
Auxiliary Operations:
- Adding grid positions (
addGridPosition
) - Formatting properties (
format
) - Placeholder functions (
getAvailable
)
- Adding grid positions (
Operational Sequence:
-
Image Acquisition:
- Use
acquireFromDate
to get images for a specific date and geometry.
- Use
-
Collection Processing:
- Use
processCollection
to filter and process image collections based on mission parameters.
- Use
-
Cloud Map Generation:
- Use
generateCloudMap
to evaluate cloud cover for a series of dates.
- Use
-
Querying Available Images:
- Use
queryAvailable
to get a dictionary of available dates and their cloud cover.
- Use
Performance Aspects:
- Efficiency: The module uses GEE's efficient filtering and processing capabilities to handle large datasets.
- Scalability: Designed to work with large image collections and extensive geographical areas.
-
Cloud Cover Scoring: The
scoreClouds
function is critical for performance as it determines the usability of images based on cloud cover.
Reusability:
- Modular Design: Functions are designed to be reusable across different missions and geometries.
-
Parameterization: Functions accept parameters like
mission
,date
, andgeometry
, making them adaptable for various use cases.
Usage:
- Image Acquisition: Used to acquire and process Landsat images for specific dates and regions.
- Cloud Cover Analysis: Evaluates and filters images based on cloud cover, ensuring high-quality data for analysis.
- Metadata Extraction: Processes image collections to extract and format useful metadata.
Assumptions:
-
Valid Mission Data: Assumes that the
mission
object contains valid data such asname
andcycle
. -
Geometry Validity: Assumes that the provided
geometry
is valid and correctly formatted. - GEE Availability: Assumes that the Google Earth Engine service is available and accessible.
-
Utility Functions: Assumes that utility functions like
mergeProperties
,retrieveExtremes
, andgetDate
are correctly implemented and available.
This comprehensive analysis provides a detailed understanding of the landsat.js
module, its functions, and its role within the larger system.
Flow Diagram [via mermaid]
graph TD
A[User] -->|queryAvailable| B[landsat.js]
A[User] -->|getAvailable| B[landsat.js]
A[User] -->|acquire| B[landsat.js]
A[User] -->|format| B[landsat.js]
B[landsat.js] -->|queryAvailable| C[processCollection]
B[landsat.js] -->|generateCloudMap| D[acquireFromDate]
B[landsat.js] -->|acquireFromDate| E[sliceByRevisit]
B[landsat.js] -->|acquireFromDate| F[scoreClouds]
B[landsat.js] -->|processCollection| G[retrieveExtremes]
B[landsat.js] -->|processCollection| H[addGridPosition]
B[landsat.js] -->|processCollection| I[mergeProperties]
B[landsat.js] -->|processCollection| J[getDate]
C[processCollection] -->|retrieveExtremes| G[retrieveExtremes]
C[processCollection] -->|addGridPosition| H[addGridPosition]
C[processCollection] -->|mergeProperties| I[mergeProperties]
C[processCollection] -->|getDate| J[getDate]
D[acquireFromDate] -->|sliceByRevisit| E[sliceByRevisit]
D[acquireFromDate] -->|scoreClouds| F[scoreClouds]
D[acquireFromDate] -->|mergeProperties| I[mergeProperties]
E[sliceByRevisit] -->|ee.ImageCollection| K[ee]
F[scoreClouds] -->|ee.Image| K[ee]
G[retrieveExtremes] -->|ee.ImageCollection| K[ee]
H[addGridPosition] -->|ee.Image| K[ee]
I[mergeProperties] -->|ee.ImageCollection| K[ee]
J[getDate] -->|ee.Image| K[ee]
Module: landsat.js
landsat.js
Module
Comprehensive Analysis of the Module Name:
landsat.js
Primary Objectives:
The primary purpose of this module is to interact with the Google Earth Engine (GEE) to process and retrieve Landsat satellite imagery data. It focuses on acquiring images based on specific dates, filtering images by cloud cover, and processing collections of images to identify valid dates for data retrieval.
Critical Functions:
-
addGridPosition(element):
- Role: Adds a grid position to an image based on its path and row metadata.
-
sliceByRevisit(collection, startingDate, days):
- Role: Filters an image collection by a date range starting from a given date and spanning a specified number of days.
-
acquireFromDate(date, mission, geometry):
- Role: Acquires a mosaic of images from a specific date, mission, and geometry, and scores them based on cloud cover.
-
processCollection(mission, geometry):
- Role: Processes an image collection to compute valid dates for data retrieval based on the mission's revisit cycle and the geometry of the area of interest.
-
generateCloudMap(dates, mission, geometry):
- Role: Generates a list of cloud cover scores for a series of dates.
-
queryAvailable(mission):
- Role: Queries available dates and cloud cover information for a given mission and geometry.
-
getAvailable(mission):
- Role: Placeholder function for getting available data.
-
acquire(mission):
- Role: Acquires imagery for a specific date and geometry.
-
format(properties):
- Role: Formats image properties into a readable string.
Key Variables:
- Metadata.GRID_POSITION: Used to store the computed grid position of an image.
- mission.name: The name of the satellite mission (e.g., Landsat 8).
- mission.cycle: The revisit cycle of the satellite mission.
- mission.bands.qa: Quality assessment bands used for scoring clouds.
Interdependencies:
- Google Earth Engine (GEE): The module heavily relies on GEE for image processing and data retrieval.
-
Utility Functions: Functions like
mergeProperties
,retrieveExtremes
, andgetDate
from theutils
module are used for various processing tasks. - Metadata Module: Used for handling metadata properties.
Core vs. Auxiliary Operations:
-
Core Operations:
acquireFromDate
processCollection
generateCloudMap
queryAvailable
acquire
-
Auxiliary Operations:
addGridPosition
sliceByRevisit
format
Operational Sequence:
-
Data Query: Use
queryAvailable
to get available dates and cloud cover information. -
Data Acquisition: Use
acquire
to retrieve imagery for a specific date and geometry. -
Data Processing: Use
processCollection
to process image collections and identify valid dates. -
Cloud Scoring: Use
generateCloudMap
to score images based on cloud cover.
Performance Aspects:
- Efficiency: The module uses GEE's efficient image processing capabilities, but performance can be affected by the size of the image collections and the complexity of the operations.
- Scalability: Designed to handle large datasets typical of satellite imagery.
Reusability:
- Adaptability: The module is adaptable for reuse with different satellite missions by changing the mission parameters.
- Modularity: Functions are modular and can be reused in different contexts within the GEE framework.
Usage:
- Typical Use Case: The module is used to retrieve and process Landsat imagery for specific dates and regions, particularly for applications requiring cloud-free images.
- Integration: Can be integrated into larger systems for environmental monitoring, land use analysis, and other geospatial applications.
Assumptions:
- GEE Availability: Assumes that the Google Earth Engine service is available and accessible.
- Mission Parameters: Assumes that the mission parameters (name, cycle, bands) are correctly defined.
- Geometry Validity: Assumes that the provided geometry for image filtering and clipping is valid and correctly formatted.
This analysis provides a detailed overview of the landsat.js
module, highlighting its structure, functionality, and usage within the context of satellite imagery processing.
Flow Diagram [via mermaid]
graph TD
A[User] -->|queryAvailable| B[landsat.js]
A[User] -->|getAvailable| B[landsat.js]
A[User] -->|acquire| B[landsat.js]
A[User] -->|format| B[landsat.js]
B[landsat.js] -->|processCollection| C[ee.ImageCollection]
B[landsat.js] -->|generateCloudMap| D[ee.List]
B[landsat.js] -->|acquireFromDate| E[ee.Image]
C[ee.ImageCollection] -->|filterBounds| F[geometry]
C[ee.ImageCollection] -->|filterDate| G[date]
D[ee.List] -->|map| H[dates]
E[ee.Image] -->|mosaic| I[geometry]
E[ee.Image] -->|clip| I[geometry]
E[ee.Image] -->|set| J[mergeProperties]
E[ee.Image] -->|scoreClouds| K[geometry, mission.bands.qa]
subgraph Utility Functions
L[mergeProperties]
M[retrieveExtremes]
N[getDate]
O[addGridPosition]
P[sliceByRevisit]
end
B[landsat.js] --> L
B[landsat.js] --> M
B[landsat.js] --> N
B[landsat.js] --> O
B[landsat.js] --> P