ee.Image.select

একটি ছবি থেকে ব্যান্ড নির্বাচন করে।

নির্বাচিত ব্যান্ডগুলির সাথে একটি চিত্র প্রদান করে।

ব্যবহার রিটার্নস
Image. select (var_args) ছবি
যুক্তি টাইপ বিস্তারিত
এই: image ছবি ইমেজ উদাহরণ.
var_args VarArgs<অবজেক্ট> দুটি সম্ভাবনার একটি:
  • নন-লিস্ট আর্গুমেন্টের যেকোনো সংখ্যা। এই সব ব্যান্ড নির্বাচক হিসাবে ব্যাখ্যা করা হবে. এগুলি ব্যান্ডের নাম, রেজেক্স বা সংখ্যাসূচক সূচক হতে পারে। যেমন নির্বাচিত = image.select('a', 'b', 3, 'd');
  • দুটি তালিকা। প্রথমটি ব্যান্ড নির্বাচক হিসেবে এবং দ্বিতীয়টি নির্বাচিত ব্যান্ডের নতুন নাম হিসেবে ব্যবহার করা হবে। নতুন নামের সংখ্যা অবশ্যই নির্বাচিত ব্যান্ডের সংখ্যার সাথে মিলবে। যেমন নির্বাচিত = image.select(['a', 4], ['newA', 'newB']);

উদাহরণ

কোড এডিটর (জাভাস্ক্রিপ্ট)

// A Sentinel-2 surface reflectance image.
var img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG');
print('All band names', img.bandNames());

print('Select a band by name',
      img.select('B11').bandNames());

print('Select a band by index',
      img.select(10).bandNames());

print('Select bands using a list',
      img.select(['B11', 'B8', 'B3']).bandNames());

print('Select bands by an argument series',
      img.select('B11', 'B8', 'B3').bandNames());

print('Mixing string and integer selectors is valid',
      img.select(10, 'B8', 2).bandNames());

print('Rename selected bands using two corresponding lists',
      img.select(['B11', 'B8', 'B3'], ['SWIR1', 'NIR', 'Green']).bandNames());

// Use regular expressions to select bands.
print('Match "QA" followed by any two characters',
      img.select('QA..').bandNames());

print('Match "B" followed by any character, any number of times',
      img.select('B.*').bandNames());

print('Match "B" followed by any character, and any optional third character',
      img.select('B..?').bandNames());

print('Match "B" followed by a character in the range 6-8',
      img.select('B[6-8]').bandNames());

print('Match "B" followed by a character in the range 1-9 and then 1-2',
      img.select('B[1-9][1-2]').bandNames());

print('Match "B" or "QA" each followed by any character, any number of times.',
      img.select('B.*|QA.*').bandNames());

পাইথন সেটআপ

পাইথন এপিআই এবং ইন্টারেক্টিভ ডেভেলপমেন্টের জন্য geemap ব্যবহার করার জন্য পাইথন এনভায়রনমেন্ট পৃষ্ঠাটি দেখুন।

import ee
import geemap.core as geemap

Colab (পাইথন)

# A Sentinel-2 surface reflectance image.
img = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG')
print('All band names:', img.bandNames().getInfo())

print('Select a band by name:', img.select('B11').bandNames().getInfo())

print('Select a band by index:', img.select(10).bandNames().getInfo())

print('Select bands using a list:',
      img.select(['B11', 'B8', 'B3']).bandNames().getInfo())

print('Select bands by an argument series:',
      img.select('B11', 'B8', 'B3').bandNames().getInfo())

print('Mixing string and integer selectors is valid:',
      img.select(10, 'B8', 2).bandNames().getInfo())

print('Rename selected bands using two corresponding lists:',
      img.select(['B11', 'B8', 'B3'], ['SWIR1', 'NIR', 'Green'])
      .bandNames().getInfo())

# Use regular expressions to select bands.
print('Match "QA" followed by any two characters:',
      img.select('QA..').bandNames().getInfo())

print('Match "B" followed by any character, any number of times:',
      img.select('B.*').bandNames().getInfo())

print('Match "B" followed by any character, and any optional third character',
      img.select('B..?').bandNames().getInfo())

print('Match "B" followed by a character in the range 6-8',
      img.select('B[6-8]').bandNames().getInfo())

print('Match "B" followed by a character in the range 1-9 and then 1-2',
      img.select('B[1-9][1-2]').bandNames().getInfo())

print('Match "B" or "QA" each followed by any character, any number of times.',
      img.select('B.*|QA.*').bandNames().getInfo())