תרשימים של ImageCollection

המודול ui.Chart.image מכיל קבוצה של פונקציות לעיבוד גרפי של תרשימים מתוצאות של צמצום מרחב-זמן של תמונות ב-ImageCollection. בחירת הפונקציה קובעת את סידור הנתונים בתרשים, כלומר מה מגדיר את ערכי ציר ה-X וציר ה-Y ומה מגדיר את הסדרה. תוכלו להיעזר בתיאורים ובדוגמאות הבאים כדי לקבוע איזו פונקציה הכי מתאימה למטרה שלכם.

פונקציות של תרשימים

אפשר להיעזר בתרשים התרשימים הבא כמדריך חזותי כדי להבין איך כל פונקציה מסדרת את התוצאות של הפחתת אוסף התמונות המרחבי-זמן בתרשים. כלומר, אילו רכיבים מגדירים את ערכי ה-x, ערכי ה-y והסדרות. חשוב לזכור שפונקציות ui.Chart.image.doySeries* מקבלות שני פונקציות הפחתה: אחת להפחתה לפי אזור (regionReducer) ואחת להפחתה במקביל באותו יום בשנה (yearReducer). בדוגמאות שבקטעים הבאים נעשה שימוש ב-ee.Reducer.mean() כארגומנטים לשני הפרמטרים האלה.

ui.Chart.image.series

תאריך התמונה מוצג בציר x בהתאם למאפיין system:time_start. סדרות מוגדרות לפי פסלי תמונות. הערכים בציר Y הם מספר התמונות שהופחתו, לפי תאריך, באזור אחד.

ui.Chart.image.seriesByRegion

תאריך התמונה מוצג בציר x בהתאם למאפיין system:time_start. הסדרות מוגדרות לפי אזורים. הערכים בציר Y הם מספר התמונות שהופחתו, לפי תאריך, בפס תמונות אחד.

ui.Chart.image.doySeries

יום התמונה בשנה מוצג בציר x בהתאם למאפיין system:time_start. סדרות מוגדרות לפי פסלי תמונה. הערכים בציר Y הם הפחתת הפיקסלים של התמונה באזור נתון, שמקובצים לפי יום בשנה.

ui.Chart.image.doySeriesByYear

יום התמונה בשנה מוצג בציר x בהתאם למאפיין system:time_start. הסדרות מוגדרות לפי השנים שמופיעות ב-ImageCollection. הערכים בציר Y מייצגים את הפחתת הפיקסלים בתמונה באזור נתון, שמקובצים לפי יום בשנה, עבור פס תמונה שנבחר.

ui.Chart.image.doySeriesByRegion

יום התמונה בשנה מוצג בציר x בהתאם למאפיין system:time_start. הסדרות מוגדרות לפי אזורים. הערכים בציר Y מייצגים את הפחתת הפיקסלים בתמונה באזור נתון, שמקובצים לפי יום בשנה, עבור פס תמונה שנבחר.

נתונים לדוגמה

הדוגמאות הבאות מבוססות על ImageCollection שהוא סדרה זמנית של NDVI ו-EVI שמבוססים על MODIS. צמצום האזורים מתבצע באזורי אקולוגיה שמוגדרים לפי מאפיינים ב-FeatureCollection שמיועד למטרות הדגמה (כך נוצר).

ui.Chart.image.series

אפשר להשתמש ב-ui.Chart.image.series כדי להציג סדרת זמן של תמונה באזור נתון. כל רצועת תמונה מוצגת כסדרה ייחודית. הוא שימושי להשוואה בין סדרות זמן של פסילות תמונה ספציפיות. כאן מוצגת תרשים של אוסף תמונות MODIS עם פסים שמייצגים את מדדי הצמחייה NDVI ו-EVI. התאריך של כל תצפית תמונה מופיע בציר x, וההפחתה הממוצעת של הפיקסלים שחופפים לאזור אקולוגי של יער מגדירה את ציר y.

Code Editor‏ (JavaScript)

// Import the example feature collection and subset the forest feature.
var forest = ee.FeatureCollection('projects/google/charts_feature_example')
                 .filter(ee.Filter.eq('label', 'Forest'));

// Load MODIS vegetation indices data and subset a decade of images.
var vegIndices = ee.ImageCollection('MODIS/061/MOD13A1')
                     .filter(ee.Filter.date('2010-01-01', '2020-01-01'))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart =
    ui.Chart.image
        .series({
          imageCollection: vegIndices,
          region: forest,
          reducer: ee.Reducer.mean(),
          scale: 500,
          xProperty: 'system:time_start'
        })
        .setSeriesNames(['EVI', 'NDVI'])
        .setOptions({
          title: 'Average Vegetation Index Value by Date for Forest',
          hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},
          vAxis: {
            title: 'Vegetation index (x1e4)',
            titleTextStyle: {italic: false, bold: true}
          },
          lineWidth: 5,
          colors: ['e37d05', '1d6b99'],
          curveType: 'function'
        });
print(chart);

ui.Chart.image.seriesByRegion

משתמשים ב-ui.Chart.image.seriesByRegion כדי להציג סדרת זמן של פס תמונה יחיד במספר אזורים. כל אזור מוצג כסדרה ייחודית. היא שימושית להשוואה של סדרת זמן של תחנה אחת בין כמה אזורים. כאן מוצגת תרשים של אוסף תמונות MODIS שמייצג סדרת זמנים של NDVI בשלושה אזורים אקולוגיים. התאריך של כל תצפית בתמונה מופיע בציר x, והירידה הממוצעת בפיקסלים שחופפים לאזורי אקולוגיים של יער, מדבר וסוואנה מגדירה את הסדרה בציר y.

Code Editor‏ (JavaScript)

// Import the example feature collection.
var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example');

// Load MODIS vegetation indices data and subset a decade of images.
var vegIndices = ee.ImageCollection('MODIS/061/MOD13A1')
                     .filter(ee.Filter.date('2010-01-01', '2020-01-01'))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart =
    ui.Chart.image
        .seriesByRegion({
          imageCollection: vegIndices,
          band: 'NDVI',
          regions: ecoregions,
          reducer: ee.Reducer.mean(),
          scale: 500,
          seriesProperty: 'label',
          xProperty: 'system:time_start'
        })
        .setOptions({
          title: 'Average NDVI Value by Date',
          hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},
          vAxis: {
            title: 'NDVI (x1e4)',
            titleTextStyle: {italic: false, bold: true}
          },
          lineWidth: 5,
          colors: ['f0af07', '0f8755', '76b349'],
        });
print(chart);

ui.Chart.image.doySeries

אפשר להשתמש ב-ui.Chart.image.doySeries כדי להציג סדרת זמן לפי יום בשנה באזור נתון. כל רצועת תמונה מוצגת כסדרה ייחודית. אפשר להשתמש בהם כדי לצמצם את מספר התצפיות שמתרחשות באותו יום בשנה, במהלך כמה שנים, ולהשוות, למשל, בין פרופילים שנתיים ממוצעים של NDVI ו-EVI מ-MODIS, כפי שמתואר בדוגמה הזו.

Code Editor‏ (JavaScript)

// Import the example feature collection and subset the grassland feature.
var grassland = ee.FeatureCollection('projects/google/charts_feature_example')
                    .filter(ee.Filter.eq('label', 'Grassland'));

// Load MODIS vegetation indices data and subset a decade of images.
var vegIndices = ee.ImageCollection('MODIS/061/MOD13A1')
                     .filter(ee.Filter.date('2010-01-01', '2020-01-01'))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart =
    ui.Chart.image
        .doySeries({
          imageCollection: vegIndices,
          region: grassland,
          regionReducer: ee.Reducer.mean(),
          scale: 500,
          yearReducer: ee.Reducer.mean(),
          startDay: 1,
          endDay: 365
        })
        .setSeriesNames(['EVI', 'NDVI'])
        .setOptions({
          title: 'Average Vegetation Index Value by Day of Year for Grassland',
          hAxis: {
            title: 'Day of year',
            titleTextStyle: {italic: false, bold: true}
          },
          vAxis: {
            title: 'Vegetation index (x1e4)',
            titleTextStyle: {italic: false, bold: true}
          },
          lineWidth: 5,
          colors: ['e37d05', '1d6b99'],
        });
print(chart);

ui.Chart.image.doySeriesByYear

אפשר להשתמש ב-ui.Chart.image.doySeriesByYear כדי להציג סדרת זמן לפי יום בשנה לאזור ולרצועת תמונות נתונים, כאשר כל שנה נפרדת בקולקציית התמונות מוצגת כסדרה ייחודית. היא שימושית להשוואה בין סדרות זמן שנתיות בין שנים. לדוגמה, בדוגמה הזו מוצגים פרופילים שנתיים של NDVI שמבוססים על MODIS לאזור אקולוגי של שטחי מרעה בשנים 2012 ו-2019, שמאפשרים להבין את השינויים משנה לשנה.

Code Editor‏ (JavaScript)

// Import the example feature collection and subset the grassland feature.
var grassland = ee.FeatureCollection('projects/google/charts_feature_example')
                    .filter(ee.Filter.eq('label', 'Grassland'));

// Load MODIS vegetation indices data and subset years 2012 and 2019.
var vegIndices = ee.ImageCollection('MODIS/061/MOD13A1')
                     .filter(ee.Filter.or(
                         ee.Filter.date('2012-01-01', '2013-01-01'),
                         ee.Filter.date('2019-01-01', '2020-01-01')))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart = ui.Chart.image
                .doySeriesByYear({
                  imageCollection: vegIndices,
                  bandName: 'NDVI',
                  region: grassland,
                  regionReducer: ee.Reducer.mean(),
                  scale: 500,
                  sameDayReducer: ee.Reducer.mean(),
                  startDay: 1,
                  endDay: 365
                })
                .setOptions({
                  title: 'Average NDVI Value by Day of Year for Grassland',
                  hAxis: {
                    title: 'Day of year',
                    titleTextStyle: {italic: false, bold: true}
                  },
                  vAxis: {
                    title: 'NDVI (x1e4)',
                    titleTextStyle: {italic: false, bold: true}
                  },
                  lineWidth: 5,
                  colors: ['39a8a7', '9c4f97'],
                });
print(chart);

ui.Chart.image.doySeriesByRegion

אפשר להשתמש ב-ui.Chart.image.doySeriesByRegion כדי להציג רצף זמן של יום בשנה בפס תמונה יחיד במספר אזורים, כאשר כל אזור ייחודי מוצג כסדרה ייחודית. היא שימושית להשוואה בין סדרות זמן שנתיות של תדר יחיד בין אזורים. לדוגמה, בדוגמה הזו מוצגים פרופילים שנוצרו מנתוני NDVI שנאספו על ידי MODIS, עבור אזורי אקולוגיים של יער, מדבר וסוואנה. כך אפשר להשוות בקלות בין התגובות של NDVI לפי אזור. שימו לב שהתצפיות בתוך השנה שמתרחשות באותו יום בשנה מופחתות לפי הממוצע שלהן.

Code Editor‏ (JavaScript)

// Import the example feature collection.
var ecoregions = ee.FeatureCollection('projects/google/charts_feature_example');

// Load MODIS vegetation indices data and subset a decade of images.
var vegIndices = ee.ImageCollection('MODIS/061/MOD13A1')
                     .filter(ee.Filter.date('2010-01-01', '2020-01-01'))
                     .select(['NDVI', 'EVI']);

// Define the chart and print it to the console.
var chart = ui.Chart.image
                .doySeriesByRegion({
                  imageCollection: vegIndices,
                  bandName: 'NDVI',
                  regions: ecoregions,
                  regionReducer: ee.Reducer.mean(),
                  scale: 500,
                  yearReducer: ee.Reducer.mean(),
                  seriesProperty: 'label',
                  startDay: 1,
                  endDay: 365
                })
                .setOptions({
                  title: 'Average NDVI Value by Day of Year',
                  hAxis: {
                    title: 'Day of year',
                    titleTextStyle: {italic: false, bold: true}
                  },
                  vAxis: {
                    title: 'NDVI (x1e4)',
                    titleTextStyle: {italic: false, bold: true}
                  },
                  lineWidth: 5,
                  colors: ['f0af07', '0f8755', '76b349'],
                });
print(chart);