0

I'm working with Sentinel-1 imagery in Google Earth Engine and I've encountered an issue. My goal is to filter the Sentinel-1 collection, apply the Refined Lee filter, and calculate VV/VH ratios. However, I've noticed that the system:time_start property is lost after applying the Refined Lee filter to the ImageCollection. I would like to get it back after applying the Refined Lee filter

Here is the script I'm using:

// Define the study region
var geometry = ee.Geometry.Polygon(
  [[[176.4802920098029, -38.489215944147574],
    [176.51016108939274, -38.489215944147574],
    [176.51016108939274, -38.47530795883661],
    [176.4802920098029, -38.47530795883661],
    [176.4802920098029, -38.489215944147574]]]
);
var studyRegion = geometry;

// Function to get Sentinel-1 collection
function get_s1_col(studyRegion, start_date, end_date) {
    var s1_col = ee.ImageCollection('COPERNICUS/S1_GRD')
        .filter(ee.Filter.eq('instrumentMode', 'IW'))
        .filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'))
        .filterDate(start_date, end_date)
        .filterBounds(studyRegion);
    return s1_col;
}

// Function for Refined Lee filter
var refinedLee = function(image) {
  // (Refined Lee filter implementation)
};

// Function to calculate VV/VH ratio
var calculateVVVHRatio = function(image) {
    var vv = image.select('VV').toFloat();
    var vh = image.select('VH').toFloat();
    var ratio = vv.subtract(vh).divide(vv.add(vh)).rename('VV_VH_ratio');
    var combined_image = ee.Image.cat([vv, vh, ratio]);
    combined_image = combined_image.rename(['VV', 'VH', 'ratioVV_VH']);
    return combined_image;
};

// Function to clip each image in the collection
var clipCollection = function(image) {
  var clippedImage = image.clip(studyRegion);
  return clippedImage;
};

// Process Sentinel-1 collection
var process_s1_collection = function(studyRegion, start_date, end_date) {
    var s1_collection = get_s1_col(studyRegion, start_date, end_date);
    print('s1_collection: ', s1_collection);
    var s1_lee_sigma = s1_collection.map(refinedLee);
    print('s1_lee_sigma: ', s1_lee_sigma);
    var s1_vvRatioVH = s1_lee_sigma.map(calculateVVVHRatio);
    var clip = s1_vvRatioVH.map(clipCollection);
    return clip;
};

// Create 2019-2024 collection
var s1_2019_2024 = process_s1_collection(studyRegion, '2019-01-01', '2024-01-31');
print('s1_2019_2024:', s1_2019_2024);

The full link of my script here: https://code.earthengine.google.com/d1b517214adc45d7aa4ac09e719cad32

1 Answer 1

1

There are operations you can make with an image that causes you to lose its properties (like a simple multiplication). If you want them back, you can simply copy them back from the original image. In your case, you made your life a bit harder by redefining the image variable inside your refinedLee() function. It forces you to extract the properties before you redefine the variable.

var refinedLee = function(image) {
  var props = image.toDictionary(image.propertyNames())
  ...
  return powerToDb(ee.Image(result)).set(props)
}

https://code.earthengine.google.com/d7b2f2ee66f9f3a80bf8b4563fe95052

1
  • Many thanks. It works well.
    – user30985
    Commented Oct 22 at 2:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.