diff --git a/MANIFEST.in b/MANIFEST.in index 836df78..aaa0265 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,5 @@ include LICENSE README.rst setup.py include tests*/*.py -include tests/data/*.csv include integration_test/*.py recursive-include docs *.rst recursive-include docs *.png diff --git a/nrt/__init__.py b/nrt/__init__.py index 3ced358..69e3be5 100644 --- a/nrt/__init__.py +++ b/nrt/__init__.py @@ -1 +1 @@ -__version__ = "0.2.1" +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/nrt/data/__init__.py b/nrt/data/__init__.py deleted file mode 100644 index 7015d1f..0000000 --- a/nrt/data/__init__.py +++ /dev/null @@ -1,363 +0,0 @@ -# Copyright (C) 2022 European Union (Joint Research Centre) -# -# Licensed under the EUPL, Version 1.2 or - as soon they will be approved by -# the European Commission - subsequent versions of the EUPL (the "Licence"); -# You may not use this work except in compliance with the Licence. -# You may obtain a copy of the Licence at: -# -# https://joinup.ec.europa.eu/software/page/eupl -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the Licence is distributed on an "AS IS" basis, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the Licence for the specific language governing permissions and -# limitations under the Licence. - -import os -import json - -import xarray as xr -import rasterio -import numpy as np - - -data_dir = os.path.abspath(os.path.dirname(__file__)) - - -def _load(f, **kwargs): - """Load a ncdf file located in the data directory as a xarray Dataset - - Args: - f (str): File basename - **kwargs: Keyword arguments passed to ``xarray.open_dataset`` - - Return: - xarray.Dataset: The Dataset - """ - xr_dataset = xr.open_dataset(os.path.join(data_dir, f), - **kwargs) - return xr_dataset - - -def romania_10m(**kwargs): - """Sentinel 2 datacube of a small forested area in Romania at 10 m resolution - - Examples: - >>> from nrt import data - - >>> s2_cube = data.romania_10m() - >>> # Compute NDVI - >>> s2_cube['ndvi'] = (s2_cube.B8 - s2_cube.B4) / (s2_cube.B8 + s2_cube.B4) - >>> # Filter clouds - >>> s2_cube = s2_cube.where(s2_cube.SCL.isin([4,5,7])) - """ - return _load(f='sentinel2_cube_subset_romania_10m.nc', **kwargs) - - -def romania_20m(**kwargs): - """Sentinel 2 datacube of a small forested area in Romania at 20 m resolution - - Examples: - >>> from nrt import data - - >>> s2_cube = data.romania_20m() - >>> # Compute NDVI - >>> s2_cube['ndvi'] = (s2_cube.B8A - s2_cube.B4) / (s2_cube.B8A + s2_cube.B4) - >>> # Filter clouds - >>> s2_cube = s2_cube.where(s2_cube.SCL.isin([4,5,7])) - """ - return _load(f='sentinel2_cube_subset_romania_20m.nc', **kwargs) - - -def romania_forest_cover_percentage(): - """Subset of Copernicus HR layer tree cover percentage - 20 m - Romania - """ - file_basename = 'tree_cover_density_2018_romania.tif' - filename = os.path.join(data_dir, file_basename) - with rasterio.open(filename) as src: - arr = src.read(1) - return arr - - -def mre_crit_table(): - """Contains a dictionary equivalent to strucchange's ``mreCritValTable`` - The key 'sig_level' is a list of the available pre-computed significance - (1-alpha) values. - - The other keys contain nested dictionaries, where the keys are the - available relative window sizes (0.25, 0.5, 1), the second keys are the - available periods (2, 4, 6, 8, 10) and the third keys are the functional - types ("max", "range"). - - Example: - >>> from nrt import data - >>> crit_table = data.mre_crit_table() - >>> win_size = 0.5 - >>> period = 10 - >>> functional = "max" - >>> alpha=0.025 - >>> crit_values = crit_table.get(str(win_size))\ - .get(str(period))\ - .get(functional) - >>> sig_level = crit_table.get('sig_levels') - >>> crit_level = np.interp(1-alpha, sig_level, crit_values) - """ - with open(os.path.join(data_dir, "mreCritValTable.json")) as crit: - crit_table = json.load(crit) - return crit_table - - -def make_ts(dates, break_idx=-1, intercept=0.7, amplitude=0.15, magnitude=0.25, - recovery_time=1095, sigma_noise=0.02, n_outlier=3, - outlier_value=-0.1, n_nan=3): - """Simulate a harmonic time-series with optional breakpoint, noise and outliers - - The time-series is generated by adding; - - an intercept/trend component which varies depending on the phase of the time-series - (stable, recovery) - - An annual seasonal component - - Random noise drawn from a normal distribution (white noise) - Optional outliers are then added to randomly chosen observation as well as ``np.Nan`` values. - Note that the seasonal cycles simulation approach used here is rather simplistic, - using a sinusoidal model and therefore assuming symetrical and regular behaviour - around the peak of the simulated variable. Actual vegetation signal is often more - asymetrical and irregular. - - Args: - dates (array-like): List or array of dates (numpy.datetime64) - break_idx (int): Breakpoint index in the date array provided. Defaults to - ``-1``, corresponding to a stable time-series - intercept (float): Intercept of the time-series - amplitude (float): Amplitude of the harmonic model (note that at every point - of the time-series, the actual model amplitude is multiplied by the intercept - magnitude (float): Break magnitude (always a drop in y value) - recovery_time (int): Time (in days) to recover the initial intersect value - following a break - sigma_noise (float): Sigma value of the normal distribution (mean = 0) from which - noise values are drawn - n_outlier (int): Number of outliers randomly assigned to observations of the - time-series - outlier_value (float): Value to assign to outliers - n_nan (int): Number of ``np.nan`` (no data) assigned to observations of the - time-series - - Example: - >>> from nrt import data - >>> import numpy as np - >>> import matplotlib.pyplot as plt - - >>> dates = np.arange('2018-01-01', '2022-06-15', dtype='datetime64[W]') - >>> ts = data.make_ts(dates=dates, break_idx=30) - - >>> plt.plot(dates, ts) - >>> plt.show() - - Returns: - np.ndarray: Array of simulated values of same size as ``dates`` - """ - dates = dates.astype('datetime64[D]') - timestamps = dates.astype(int) - ydays = (dates - dates.astype('datetime64[Y]')).astype(int) + 1 - y = np.empty_like(dates, dtype=np.float64) - # Intercept array - y[:] = intercept - # Build trend segment if break - if break_idx != -1: - # Segment bounds - segment_start_y = intercept - magnitude - segment_start_timestamp = timestamps[break_idx] - segment_end_timestamp = segment_start_timestamp + recovery_time - segment_end_idx = np.abs(segment_end_timestamp - timestamps).argmin() - # Compute y values - recovery_rate = magnitude / recovery_time - days_since_break = timestamps - segment_start_timestamp - trend_segment = (recovery_rate * days_since_break + segment_start_y)[break_idx + 1:segment_end_idx + 1] - # include into y - y[break_idx + 1:segment_end_idx + 1] = trend_segment - # Seasonality - amplitude_values = amplitude * y - season = amplitude * np.sin(2 * np.pi * timestamps / 365.25 - 2) - # noise and outliers - noise = np.random.normal(0, sigma_noise, dates.size) - # Combine the 3 (trend, season, noise) components - ts = y + season + noise - # Add optional outliers and Nans - outliers_idx = np.random.choice(np.arange(0, dates.size), size=n_outlier, replace=False) - nan_idx = np.random.choice(np.arange(0, dates.size), size=n_nan) - ts[outliers_idx] = outlier_value - ts[nan_idx] = np.nan - return ts - - -def make_cube_parameters(shape=(100,100), - break_idx_interval=(0,100), - intercept_interval=(0.6, 0.8), - amplitude_interval=(0.12, 0.2), - magnitude_interval=(0.2, 0.3), - recovery_time_interval=(800,1400), - sigma_noise_interval=(0.02, 0.04), - n_outliers_interval=(0,5), - n_nan_interval=(0,5), - unstable_proportion=0.5): - """Create ``xarray.Dataset`` of paramters for generation of synthetic data cube - - Prepares the main input required by the the ``make_cube`` function. This - intermediary step eases the creation of multiple synthetic DataArrays sharing - similar characteristics (e.g. to simulate multispectral data) - - Args: - shape (tuple): A size two integer tuple giving the x,y size of the Dataset to be - generated - break_idx_interval (tuple): A tuple of two integers indicating the interval - from which the breakpoint position in the time-series is drawn. Generate - array of random values passed to the ``break_idx` argument of ``make_ts``. - Similarly to python ranges, upper bound value is excluded from the resulting - array. To produce a zero filled array ``(0,1)`` can therefore be used - TODO: add a default to allow breakpoint at any location (conflict with Nan that indicate no break) - intercept_interval (tuple): A tuple of two floats providing the interval - from which intercept is drawn. Generate array of random values passed - to the ``intercept`` argument of ``make_ts`` - amplitude_interval (tuple): A tuple of two floats indicating the interval - from which the seasonal amplitude parameter is drawn. Generate array - of random values passed to the ``amplitude`` argument of ``make_ts`` - magnitude_interval (tuple): A tuple of two floats indicating the interval - from which the breakpoint magnitude parameter is drawn. Generate array - of random values passed to the ``magnitude`` argument of ``make_ts`` - recovery_time_interval (tuple): A tuple of two integers indicating the interval - from which the recovery time parameter (in days) is drawn. Generate array - of random values passed to the ``recovery_time` argument of ``make_ts`` - sigma_noise_interval (tuple): A tuple of two floats indicating the interval - from which the white noise level is drawn. Generate array of random - values passed to the ``sigma_noise` argument of ``make_ts`` - n_outliers_interval (tuple): A tuple of two integers indicating the interval - from which the number of outliers is drawn. Generate array - of random values passed to the ``n_outliers` argument of ``make_ts`` - n_nan_interval (tuple): A tuple of two integers indicating the interval - from which the number of no-data observations is drawn. Generate array - of random values passed to the ``n_nan` argument of ``make_ts`` - unstable_proportion (float): Proportion of time-series containing a breakpoint. - The other time-series are stable. - - Returns: - xarray.Dataset: Dataset with arrays of parameters required for the generation - of synthetic time-series using the spatialized version of ``make_ts`` - (see ``make_cube``) - - Examples: - >>> import time - >>> import numpy as np - >>> import xarray as xr - >>> from nrt import data - >>> import matplotlib.pyplot as plt - >>> params_nir = data.make_cube_parameters(shape=(20,20), - ... n_outliers_interval=(0,1), - ... n_nan_interval=(0,1), - ... break_idx_interval=(50,100)) - >>> params_red = params_nir.copy(deep=True) - >>> # create parameters for red, green, blue cubes by slightly adjusting intercept, - >>> # magnitude and amplitude parameters - >>> params_red['intercept'].data = np.random.uniform(0.09, 0.12, size=(20,20)) - >>> params_red['magnitude'].data = np.random.uniform(-0.1, -0.03, size=(20,20)) - >>> params_red['amplitude'].data = np.random.uniform(0.03, 0.07, size=(20,20)) - >>> params_green = params_nir.copy(deep=True) - >>> params_green['intercept'].data = np.random.uniform(0.12, 0.20, size=(20,20)) - >>> params_green['magnitude'].data = np.random.uniform(0.05, 0.1, size=(20,20)) - >>> params_green['amplitude'].data = np.random.uniform(0.05, 0.08, size=(20,20)) - >>> params_blue = params_nir.copy(deep=True) - >>> params_blue['intercept'].data = np.random.uniform(0.08, 0.13, size=(20,20)) - >>> params_blue['magnitude'].data = np.random.uniform(-0.01, 0.01, size=(20,20)) - >>> params_blue['amplitude'].data = np.random.uniform(0.02, 0.04, size=(20,20)) - >>> dates = np.arange('2018-01-01', '2022-06-15', dtype='datetime64[W]') - >>> # Create cubes (DataArrays) and merge them into a sligle Dataset - >>> nir = data.make_cube(dates, name='nir', params_ds=params_nir) - >>> red = data.make_cube(dates, name='red', params_ds=params_red) - >>> green = data.make_cube(dates, name='green', params_ds=params_green) - >>> blue = data.make_cube(dates, name='blue', params_ds=params_blue) - >>> cube = xr.merge([blue, green, red, nir]).to_array() - >>> # PLot one ts - >>> cube.isel(x=5, y=5).plot(row='variable') - >>> plt.show() - """ - intercept = np.random.uniform(*intercept_interval, size=shape) - amplitude = np.random.uniform(*amplitude_interval, size=shape) - magnitude = np.random.uniform(*magnitude_interval, size=shape) - recovery_time = np.random.randint(*recovery_time_interval, size=shape) - sigma_noise = np.random.uniform(*sigma_noise_interval, size=shape) - n_outlier = np.random.randint(*n_outliers_interval, size=shape) - n_nan = np.random.randint(*n_nan_interval, size=shape) - break_idx = np.random.randint(*break_idx_interval, size=shape) - # Make a proportion of these cells stable - size = np.multiply(*shape) - stable_size = size - round(unstable_proportion * size) - break_idx.ravel()[np.random.choice(size, stable_size, replace=False)] = -1 - # Build Dataset of parameters - params = xr.Dataset(data_vars={'intercept': (['y', 'x'], intercept), - 'amplitude': (['y', 'x'], amplitude), - 'magnitude': (['y', 'x'], magnitude), - 'recovery_time': (['y', 'x'], recovery_time), - 'sigma_noise': (['y', 'x'], sigma_noise), - 'n_outlier': (['y', 'x'], n_outlier), - 'n_nan': (['y', 'x'], n_nan), - 'break_idx': (['y', 'x'], break_idx)}, - coords={'y': np.arange(shape[0]), - 'x': np.arange(shape[1])}) - return params - - -def make_cube(dates, params_ds, outlier_value=0.1, name='ndvi'): - """Generate a cube of synthetic time-series - - See ``make_ts`` for more details on how every single time-series is generated - - Args: - dates (array-like): List or array of dates (numpy.datetime64) - params_ds (xarray.Dataset): Dataset containing arrays of time-series generation - parameters. See ``make_cube_parameters`` for a helper to generate such Dataset. - Spatial dimensions of the params_ds Dataset are used for the generated cube - outlier_value (float): Value to assign to outliers - name (str): Name of the generated variable in the DataArray - - Return: - xarray.DataArray: Cube of synthetic time-series generated using the paramters - provided via ``param_ds`` Dataset. - - Example: - >>> import time - >>> import numpy as np - >>> from nrt import data - >>> import matplotlib.pyplot as plt - >>> dates = np.arange('2018-01-01', '2022-06-15', dtype='datetime64[W]') - >>> params_ds = data.make_cube_parameters(shape=(100,100), - ... n_outliers_interval=(0,5), - ... n_nan_interval=(0,7), - ... break_idx_interval=(100,dates.size - 20)) - >>> cube = data.make_cube(dates=dates, params_ds=params_ds) - >>> # PLot one ts - >>> cube.isel(x=5, y=5).plot() - >>> plt.show() - """ - nrows, ncols = params_ds.intercept.data.shape - # Vectorize function - make_ts_v = np.vectorize(make_ts, signature='(n),(),(),(),(),(),(),(),(),()->(n)') - # Create output array - out = make_ts_v(dates=dates, - break_idx=params_ds.break_idx.data, - intercept=params_ds.intercept.data, - amplitude=params_ds.amplitude.data, - magnitude=params_ds.magnitude.data, - recovery_time=params_ds.recovery_time.data, - sigma_noise=params_ds.sigma_noise.data, - n_outlier=params_ds.n_outlier.data, - outlier_value=outlier_value, - n_nan=params_ds.n_nan.data) - # Build xarray dataset - xr_cube = xr.DataArray(data=np.moveaxis(out, -1, 0), - coords={'time': dates, - 'y': np.arange(nrows), - 'x': np.arange(ncols)}, - name=name) - return xr_cube - -if __name__ == "__main__": - import doctest - doctest.testmod() diff --git a/nrt/data/mreCritValTable.json b/nrt/data/mreCritValTable.json deleted file mode 100644 index 9bf7935..0000000 --- a/nrt/data/mreCritValTable.json +++ /dev/null @@ -1 +0,0 @@ -{"0.25":{"2":{"max":[1.22762665817831,1.23066970866923,1.23276485917986,1.23564055536802,1.23847794049457,1.24198076615651,1.24481637165883,1.24879019056867,1.25239505325696,1.25498907533676,1.25822933229468,1.26223904797321,1.26596555529583,1.26923998208695,1.27264091504165,1.27603992297831,1.27959232745831,1.28485863206623,1.28918350549942,1.29311889830519,1.2977431610724,1.30293027348104,1.30709536503133,1.31158624473196,1.31737646083926,1.32335166269351,1.32786358742455,1.33350696717069,1.33919230324655,1.34492551588986,1.35027274948328,1.35619676871919,1.36259049396895,1.36957894266347,1.37645783098199,1.38428233380854,1.39194501572598,1.40100798604519,1.41166991783875,1.42087734975763,1.4332629474243,1.44359950240666,1.45511231203346,1.47160701884111,1.48885977022345,1.50729964467061,1.53175586508601,1.56038054799786,1.60458840049086,1.67397676536158],"range":[1.81954446481909,1.82344798626059,1.82661414686887,1.83012286026358,1.83360988469104,1.83715307775979,1.84056756023769,1.84447094408104,1.84879237475351,1.85298319721727,1.85760168211944,1.86229547366417,1.86607380226072,1.87015100669539,1.87434883360663,1.87862404267598,1.88404478043788,1.88874302055418,1.89345950619256,1.8990209037878,1.90449669183086,1.91062464756646,1.91580988964948,1.92155884964439,1.92769261345449,1.93415193190404,1.94041179292859,1.94569298705534,1.95291260429275,1.96021400157099,1.96856019678075,1.97628019027419,1.98582433124427,1.99338282123118,2.00352123592733,2.01261514315571,2.02281840175644,2.03218988260106,2.04365141141769,2.05775961499134,2.07290455593282,2.08573018151457,2.10381247226301,2.12274034143787,2.14594597496256,2.16901291630049,2.2006775007979,2.23584782620152,2.28952131979675,2.36288190456084]},"4":{"max":[1.33623105388957,1.33879059030532,1.34146823757119,1.34417861992375,1.3465859785707,1.34920669388068,1.35202040971813,1.35462026215463,1.35719673301301,1.36049997713998,1.36372549810846,1.36667883846684,1.37052411847341,1.37374212322454,1.37657697158592,1.38022128723907,1.38394338302155,1.38769333359217,1.39048392473728,1.39408189315686,1.39843637731271,1.40284080982133,1.40734331669295,1.41189572366036,1.41597082120943,1.42022026752427,1.42524057175581,1.43085920948697,1.43555358483841,1.44053121853627,1.44543973881029,1.45089202071443,1.45602813899372,1.46278181190807,1.46985441198876,1.47696589701722,1.48523183187464,1.4928335139521,1.50095115109795,1.51067508324004,1.51983679278537,1.53269740247647,1.54440348055754,1.55910620044073,1.5757207179645,1.59695604364839,1.61812223040947,1.64940524297012,1.68594331412298,1.74550948894458],"range":[2.08412863196499,2.08700050605196,2.09015587299808,2.09314772413788,2.0962118341186,2.09917174136122,2.10278041385553,2.10664115359282,2.11051021733345,2.11386339871615,2.11800614299258,2.12153141721421,2.12493922632193,2.128940723382,2.13256639487202,2.13624534724997,2.13987494438998,2.14428962586375,2.1488466247166,2.15289915148653,2.15772291958247,2.16275539625543,2.16754418014273,2.17340107059304,2.17804833913143,2.18292605491209,2.18834249521883,2.19418031959385,2.19974183639896,2.20602030124108,2.21275319960549,2.21975099503959,2.22754034101027,2.23584860470238,2.24643285315134,2.25447222697549,2.26355487832797,2.27330215278724,2.28338923866037,2.29629889010986,2.30968297534757,2.32120188794181,2.33947210810481,2.35476341812366,2.37402027796209,2.39199360336253,2.41528158657702,2.44577623701494,2.48767372335248,2.56385789438856]},"6":{"max":[1.34108685187662,1.34391583752137,1.34624172867029,1.34839917683048,1.35109583245859,1.35376511356222,1.35614865096182,1.3589153034203,1.36194735830278,1.36523574166444,1.36827681119024,1.37164275186352,1.37460434441364,1.37781526603652,1.38115250250291,1.38474992975096,1.38801205099788,1.39091294470053,1.39464610643847,1.39872249131114,1.40265414814487,1.40676218000241,1.41145745016112,1.41537372778588,1.41936982775548,1.42362459481656,1.42868230819686,1.4335263612056,1.43825178128014,1.44291380981225,1.44812318488765,1.45314333050063,1.45889808672432,1.46547805028961,1.47234905574779,1.48040430543862,1.48742657759599,1.49494270557386,1.50325247631427,1.51196972918776,1.52159988186384,1.5338376447881,1.54538029292232,1.56033776761057,1.57658154293077,1.59797111384019,1.61839672202083,1.64940524297012,1.68594331412298,1.74550948894458],"range":[2.11180746892218,2.11463521114668,2.11795938985215,2.1209477515762,2.12367749118468,2.12700564954345,2.13022885738685,2.13331413213671,2.13638901650338,2.13957142023227,2.14278319617785,2.14654037225162,2.15025122444992,2.15350620192262,2.15790353284222,2.16174960354069,2.16591902110115,2.16962692628423,2.17482006047446,2.17837241804329,2.1823519062029,2.18644278886306,2.19144615710786,2.19619036546802,2.20084587599274,2.20594262058077,2.21151932219498,2.21677557521056,2.22390405782033,2.22946798441255,2.23600560246166,2.24357296278298,2.25145401752516,2.25788606932308,2.26592510857528,2.27469446859609,2.28180217420085,2.2921810700707,2.30360483959548,2.31424301355248,2.32622597282216,2.34133705551313,2.35451543226751,2.3703340530465,2.38788822898856,2.40714432279085,2.43114641843066,2.4603445009744,2.50193957388617,2.57715648650667]},"8":{"max":[1.34165681503561,1.34413752134022,1.34645624006547,1.34885191571363,1.35155402000607,1.35398617621481,1.35634491518239,1.35923481408015,1.36226456490384,1.36560026937241,1.3685046029885,1.37214926058743,1.37477725947058,1.37813432738452,1.38154788481536,1.38507423359833,1.3883679478361,1.39117348693852,1.39508146109301,1.39885993994357,1.40307434720965,1.40727611318749,1.41163904123871,1.4155821439226,1.4195616504863,1.42380433491698,1.42884928919173,1.43362752470632,1.43839225150709,1.44297415629377,1.44822824145847,1.45326230316142,1.45899173457736,1.46554748937219,1.47245299778231,1.48055874421042,1.48752188622688,1.49506819639025,1.50344238684623,1.51198649641834,1.52162850629023,1.53408167478549,1.54554689692936,1.56033776761057,1.57658154293077,1.59797111384019,1.61839672202083,1.64940524297012,1.68594331412298,1.74550948894458],"range":[2.12023606594727,2.12271312238526,2.12570983180643,2.12870146970024,2.13138278881771,2.13432755770033,2.1372173309577,2.14015064852228,2.14337274683089,2.14667091866216,2.15023732394521,2.15330108915549,2.15708559803071,2.16079879827035,2.16479117991533,2.16837711066996,2.17272178924074,2.17696276396447,2.1805518769006,2.18427980386643,2.18816464030844,2.19270005873997,2.19756475040665,2.20137135641134,2.20646049986697,2.21235424451003,2.2172520230591,2.22390448303944,2.22912572338386,2.23559446368185,2.24184595886197,2.25014852708459,2.25560261704792,2.26371913853653,2.27108474517556,2.27872967620606,2.28581023227752,2.29638970067853,2.30840554880696,2.31802794634901,2.33015160144847,2.34413894973114,2.35701974551271,2.37415798162602,2.38941664405227,2.41044813125293,2.43262481616013,2.46153747539832,2.50347160121869,2.57724178592687]},"10":{"max":[1.34182451007628,1.34439131451376,1.34660319011975,1.34915116589537,1.35178587051693,1.35417886044462,1.3566836167395,1.35948739899674,1.36256898537193,1.36577231193638,1.36886320957607,1.37237427017584,1.37485167515552,1.37831535555367,1.38175120511989,1.38537793038039,1.38847324240149,1.39145597087778,1.39532955755002,1.39911228012838,1.40318773259415,1.40748954375846,1.41181372331003,1.41569840195645,1.41977723105019,1.4238186195231,1.42895669363032,1.43363936425424,1.43840514935644,1.44307576181773,1.44823608804569,1.45331084387002,1.45902908335449,1.46557816998587,1.4725305386567,1.48057636069157,1.48759284416558,1.49517101820054,1.50384229730937,1.5120839046915,1.52164497279622,1.53436454805016,1.54556159000357,1.56036062897291,1.57673206447201,1.59797111384019,1.61839672202083,1.64940524297012,1.68594331412298,1.74550948894458],"range":[2.12320823869064,2.12592798765015,2.12893373691857,2.13144740982465,2.13436228911229,2.13712065817205,2.1399242164402,2.14299416667874,2.14639323126965,2.14981626879143,2.15289921726444,2.15654036991459,2.15983848157569,2.16354643287978,2.16725752708834,2.17091203976378,2.17575002492038,2.17949319057116,2.18278067782414,2.18658263069226,2.190831628588,2.19529666017785,2.19953592798011,2.20420219844996,2.20976171342769,2.21435123608395,2.2197417573013,2.22572782807263,2.23161827669412,2.23785128970986,2.24596536134365,2.25167806496759,2.2577705279316,2.26532559641099,2.27275118676399,2.27988920935585,2.2875555808519,2.29875120806278,2.31018232789398,2.31960844363455,2.33282714628515,2.34615425435877,2.35894608057624,2.37549525619605,2.39125032964919,2.41133838110484,2.43270772115341,2.46165670661943,2.50348125220136,2.57980707025258]}},"0.5":{"2":{"max":[1.68732328328598,1.69160084179475,1.69633389358351,1.70158435524857,1.70551689505972,1.71107257285131,1.71626606143193,1.72019347712026,1.72583651612689,1.73080136283287,1.73632152412507,1.74196445041873,1.74739377676382,1.75350003177274,1.75880466474247,1.76547247515605,1.77251787804276,1.77940231593083,1.78802901378588,1.79524119452131,1.8022227519734,1.80915784114738,1.81682673045196,1.82485724271212,1.83334265228127,1.84186416555787,1.85177121092134,1.8612108588202,1.86950504404675,1.87858666618536,1.88695252785603,1.8992710039668,1.90998994145834,1.92044406545023,1.93325881936299,1.9484641220537,1.96135719471953,1.97830731677393,1.9933493336296,2.01053594213232,2.03146339358619,2.05289581866667,2.07310241616824,2.09696385947528,2.12151951630359,2.15191486007068,2.20039670238309,2.24711394446681,2.30800393871034,2.43457585062277],"range":[2.22591384652163,2.230802774778,2.23546239454496,2.24093729493409,2.24691132720936,2.25207640253111,2.25711848954445,2.26257788410066,2.26937879553809,2.27632863034704,2.28251384825922,2.28894633683292,2.29685201489767,2.30389287635647,2.31063580959909,2.31859472417178,2.32501638954249,2.33313304952541,2.34154552719839,2.34991415430168,2.35768939575221,2.36697288397517,2.37513621128066,2.38436361932194,2.39357722791474,2.40318935014295,2.41413112282927,2.4244069353319,2.43654883505762,2.44592536388882,2.46069640068571,2.47210217933256,2.4840140754345,2.49911162022067,2.51378903741398,2.52759903878667,2.54230191786081,2.55918000535822,2.57599709125068,2.59563563116634,2.61318658431308,2.63291187767,2.65856886383863,2.68503700708307,2.72286852313628,2.76045743240488,2.80467421534113,2.85714775503752,2.92796133814304,3.05951223403142]},"4":{"max":[1.8863309010041,1.89023763912529,1.89505055324671,1.8996872069726,1.90396104830582,1.90830710813031,1.91295018738968,1.91751604106457,1.92212903036675,1.92796698329961,1.93324324569141,1.93918038241824,1.945610384202,1.95099093303112,1.95723350782807,1.96320972852135,1.9696910872405,1.97536757884356,1.98148833656383,1.98760402287577,1.99470655040184,2.0014831952455,2.00990617784639,2.01800884070615,2.02639046609307,2.03402198587187,2.04207854563661,2.05201428309035,2.05894590307482,2.06609460804903,2.07553346343271,2.0856485989476,2.09526908882824,2.10508945592555,2.11499858552887,2.12644605226194,2.13860160003387,2.15176436484615,2.16599721679536,2.18452237446875,2.20116995886405,2.21810904347873,2.24107971112342,2.26412295727692,2.29053194168806,2.32051977467861,2.35590430637147,2.40898177256112,2.46453707538155,2.56886151964252],"range":[2.68085534937008,2.68643863041128,2.6908988918078,2.69650886566693,2.70257736700686,2.70764593946809,2.71175246283891,2.71747293878633,2.72158437361444,2.72700672699383,2.73143146695321,2.73662193058728,2.74255386879242,2.74847912565621,2.75486166036281,2.76108741679843,2.76740716652912,2.77281938161961,2.78146634553457,2.78919143813695,2.79537030239242,2.8018198049733,2.81000737272204,2.816280430848,2.82471539156299,2.83367986040498,2.84211298312772,2.85132825760796,2.86018746220032,2.87016882462401,2.87997938070164,2.88943946991531,2.89804253908169,2.9110858685435,2.92335162528936,2.93603541766261,2.94784398937913,2.96328163704208,2.98056223715893,2.99937796371285,3.0182300362712,3.04038284733522,3.06024780786437,3.0852877919825,3.1159742587899,3.15044469079801,3.19153065337011,3.24774185664101,3.3196532347537,3.43871361596793]},"6":{"max":[1.8995844505951,1.90372282728502,1.90786349815282,1.91210039341598,1.91648497862793,1.92091285840255,1.92625368162383,1.93110016008493,1.93617083100785,1.94187011880212,1.9472427855027,1.95211092153476,1.95776813619084,1.96349092943121,1.96961608411167,1.97448554973337,1.98048061846908,1.9857239603702,1.99228524462093,1.99798543677965,2.00481875821914,2.01232512752593,2.01966763484381,2.02771381041308,2.03511516275574,2.04266224216936,2.05212705707684,2.05842768327946,2.06555482615441,2.07404845300542,2.08244751617481,2.09215841827476,2.10175646231178,2.11155420066774,2.12143821941805,2.13384118696042,2.14418189402044,2.15661675767253,2.17327200492716,2.1907977153029,2.20853516508261,2.2243689090344,2.24653424911614,2.26914429720656,2.29470772538911,2.32525489078505,2.35818246901503,2.41186736779604,2.46579678405964,2.57025529149703],"range":[2.7404583562364,2.74526328117409,2.75000903381165,2.75490767733301,2.76002132079635,2.76440130873053,2.76901022857535,2.77309254859561,2.77940949186345,2.78498660911762,2.78984130595265,2.79429396217219,2.79938476001166,2.80552173719103,2.81162363606233,2.81625314022632,2.82239472432692,2.82852361821702,2.83588674056336,2.84236578638002,2.84889368703037,2.85554284587873,2.8623506962233,2.87000837096465,2.87687892185265,2.88476905540689,2.8914629666975,2.89960930083652,2.90985178497341,2.91882734915283,2.92927064293427,2.93850099550798,2.94821658960953,2.95824780664208,2.97187662595487,2.98479878169254,2.9992405304303,3.01354138074149,3.02679737077833,3.04371755117878,3.05823594582161,3.07725324893338,3.10116360405558,3.12653746256097,3.15188312762002,3.18540446077727,3.22402527362553,3.28059758452937,3.33859742296181,3.45501953729566]},"8":{"max":[1.90129850983572,1.90516570855328,1.90937175063387,1.91371639502306,1.91794056113743,1.92232123912668,1.92759911760505,1.9324758882332,1.93770964117028,1.94330305432,1.94888292783326,1.95353915653814,1.95924434085755,1.96487051905954,1.97057577644158,1.97560947773326,1.98147802794651,1.98700655564388,1.9931159110948,1.99891607446647,2.00650282065195,2.0132566361031,2.020550829367,2.02869455951327,2.03595001884676,2.04423035024309,2.05317292848793,2.05914487796479,2.06609364605974,2.07470796502465,2.0828482466276,2.09253295606338,2.10192808009171,2.11163306195199,2.12152134245074,2.13393551264924,2.14420431912788,2.15693361041496,2.17354493026062,2.19114045202173,2.20875377365514,2.22491132803164,2.24671042441639,2.2694870882164,2.29516159555825,2.32552183073452,2.35917428857408,2.41186736779604,2.46579678405964,2.57025529149703],"range":[2.76014777604291,2.76418733961071,2.76815169091552,2.77167598773252,2.77655954928124,2.78146097026088,2.78631355742898,2.79087061339873,2.7953816403936,2.80000445263785,2.80525351999,2.81091249083076,2.81568046806229,2.82118924879503,2.82650893062054,2.83352040487738,2.83862963483524,2.84569765572058,2.85153844900335,2.85708296541044,2.86285717062948,2.87000840600416,2.87641710595494,2.88420384308174,2.89077617284757,2.89783163216231,2.90711675054827,2.91511703592227,2.9241057797022,2.93295016488261,2.94225816715147,2.9503275218798,2.96084636824824,2.97276652793634,2.98545049021879,2.99790011832985,3.01101254640026,3.02291289323542,3.03835944621222,3.05228630855523,3.06848780845776,3.09036229828436,3.11081603217328,3.13386847901325,3.16083304895922,3.19257080115555,3.23394177340134,3.28863254640258,3.34193979691794,3.45989182936763]},"10":{"max":[1.90200317899371,1.90575941243566,1.91003224799722,1.91430116495002,1.91852119221045,1.92363924258536,1.92813013037837,1.93318354531244,1.93819181548142,1.94372394322678,1.94920727427515,1.95410938212938,1.95942574616048,1.9650693159028,1.97097369401268,1.97593043984907,1.9816070498163,1.98735507741592,1.99344303519556,1.99907859690203,2.00698531362174,2.01348511642423,2.02095905934155,2.02936696517065,2.03644766225911,2.04438785665452,2.05338145412747,2.05937675809378,2.06616171881744,2.07473789571604,2.08287027642156,2.09256864345591,2.10195202161131,2.11178013692067,2.12170170901203,2.13419420963212,2.14425304938479,2.15761471934841,2.17377124717081,2.19161080737738,2.20907282819197,2.22538374189696,2.24728555022134,2.26978232260259,2.29570318746438,2.32552183073452,2.35917428857408,2.41186736779604,2.46579678405964,2.57025529149703],"range":[2.76948388986443,2.77299763923263,2.77792434665079,2.7826132597037,2.78701514364425,2.79112022029345,2.79577904040062,2.80033862195106,2.80542656199191,2.8104560921729,2.81495535248919,2.82015982068815,2.82517243302741,2.8308412622816,2.83639345481454,2.84230287019126,2.84840763300983,2.85427720899956,2.86007218626277,2.86587077200269,2.87216039748328,2.87833139479387,2.88563012415683,2.89167193279737,2.89857506455057,2.90758394761588,2.9151394480235,2.92360879398065,2.93180030929704,2.94108080663028,2.9485745083463,2.95787033411792,2.97034997781732,2.98147800797676,2.99390722406367,3.00529013612545,3.01728703629982,3.02976740738852,3.04575081523367,3.0589198398709,3.07750042555093,3.09711099050007,3.11982681558604,3.14470691965829,3.16643520386011,3.20077739874266,3.24091911931553,3.29421724800875,3.34840712645623,3.46016442202563]}},"1":{"2":{"max":[2.22408818231127,2.23167217815961,2.2385556255275,2.246716229298,2.25495483554988,2.26367247535366,2.27198147883231,2.28029374580499,2.28997972044219,2.30139150759728,2.31039779234819,2.3203164913249,2.32921900751217,2.33930632358443,2.35063208445546,2.36239255307403,2.37368186178517,2.38399333407731,2.39655947720336,2.40900289159466,2.42051303184748,2.43187800124754,2.44213404011556,2.45546454151652,2.46823974105248,2.48305431089417,2.50014264198274,2.51277454011338,2.52729044406123,2.54412126382912,2.55992945172055,2.57990545930011,2.59954495128891,2.62226086016471,2.6432818653192,2.66757121215124,2.68912688266154,2.71615273475211,2.74499929176667,2.76956419117839,2.79961591720564,2.84219702965024,2.88262759124401,2.92385031781064,2.97162399662873,3.02945819897377,3.08704227453562,3.17273589041428,3.28942508259488,3.45472681303725],"range":[2.46391278744698,2.47126755950339,2.47789609809196,2.4855994326906,2.49370946814411,2.50169702442543,2.51084263695293,2.51772642451113,2.52686751800841,2.53508560150775,2.54523365481574,2.55414141834483,2.56274334764907,2.57155949666418,2.58116077352148,2.59032031413285,2.59843443819996,2.6083661370334,2.61986928303432,2.63050978195371,2.64203524567493,2.65184061301174,2.66228505736591,2.67463123025473,2.68841958585637,2.70066425268548,2.71215670623997,2.72562580843461,2.74020128419521,2.75495164292628,2.77105091902821,2.78812775936112,2.80696636023678,2.82392759229562,2.8449837855047,2.86469516530926,2.88840979845176,2.91285045595049,2.94147009954316,2.97010148443806,2.99880071116574,3.03252303510393,3.06745846850875,3.09882391191133,3.13698530915409,3.18523070148978,3.25840915105249,3.35961532297044,3.46123155558541,3.61269560042025]},"4":{"max":[2.70443676308234,2.71316397536365,2.72230751827108,2.73013628548337,2.73783443325526,2.74528962424803,2.7535013308307,2.76165479244638,2.76995006883156,2.77784350063502,2.78801292378179,2.79690003525357,2.80782434173153,2.81710131124371,2.82810279142842,2.83902929955712,2.84985602895211,2.85943741078032,2.872062366876,2.88195698007885,2.89422935489322,2.90588801177386,2.91830314114826,2.92889241096725,2.94165001703407,2.95537968710744,2.96828782383848,2.98345815507671,3.00088564120662,3.01450613235098,3.03021741060986,3.04514305197666,3.06318938472853,3.08204384920415,3.10118717953729,3.12137345421518,3.14629361944769,3.16975412064978,3.19871150134074,3.22557804826641,3.2528296362616,3.29448456006627,3.32824508683748,3.36800851346221,3.41346594519685,3.46025134389695,3.51542896077976,3.60624261804716,3.71816408123168,3.93535696186154],"range":[3.33072912856251,3.33758996841233,3.34574628680461,3.35164057527594,3.35975732382747,3.36698550013957,3.37452635531217,3.38044996288511,3.38753470587925,3.39580947144644,3.40358327963137,3.41177944315769,3.42016576209468,3.42949501582605,3.43823862826649,3.44841002477554,3.45809823377464,3.46817355099174,3.47605925839772,3.48805443257122,3.49820780120991,3.50949974665316,3.52156441650787,3.5320470898469,3.54431829330582,3.55624329579949,3.56779426092527,3.58056432859899,3.59261460209264,3.60610681143103,3.61867396175126,3.63386444995373,3.6475807282587,3.66506934920104,3.6854219443556,3.70113871160704,3.72372570022497,3.74548478489592,3.76725865414008,3.790024197161,3.81244484420839,3.84358747147426,3.87478305149955,3.91519863316109,3.95946737524246,4.01368527527697,4.07950269876619,4.16606856488569,4.2831799883297,4.43963845666924]},"6":{"max":[2.73714807589866,2.74320513885208,2.75022696456136,2.75779534589076,2.76609400488216,2.77292540014255,2.78258094839249,2.78995735838407,2.79796564416274,2.80837367523907,2.8162252396466,2.82544776912852,2.83581742506166,2.84607795173187,2.85653311722288,2.86615061088975,2.87507755322594,2.88546120078802,2.89647860951724,2.90646370076569,2.91830366891529,2.92793049243892,2.93994000374386,2.9513361640116,2.96290806233328,2.97653791054636,2.98956874067662,3.00281714459409,3.01767474219581,3.03164032383581,3.04573310198876,3.06270932788493,3.08105683136056,3.09911181554597,3.1186451771978,3.14357440726387,3.16175551098466,3.18896143251092,3.21409553789802,3.23793630392874,3.27400632880909,3.30948160598604,3.33991237704364,3.38231671523284,3.42383820313033,3.47339264373285,3.52934179098599,3.61938625967275,3.73434766642562,3.94102916093653],"range":[3.45640727356551,3.46306954978012,3.46973908754325,3.47590947015454,3.4838819577291,3.49160429317181,3.49766509941435,3.5051606793093,3.5131671363738,3.52077620774917,3.52768748709407,3.53425243724035,3.5423682666881,3.54921943409808,3.556952953408,3.56516503882035,3.57347180354981,3.58252656001226,3.59178947066794,3.60080824803134,3.6085046209279,3.617755939703,3.62735693507751,3.63804587000029,3.64855832140359,3.65994343278081,3.67385398834237,3.68571416063101,3.69707055350515,3.71084408067234,3.72598610436897,3.74136265913746,3.75925526443417,3.77429829895792,3.7898503817031,3.80643968787487,3.82369077242765,3.84520006282845,3.86792575376706,3.89205899556563,3.91924340950534,3.94684568892699,3.97600766790138,4.01553543357259,4.06046965038073,4.11229022121636,4.16550978799998,4.24218778199947,4.34328349142068,4.48746892796138]},"8":{"max":[2.74287924359951,2.74972282830356,2.75749248513154,2.76545067687381,2.77239828238273,2.78065638359198,2.78832963965467,2.79587781452729,2.8046128852303,2.81331080938179,2.82132245132351,2.83191307845068,2.84091691021233,2.85104635740391,2.86061643301292,2.87105813546864,2.87864303912487,2.88982113905153,2.90019387355943,2.91100628450779,2.92088700191003,2.9313669347748,2.94237254586805,2.95513502136229,2.96514551259539,2.97934036146678,2.99268186004286,3.00714447420536,3.02151497458958,3.03325532373884,3.04844221000558,3.06521651133586,3.08396500595724,3.10276276238258,3.12128659480993,3.14504206811941,3.1637257017909,3.1920229659298,3.21667996181354,3.24004966347741,3.27485973776243,3.31063124079675,3.34092246893143,3.38333599579249,3.42496818222524,3.47422654487876,3.5293634919398,3.62048050863877,3.73692000120501,3.94102916093653],"range":[3.50502362427164,3.51174962415423,3.51823129600941,3.52500056785711,3.53096083903982,3.53763539897956,3.54494855968431,3.55144998096019,3.55844801303687,3.56546708937295,3.57154342050093,3.57920520221927,3.5869781137461,3.59518899801846,3.60199425758701,3.60850469838616,3.61537720480582,3.62443760121814,3.63380685797965,3.64032646794286,3.65022038386188,3.660111750305,3.67186260083532,3.6839663778893,3.69196098017429,3.70252522625842,3.71590528460708,3.72948219592524,3.74173472804349,3.75708827810526,3.76983808354856,3.78233840784911,3.79846811098198,3.81277851449084,3.82833777617548,3.84651181684259,3.86474711547053,3.88543617489238,3.905121191569,3.93134651776682,3.95426386467871,3.97912716731566,4.01407639010318,4.05306275796484,4.09560460656332,4.14120219480324,4.19025953380752,4.26303665894324,4.36187000960325,4.51752596826224]},"10":{"max":[2.74592761324742,2.75332577427708,2.76033090809588,2.76795746388208,2.77449341898917,2.78377150533344,2.79040905895933,2.79791269784148,2.80812472032002,2.81585876288918,2.82427033701458,2.8345078182179,2.84343425522273,2.85360428459958,2.86243265700872,2.87265383703287,2.88094199122226,2.89140196762897,2.90133608008974,2.91248740560158,2.92234001556265,2.93310201832971,2.94366180788666,2.95594174585483,2.96689759268915,2.98001396428591,2.99480828166113,3.00867661799182,3.02246324396029,3.03394218534334,3.04928862144923,3.06559847575043,3.085387125668,3.10344121252328,3.12169013198376,3.14546814874483,3.16409611837069,3.19331642253382,3.21712193181301,3.24079319998886,3.27693245691716,3.31144207023956,3.34121663787019,3.38431258247793,3.42513870373182,3.47422654487876,3.5293634919398,3.62095881900556,3.73697935597481,3.94102916093653],"range":[3.53381534472487,3.53986469765005,3.54625771772862,3.55264927591488,3.55885056988873,3.56535310539566,3.57069206044516,3.57741821964149,3.58464718016958,3.5925337751768,3.59906345718385,3.60516901034419,3.61189624837151,3.61829137565987,3.62622821191613,3.63382432755621,3.6399216842664,3.64855929411662,3.65706270350488,3.66715043519786,3.67929490093814,3.68762130549175,3.69607530343335,3.70493839788555,3.71711166453008,3.72983287425351,3.7410973195177,3.75490086509486,3.76745283302738,3.77976388577323,3.79281288014532,3.80651205695025,3.81888938666319,3.83372594382547,3.84988819397064,3.86628743484644,3.8840090856432,3.90305033008578,3.92661109582333,3.94850885290388,3.97247127632687,4.00142980951883,4.03492508707269,4.07271715630041,4.11203940618518,4.15440590037256,4.20860501525314,4.28230990061588,4.38417511435477,4.53444344398332]}},"sig_levels":["0.95","0.951","0.952","0.953","0.954","0.955","0.956","0.957","0.958","0.959","0.96","0.961","0.962","0.963","0.964","0.965","0.966","0.967","0.968","0.969","0.97","0.971","0.972","0.973","0.974","0.975","0.976","0.977","0.978","0.979","0.98","0.981","0.982","0.983","0.984","0.985","0.986","0.987","0.988","0.989","0.99","0.991","0.992","0.993","0.994","0.995","0.996","0.997","0.998","0.999"]} diff --git a/nrt/data/sentinel2_cube_subset_romania_10m.nc b/nrt/data/sentinel2_cube_subset_romania_10m.nc deleted file mode 100644 index 01bc460..0000000 --- a/nrt/data/sentinel2_cube_subset_romania_10m.nc +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:10165376979ed20f988bef09bf79135ea415e741256ba50fd4fef679b1c1fa9d -size 14017443 diff --git a/nrt/data/sentinel2_cube_subset_romania_20m.nc b/nrt/data/sentinel2_cube_subset_romania_20m.nc deleted file mode 100644 index c65920d..0000000 --- a/nrt/data/sentinel2_cube_subset_romania_20m.nc +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e22c3545dea25c93b31dea017fb70ba18578c1a6c954bf1040e58218b9fa28ca -size 3515395 diff --git a/nrt/data/sentinel2_subset.nc b/nrt/data/sentinel2_subset.nc deleted file mode 100644 index 7276bb5..0000000 --- a/nrt/data/sentinel2_subset.nc +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:71e976b88e6029a897b0bf300e1d203af2a4b4412550081fdc6bff77551592a6 -size 161395 diff --git a/nrt/data/tree_cover_density_2018_romania.tif b/nrt/data/tree_cover_density_2018_romania.tif deleted file mode 100644 index 9f709d3..0000000 --- a/nrt/data/tree_cover_density_2018_romania.tif +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9e3798baaa7f52e6b9b27bf7f0a81b321a45afa3c83f04dded8a608199f86201 -size 3276 diff --git a/nrt/monitor/__init__.py b/nrt/monitor/__init__.py index a48db82..c906558 100644 --- a/nrt/monitor/__init__.py +++ b/nrt/monitor/__init__.py @@ -13,6 +13,8 @@ # See the Licence for the specific language governing permissions and # limitations under the Licence. +__path__ = __import__('pkgutil').extend_path(__path__, __name__) + import abc import warnings import datetime diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..93e57e2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,52 @@ +[build-system] +requires = ["setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "nrt" +version = "0.3.0" +description = "Online monitoring with xarray" +readme = "README.rst" +keywords = ["sentinel2", "xarray", "datacube", "monitoring", "change"] +authors = [ + { name = "Loic Dutrieux", email = "loic.dutrieux@ec.europa.eu" }, + { name = "Jonas Viehweger" }, + { name = "Chris Holden" } +] +license = {file = "LICENSE"} +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12" +] +requires-python = ">=3.9" +dependencies = [ + "numpy", + "scipy", + "xarray", + "rasterio", + "netCDF4", + "numba!=0.59.*", + "pandas", + "affine", + "nrt-data" +] + +[project.urls] +"Homepage" = "https://github.com/ec-jrc/nrt.git" + +[project.optional-dependencies] +tests = ["pytest"] +docs = [ + "sphinx==7.4.7", + "dask", + "sphinx_rtd_theme==2.0.0", + "matplotlib==3.9.1", + "sphinx-gallery==0.17.0" +] + +[tool.setuptools.packages.find] +where = ["."] + diff --git a/setup.py b/setup.py deleted file mode 100644 index 65f8d94..0000000 --- a/setup.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import codecs -from setuptools import setup, find_packages -import os - -# Parse the version from the main __init__.py -with open('nrt/__init__.py') as f: - for line in f: - if line.find("__version__") >= 0: - version = line.split("=")[1].strip() - version = version.strip('"') - version = version.strip("'") - continue - - -with codecs.open('README.rst', encoding='utf-8') as f: - readme = f.read() - -extra_reqs = {'tests': ['pytest'], - 'docs': ['sphinx==7.4.7', - 'dask', - 'sphinx_rtd_theme==2.0.0', - 'matplotlib==3.9.1', - 'sphinx-gallery==0.17.0']} - -setup(name='nrt', - version=version, - description=u"Online monitoring with xarray", - long_description_content_type="text/x-rst", - long_description=readme, - keywords='sentinel2, xarray, datacube, monitoring, change', - author=u"Loic Dutrieux, Jonas Viehweger, Chris Holden", - author_email='loic.dutrieux@ec.europa.eu', - url='https://github.com/ec-jrc/nrt.git', - license='EUPL-v1.2', - classifiers=[ - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - ], - packages=find_packages(), - package_data={'nrt': ['data/*.nc', 'data/*.tif', 'data/*.json']}, - install_requires=[ - 'numpy', - 'scipy', - 'xarray', - 'rasterio', - 'netCDF4', - 'numba!=0.59.*', - 'pandas', - 'affine' - ], - python_requires=">=3.9", - extras_require=extra_reqs) -