Springe direkt zu Inhalt

NBR - الرسوم البيانية

الآن بعد أن أنشأنا مجموعة بيانات أساسية مع نطاقات NBR المضافة وحساب صورة الفرق، سنلقي نظرة على كيفية رسم المخططات والرسوم البيانية لدعم بحثنا في مراقبة NBR في منطقة اهتمامنا.

    

في حالة ظهور خطأ يفيد بتعذر إنشاء المخطط، ما عليك سوى تشغيل البرنامج الكودي مرة أخرى لإصلاحه.

تم عرض ذلك ضمن في الفيديو.

السلاسل الزمنية وسلسلة اليوم من السنة

لإنشاء مخططات، يجب في العمل مع مجموعات الصور، حيث يتيح لنا ذلك العمل مع العديد من العمليات الرياضية (المتوسط الحسابي، المتوسط، ...) لقيمNBR يوميًا / شهر / سنة / ...

أيضًا، سنتمكن من إلقاء نظرة على الرسوم البيانية البسيطة للسلسلة الزمنية عبر زر التحقق

دعونا نبدأ بإعداد مجموعات الصور الخاصة بنا قبل الحدث وبعده.

سنستخدم نفس البيانات كما في السابق، ولكن لن نقوم بتقليلها.

var pre_event_ic = ls8_ndvi
              .filterDate('2014-01-01', '2014-12-31')
              .select(['NDVI'],['NDVI_pre']); //This line allows us to select the band 'NDVI' and simultaneously rename it to 'NDVI_pre' in the new variable 
print(pre_event_ic, 'Pre-Event ImageCollection 2014');
Map.addLayer(pre_event_ic, ndviParams, 'Pre-Event IC 2014', false);

var post_event_ic = ls8_ndvi
              .filterDate('2020-01-01', '2020-12-31')
              .select(['NDVI'],['NDVI_post']); //this line allows us to select the band 'NDVI' and simultaneously rename it to 'NDVI_post' in the new variable 
print(post_event_ic, 'Post-Event ImageCollection 2020');
Map.addLayer(post_event_ic, ndviParams, 'Post-Event IC 2020', false);



//Add a time series chart of the mean NDVI values
// To keep processing times low and reduce the chance of producing errors, we are going to downsample our data to a spatial resolution of 200m via 'scale: 200'. Feel free to change this to 'Scale: 30' for smaller subsets to increase accuracy.
var chart_pre_event = ui.Chart.image.series({
  imageCollection: pre_event_ic,
  region: extent_aoi,
  reducer: ee.Reducer.mean(),
  scale: 200
})
.setOptions({
          title: 'Mean NDVI Value by Months Pre Event',
          hAxis: {title: 'Month', titleTextStyle: {italic: false, bold: true}},
          vAxis: {title: 'NDVI',titleTextStyle: {italic: false, bold: true}},
  });
print(chart_pre_event)

 
var chart_post_event = ui.Chart.image.series({
  imageCollection: post_event_ic,
  region: extent_aoi,
  reducer: ee.Reducer.mean(),
  scale: 200
})
.setOptions({
          title: 'Mean NDVI Value by Months Post Event',
          hAxis: {title: 'Month', titleTextStyle: {italic: false, bold: true}},
          vAxis: {title: 'NDVI',titleTextStyle: {italic: false, bold: true}},
  });
print(chart_post_event)


//We can also visualize the data in a different way by adding a day-of-year-chart of the mean NDVI values
var doychart_pre_event = ui.Chart.image
  .doySeries({
    imageCollection: pre_event_ic,
    region: extent_aoi,
    regionReducer: ee.Reducer.mean(),
    scale: 200,
    yearReducer: ee.Reducer.mean(),
    startDay: 1,
    endDay: 365
  })
  .setOptions({
          title: 'Mean NDVI Value by Date Pre Event',
          hAxis: {title: 'Day of year', titleTextStyle: {italic: false, bold: true}},
          vAxis: {title: 'NDVI',titleTextStyle: {italic: false, bold: true}},
  });

print(doychart_pre_event);


var doychart_post_event = ui.Chart.image
  .doySeries({
    imageCollection: post_event_ic,
    region: extent_aoi,
    regionReducer: ee.Reducer.mean(),
    scale: 200,
    yearReducer: ee.Reducer.mean(),
    startDay: 1,
    endDay: 365
  })
  .setOptions({
          title: 'Mean NDVI Value by Date Post Event',
          hAxis: {title: 'Day of year', titleTextStyle: {italic: false, bold: true}},
          vAxis: {title: 'NDVI',titleTextStyle: {italic: false, bold: true}},
  });
print(doychart_post_event);

الرسوم البيانية

يمكننا أيضًا إعداد بياناتنا كرسم بياني، وهذا يسمح لنا بتحليل تكرار توزيع قيم NBR.

تعمل الرسوم البيانية فقط مع الصور.

لحسن الحظ، لقد أنشأنا بالفعل صورنا قبل الحدث وبعده بالإضافة إلى صورة الاختلاف قبل بضع خطوات.

var histogram_pre_event =
    ui.Chart.image
        .histogram({
          image: pre_event,
          region: extent_aoi,
          scale: 200,
          minBucketWidth: 0.1,
        });
print(histogram_pre_event);


var histogram_post_event =
    ui.Chart.image
        .histogram({
          image: post_event,
          region: extent_aoi,
          scale: 200,
          minBucketWidth: 0.1, //define the width of a single bucket; in this example, each bucket shows a range of 0.1
        });
print(histogram_post_event);


var histogram_diff_img =
    ui.Chart.image
        .histogram({
          image: ndvi_diff,
          region: extent_aoi,
          scale: 200,
          minBucketWidth: 0.1,
        });
print(histogram_diff_img);

تحقق من الرسوم البيانية في لوحة التحكم.

ضع في اعتبارك أنها تفاعلية، بحيث يمكنك تحريك الماوس فوقها لتلقي معلومات مفصلة.