ee.Filter.calendarRange

यह एक ऐसा फ़िल्टर दिखाता है जो तब पास होता है, जब ऑब्जेक्ट का टाइमस्टैंप, कैलेंडर फ़ील्ड की दी गई रेंज में आता है. month, day_of_year, day_of_month, और day_of_week, 1 पर आधारित हैं. समय को यूटीसी में माना जाता है. हफ़्ते की शुरुआत सोमवार से होती है. इसे पहला दिन माना जाता है. अगर end < start है, तो यह value >= start या value <= end के लिए टेस्ट करता है, ताकि रैपिंग की जा सके.

इस्तेमालरिटर्न
ee.Filter.calendarRange(start, end, field)फ़िल्टर
आर्ग्यूमेंटटाइपविवरण
startपूर्णांककैलेंडर फ़ील्ड की शुरुआत की तारीख, जिसमें यह तारीख भी शामिल है.
endपूर्णांक, डिफ़ॉल्ट: nullकैलेंडर फ़ील्ड के खत्म होने की तारीख शामिल है. डिफ़ॉल्ट रूप से, इसकी वैल्यू start एट्रिब्यूट की वैल्यू के बराबर होती है.
fieldस्ट्रिंग, डिफ़ॉल्ट: "day_of_year"वह कैलेंडर फ़ील्ड जिस पर फ़िल्टर करना है. इसके विकल्प ये हैं: `year`, `month`, `hour`, `minute`, `day_of_year`, `day_of_month`, और `day_of_week`.

उदाहरण

कोड एडिटर (JavaScript)

// A Sentinel-2 surface reflectance image collection intersecting the peak of
// Mount Shasta, California, USA.
var ic = ee.ImageCollection('COPERNICUS/S2_SR')
             .filterBounds(ee.Geometry.Point(-122.196, 41.411));

print('Images for a month range (June-August)',
      ic.filter(ee.Filter.calendarRange(6, 8, 'month')));

print('A start value greater than end value is valid (Dec-Feb)',
      ic.filter(ee.Filter.calendarRange(12, 2, 'month')));

// This example uses the 'year' field value. Note that ee.Filter.date is the
// preferred method when filtering by whole years, as it is much faster.
print('Images for a year range (2020-2021)',
      ic.filter(ee.Filter.calendarRange(2020, 2021, 'year')));

// This example uses the 'day_of_year' field value. Note that
// ee.Filter.dayOfYear is the preferred method for filtering by DOY.
// The ee.Date.getRelative function is used to identify DOY from an ee.Date
// object for a representative year. Be mindful of leap years when filtering
// by DOY.
var startDoy = ee.Date('2000-06-01').getRelative('day', 'year');
var endDoy = ee.Date('2000-06-15').getRelative('day', 'year');
print('start DOY =', startDoy,
      'end DOY =', endDoy,
      'Images for a day-of-year range',
      ic.filter(ee.Filter.calendarRange(startDoy, endDoy, 'day_of_year')));

Python सेटअप करना

Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap का इस्तेमाल करने के बारे में जानकारी पाने के लिए, Python एनवायरमेंट पेज देखें.

import ee
import geemap.core as geemap

Colab (Python)

# A Sentinel-2 surface reflectance image collection intersecting the peak of
# Mount Shasta, California, USA.
ic = ee.ImageCollection('COPERNICUS/S2_SR').filterBounds(
    ee.Geometry.Point(-122.196, 41.411))

print('Images for a month range (June-August):',
      ic.filter(ee.Filter.calendarRange(6, 8, 'month')).getInfo())

print('A start value greater than end value is valid (Dec-Feb):',
      ic.filter(ee.Filter.calendarRange(12, 2, 'month')).size().getInfo())

# This example uses the 'year' field value. Note that ee.Filter.date is the
# preferred method when filtering by whole years, as it is much faster.
print('Images for a year range (2020-2021):',
      ic.filter(ee.Filter.calendarRange(2020, 2021, 'year')).size().getInfo())

# This example uses the 'day_of_year' field value. Note that
# ee.Filter.dayOfYear is the preferred method for filtering by DOY.
# The ee.Date.getRelative function is used to identify DOY from an ee.Date
# object for a representative year. Be mindful of leap years when filtering
# by DOY.
start_doy = ee.Date('2000-06-01').getRelative('day', 'year')
end_doy = ee.Date('2000-06-15').getRelative('day', 'year')
print('start DOY =', start_doy.getInfo(), 'end DOY =', end_doy.getInfo())
print(
    'Images for a day-of-year range:',
    ic.filter(ee.Filter.calendarRange(start_doy, end_doy, 'day_of_year'))
    .getInfo()
)