<jupyter_start><jupyter_text>Demonstrates different methods to crop the remote sensing data<jupyter_code>import sys
sys.path.append('/home/jovyan/intake-aodn')
import intake_aodn
import intake
from intake_aodn.utils import get_local_cluster
client = get_local_cluster()
client<jupyter_output><empty_output><jupyter_text>1. Select a single point<jupyter_code>ds=intake_aodn.cat.aodn_s3.SST_L3S_1d_ngt(startdt='2021-01-01',
                                          enddt='2021-03-01',
                                          cropto=dict(latitude=-32.,longitude=115.,method='nearest')).read()
ds
ds.sea_surface_temperature.plot()<jupyter_output><empty_output><jupyter_text>2. Select a list of points<jupyter_code>ds=intake_aodn.cat.aodn_s3.SST_L3S_1d_ngt(startdt='2021-01-01',
                                          enddt='2021-03-01',
                                          cropto=dict(latitude=[-32., -33., -34., -35.],longitude=[115., 115., 115., 115.],method='nearest')).read()
ds
ds.sea_surface_temperature.plot(hue='points',marker='.')<jupyter_output><empty_output><jupyter_text>3. Select a rectangular area<jupyter_code>ds=intake_aodn.cat.aodn_s3.SST_L3S_1d_ngt(startdt='2021-01-01',
                                          enddt='2021-03-01',
                                          cropto=dict(latitude=slice(-32.,-33.),longitude=slice(115,116))).read()
ds
ds.sea_surface_temperature.mean(dim='time').plot()<jupyter_output><empty_output><jupyter_text>4. Pass in a geometry<jupyter_code>import fiona # A library for lots of geospatial analysis
import geopandas as gpd # A library for opening shapefiles (and the like) and displaying their attribues and geometry
import matplotlib.pyplot as plt # A general purpose plotting library
import cartopy.crs as ccrs # Library for plotting maps in python
import cartopy.feature as cf # Library for plotting maps in python

gpd.io.file.fiona.drvsupport.supported_drivers['KML'] = 'rw' #adds support for reading KML to geopandas
gdf = gpd.read_file('SharkBay.kml', driver='KML')
gdf
ds=intake_aodn.cat.aodn_s3.SST_L3S_1d_ngt(startdt='2021-01-01',
                                             enddt='2021-03-01',
                                             geom=str(gdf.geometry[0])).read() # Geometry string in WKT
ds
ds.sea_surface_temperature.mean(dim='time').plot()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11969439728353141, 'fraction_numerical': 0.04923599320882852, 'mean_word_length': 3.135087719298246, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '135597', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 867, 'n_tokens_neox': 789, 'n_words': 134, 'path': 'notebooks/intake_usage/2_Cropping_Methods.ipynb', 'repo_name': 'IOMRC/intake-aodn', 'size': '2356'}