<jupyter_start><jupyter_text>Granules<jupyter_code>import starepandas
import geopandas
import pystare
import matplotlib.pyplot as plt
import importlib
fname = '../tests/data/granules/MOD05_L2.A2019336.0000.061.2019336211522.hdf'
modis = starepandas.read_granule(fname, latlon=True, sidecar=True)
modis
trixels = modis.make_trixels()
modis.set_trixels(trixels, inplace=True)
geom = geopandas.points_from_xy(modis.lon, modis.lat)
modis.set_geometry(geom, inplace=True)
fig, ax = plt.subplots(figsize=(4,4), dpi=200)
ax.grid(True)

ax.set_xlim(-68, -60)
ax.set_ylim(60, 67)
modis.plot(trixels=False, ax=ax, marker='.')
modis.plot(trixels=True, color='r', ax=ax, lw=0.2)<jupyter_output><empty_output><jupyter_text>Plotting footprints<jupyter_code>fname = '../tests/data/granules/MOD05_L2.A2019336.0000.061.2019336211522.hdf'
mod05 = starepandas.io.granules.Mod05(fname)
mod05.read_sidecar_cover()
mod05.stare_cover<jupyter_output><empty_output><jupyter_text>Manually getting the 2D STARE array<jupyter_code>import netCDF4
from pyhdf.SD import SD
import numpy
import pystare
import datetime
hdf = SD(fname)
lon = hdf.select('Longitude').get().astype(numpy.double)
lat = hdf.select('Latitude').get().astype(numpy.double)
start = datetime.datetime.now()
sids = pystare.from_latlon2D(lat=lat, lon=lon, adapt_resolution=True)
datetime.datetime.now()-start
print(pystare.spatial_resolution(sids).min())
print(pystare.spatial_resolution(sids).max())<jupyter_output>9
11<jupyter_text>Intersecting Data<jupyter_code>world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))
world.sort_values(by='name', inplace=True)
stare = starepandas.stare_from_gdf(world, level=7, force_ccw=True)
world = starepandas.STAREDataFrame(world, stare=stare)
trixels = world.make_trixels()
world.set_trixels(trixels, inplace=True)
fig, ax = plt.subplots(figsize=(4,4), dpi=200)
ax.grid(True)

country = world[world.name=='Iceland']
country.plot(ax=ax, trixels=True, boundary=True, color='y', zorder=1)
country.plot(ax=ax, trixels=False, facecolor="none", edgecolor='blue', zorder=1)
modis.plot(ax=ax, color='red', trixels=False, zorder=0)
a = modis.stare_intersects(country['stare'].iloc[0])
a.any()
len(country['stare'].iloc[0])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15169039145907473, 'fraction_numerical': 0.04448398576512456, 'mean_word_length': 8.995555555555555, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '112326', 'license': 'MIT', 'n_tokens_mistral': 998, 'n_tokens_neox': 930, 'n_words': 122, 'path': 'examples/granules.ipynb', 'repo_name': 'SpatioTemporal/STAREPandas', 'size': '2248'}