<jupyter_start><jupyter_text>Tests of Raster class<jupyter_code># check whether all are needed
import numpy as np
import pandas as pd
import rasterio 
from rasterio.plot import show
from osgeo import gdal
from scipy import stats
import skimage
from skimage import exposure
from matplotlib import pyplot as plt
%matplotlib inline
plt.rcParams["figure.figsize"] = (20,12)


from shapely.ops import transform
from shapely.geometry import mapping

import rasterio as rio

from rasterio import windows
from rasterio import features
from rasterio.warp import transform_bounds

from itertools import product
from utils import output_sat_path, output_sat_rgb_path, output_map_path
from bounding_box import inner_bbox, window_trueBoundingBox, cut_linestrings_at_bounds
import pyproj
from functools import partial
from operator import is_not

import raster


import hh_utilities as hu
# base dir
BASE_DIR = "/media/hh/hd_internal/_data_DS/DSR/satelliteImages/Borneo/3093/"
# file names
r_analytic = BASE_DIR + "20180427_020348_103a_3B_AnalyticMS.tif"
r_visual_rgb_filename = BASE_DIR + "3band_visual_converted/20180427_020348_103a_3B_newVisual.tif"
meta_data_filename = BASE_DIR + "20180427_020348_103a_3B_AnalyticMS_metadata.xml"

raster_img = raster.Raster(r_analytic, r_visual_rgb_filename, meta_data_filename)
# open dataset
src = rasterio.open(r_analytic)
# read all data into numpy array (the bands are in the first dimension!)
#img_arr = src.read(masked=True)
img_arr = src.read()
#w = raster_img.get_windows(raster_img, 1024, 1024, 0.25)
# w is an instance of rasterio.window.Window

w = windows.Window(col_off=100, row_off=0, width=100, height=200)
ix = w.toslices()
ix[0]
d = img_arr[:,ix[0],ix[1]]
np.shape(d)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07298850574712644, 'fraction_numerical': 0.05, 'mean_word_length': 6.669603524229075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '233316', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 686, 'n_tokens_neox': 614, 'n_words': 165, 'path': 'notebooks/geospatial/tests_Raster_class.ipynb', 'repo_name': 'BerlinRDT/roaddetection', 'size': '1740'}