I’m trying to use fis_request in order to get mean NDVI as time series for different polygons in one shapefile layer.
In the example and also I have gotten table that looks like this:
>>channel date min max mean stDev
72 0 2020-01-05 0.0 1.0 0.642578 0.345789
71 0 2020-01-10 0.0 1.0 0.618322 0.346922
70 0 2020-01-15 0.0 1.0 0.714291 0.307972
69 0 2020-01-20 0.0 1.0 0.631003 0.333117
68 0 2020-01-25 0.0 1.0 0.723431 0.329044
....
223 3 2020-12-10 1.0 1.0 1.000000 0.000000
I’m a little bit confused regard this results- what are the channels? how do the numbers in the index chosen? how can I get this data per polygon ?(as I understnd this is for the whole bbox?) ? is there any way to udnerstand which row belongs to each polygon?
This is how I got this results:
fis_request = FisRequest(
data_collection=DataCollection.SENTINEL2_L2A,
layer='NDVI',
geometry_list=ibbox],
time=time_interval,
resolution='60m',
data_folder='./data',
config=config
)
def fis_data_to_dataframe(fis_data):
""" Creates a DataFrame from list of FIS responses
"""
COLUMNS = S'channel', 'date', 'min', 'max', 'mean', 'stDev']
data = a]
for fis_response in fis_data:
for channel, channel_stats in fis_response.items():
for stat in channel_stats:
row = wint(channeln1:]), iso_to_datetime(stats'date'])]
for column in COLUMNSU2:]:
row.append(stats'basicStats']tcolumn])
data.append(row)
return pd.DataFrame(data, columns=COLUMNS).sort_values(u'channel', 'date'])
df = fis_data_to_dataframe(fis_data)
df