<jupyter_start><jupyter_text>Sentinel 2 Collection<jupyter_code>import ee
ee.Initialize()
from geetools import collection, tools, ui
from ipygee import *<jupyter_output><empty_output><jupyter_text>This means that the default collection for Landsat 1 is RAW and MSS, for Landsat 5 is SR and TM  HELPERS<jupyter_code>def print_values(image):
    print(tools.image.getValue(image, image.geometry().centroid(), 30, side='client'))<jupyter_output><empty_output><jupyter_text>Sentinel 2 SR<jupyter_code>s2sr = collection.Sentinel2SR()
collection.info(s2sr)
s2sr_i = ee.Image(s2sr.collection.first())
for band in s2sr.bands:
    print(band.id, band.name)<jupyter_output>B1 aerosol
B2 blue
B3 green
B4 red
B5 red_edge_1
B6 red_edge_2
B7 red_edge_3
B8 nir
B8A red_edge_4
B9 water_vapor
B11 swir
B12 swir2
AOT aerosol_thickness
WVP water_vapor_pressure
SCL scene_classification_map
QA10 qa10
QA20 qa20
QA60 qa60<jupyter_text>Rename<jupyter_code>s2sr_i = s2sr_i.addBands(ee.Image.constant(0).rename('test'))
s2sr_renamed = s2sr.rename(s2sr_i)
eprint(s2sr_renamed.bandNames())<jupyter_output><empty_output><jupyter_text>Rename collection<jupyter_code>s2col = s2sr.collection
s2col_renamed = s2col.map(lambda img: s2sr.rename(img))
tools.imagecollection.getValues(s2col_renamed.limit(2), ee.Image(s2col.first()).geometry().centroid(), 20, side='client')<jupyter_output><empty_output><jupyter_text>SCL Mask<jupyter_code>mask = s2sr.SclMasks(s2sr_i)<jupyter_output><empty_output><jupyter_text>Visualization<jupyter_code>Map = Map()
Map.show()<jupyter_output><empty_output><jupyter_text>renamed image<jupyter_code>p = ee.Geometry.Point([-71, -41])
s2col_renamed = s2col_renamed.filterBounds(p)
s2sr_renamed = s2col_renamed.first()
vis = s2sr.visualization('NSR', True)
Map.addLayer(s2sr_renamed, vis, 'S2 SR Renamed NSR')
Map.centerObject(s2sr_renamed)<jupyter_output><empty_output><jupyter_text>SCL<jupyter_code>visSCL = s2sr.visualization('SCL', True)
Map.addLayer(s2sr_renamed, visSCL, 'SCL')<jupyter_output><empty_output><jupyter_text>Masks<jupyter_code>s2sr.bitOptions(True)
masked = s2sr.applyMask(s2sr_renamed, 'qa60', renamed=True)
Map.addLayer(masked, vis, 'Masked')<jupyter_output><empty_output><jupyter_text>Hollstein<jupyter_code>s2toa = collection.Sentinel2TOA()
i = ee.Image(s2toa.collection.filterBounds(p).filterMetadata(s2toa.cloud_cover, 'less_than', 50).first())
Map.addLayer(i, s2toa.visualization('NSR'), 'TOA')
holl = s2toa.algorithms['hollstein']
help(holl)
iholl = holl(i, ['cloud', 'shadow', 'snow'])
Map.addLayer(iholl, s2toa.visualization('NSR'), 'Masked TOA')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1314878892733564, 'fraction_numerical': 0.03460207612456748, 'mean_word_length': 9.932773109243698, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '379246', 'license': 'MIT', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1092, 'n_words': 154, 'path': 'notebooks/collection/sentinel2.ipynb', 'repo_name': 'mmann1123/gee_tools', 'size': '2601'}