Skip to main content
deleted 9 characters in body; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Failing to Map a Reducer using Google Earth Engine

I'm trying to normalize a collection of images, each to it's own mean value (over a certain region), but I keep getting an error inside the map() function that I can't find anywhere else in documentation or online.

Internal error: function argument not initialized.

Here is my code:

var col = ee.ImageCollection('COPERNICUS/S1_GRD')
  .select(['VV'])
  .filterBounds(PolyOfInterest)
  .filterDate(StartDate,EndDate);

var normalize = function(image) {
  var tmp = image.clip(PolyOfInterest);
  var stats = tmp.reduceRegion({
    geometry: roi,
    reducer: ee.Reducer.mean(),
    bestEffort: true,
  });
  print(stats); // I don't know how stats will be structured, so I haven't yet applied it to the image in the next line.
  
  return image; // Scale the image so that the mean value is mapped to 1 (values above the mean are clipped)
};

var scaledCollection = col.map(normalize);

Has anyone else encountered/solved this problem before, or could help me? 

The problem persists even if the entirety of the normalize function is replaced with simply print(image);.

Thanks!

Failing to Map a Reducer

I'm trying to normalize a collection of images, each to it's own mean value (over a certain region), but I keep getting an error inside the map() function that I can't find anywhere else in documentation or online.

Internal error: function argument not initialized.

Here is my code:

var col = ee.ImageCollection('COPERNICUS/S1_GRD')
  .select(['VV'])
  .filterBounds(PolyOfInterest)
  .filterDate(StartDate,EndDate);

var normalize = function(image) {
  var tmp = image.clip(PolyOfInterest);
  var stats = tmp.reduceRegion({
    geometry: roi,
    reducer: ee.Reducer.mean(),
    bestEffort: true,
  });
  print(stats); // I don't know how stats will be structured, so I haven't yet applied it to the image in the next line.
  
  return image; // Scale the image so that the mean value is mapped to 1 (values above the mean are clipped)
};

var scaledCollection = col.map(normalize);

Has anyone else encountered/solved this problem before, or could help me? The problem persists even if the entirety of the normalize function is replaced with simply print(image);.

Thanks!

Failing to Map Reducer using Google Earth Engine

I'm trying to normalize a collection of images, each to it's own mean value (over a certain region), but I keep getting an error inside the map() function that I can't find anywhere else in documentation or online.

Internal error: function argument not initialized.

Here is my code:

var col = ee.ImageCollection('COPERNICUS/S1_GRD')
  .select(['VV'])
  .filterBounds(PolyOfInterest)
  .filterDate(StartDate,EndDate);

var normalize = function(image) {
  var tmp = image.clip(PolyOfInterest);
  var stats = tmp.reduceRegion({
    geometry: roi,
    reducer: ee.Reducer.mean(),
    bestEffort: true,
  });
  print(stats); // I don't know how stats will be structured, so I haven't yet applied it to the image in the next line.
  
  return image; // Scale the image so that the mean value is mapped to 1 (values above the mean are clipped)
};

var scaledCollection = col.map(normalize);

Has anyone else encountered/solved this problem before, or could help me? 

The problem persists even if the entirety of the normalize function is replaced with simply print(image);.

deleted 2 characters in body
Source Link

I'm trying to normalize a collection of images, each to it's own mean value (over a certain region), but I keep getting an error inside the map() function that I can't find anywhere else in documentation or online.

Internal error: function argument not initialized.

Here is my code:

var col = ee.ImageCollection('COPERNICUS/S1_GRD')
  .select(['VV'])
  .filterBounds(PolyOfInterest)
  .filterDate(StartDate,EndDate);

var normalize = function(image) {
  var tmp = image.clip(PolyOfInterest);
  var stats = imagetmp.reduceRegion({
    geometry: roi,
    reducer: ee.Reducer.mean(),
    bestEffort: true,
  });
  print(stats); // I don't know how stats will be structured, so I haven't yet applied it to the image in the next line.
  
  return image; // Scale the image so that the mean value is mapped to 1 (values above the mean are clipped)
};

var scaledCollection = col.map(normalize);

Has anyone else encountered/solved this problem before, or could help me? The problem persists even if the entirety of the normalize function is replaced with simply print(image);.

Thanks!

I'm trying to normalize a collection of images, each to it's own mean value (over a certain region), but I keep getting an error inside the map() function that I can't find anywhere else in documentation or online.

Internal error: function argument not initialized.

Here is my code:

var col = ee.ImageCollection('COPERNICUS/S1_GRD')
  .select(['VV'])
  .filterBounds(PolyOfInterest)
  .filterDate(StartDate,EndDate);

var normalize = function(image) {
  var tmp = image.clip(PolyOfInterest);
  var stats = image.reduceRegion({
    geometry: roi,
    reducer: ee.Reducer.mean(),
    bestEffort: true,
  });
  print(stats); // I don't know how stats will be structured, so I haven't yet applied it to the image in the next line.
  
  return image; // Scale the image so that the mean value is mapped to 1 (values above the mean are clipped)
};

var scaledCollection = col.map(normalize);

Has anyone else encountered/solved this problem before, or could help me? The problem persists even if the entirety of the normalize function is replaced with simply print(image);.

Thanks!

I'm trying to normalize a collection of images, each to it's own mean value (over a certain region), but I keep getting an error inside the map() function that I can't find anywhere else in documentation or online.

Internal error: function argument not initialized.

Here is my code:

var col = ee.ImageCollection('COPERNICUS/S1_GRD')
  .select(['VV'])
  .filterBounds(PolyOfInterest)
  .filterDate(StartDate,EndDate);

var normalize = function(image) {
  var tmp = image.clip(PolyOfInterest);
  var stats = tmp.reduceRegion({
    geometry: roi,
    reducer: ee.Reducer.mean(),
    bestEffort: true,
  });
  print(stats); // I don't know how stats will be structured, so I haven't yet applied it to the image in the next line.
  
  return image; // Scale the image so that the mean value is mapped to 1 (values above the mean are clipped)
};

var scaledCollection = col.map(normalize);

Has anyone else encountered/solved this problem before, or could help me? The problem persists even if the entirety of the normalize function is replaced with simply print(image);.

Thanks!

Source Link

Failing to Map a Reducer

I'm trying to normalize a collection of images, each to it's own mean value (over a certain region), but I keep getting an error inside the map() function that I can't find anywhere else in documentation or online.

Internal error: function argument not initialized.

Here is my code:

var col = ee.ImageCollection('COPERNICUS/S1_GRD')
  .select(['VV'])
  .filterBounds(PolyOfInterest)
  .filterDate(StartDate,EndDate);

var normalize = function(image) {
  var tmp = image.clip(PolyOfInterest);
  var stats = image.reduceRegion({
    geometry: roi,
    reducer: ee.Reducer.mean(),
    bestEffort: true,
  });
  print(stats); // I don't know how stats will be structured, so I haven't yet applied it to the image in the next line.
  
  return image; // Scale the image so that the mean value is mapped to 1 (values above the mean are clipped)
};

var scaledCollection = col.map(normalize);

Has anyone else encountered/solved this problem before, or could help me? The problem persists even if the entirety of the normalize function is replaced with simply print(image);.

Thanks!