Explore low levels of luminance.

communication
junos 2021-07-23 18:28:02 +02:00
parent 67e2d233b0
commit dbb59c4aef
1 changed files with 32 additions and 1 deletions

View File

@ -6,7 +6,7 @@
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.2
# jupytext_version: 1.11.4
# kernelspec:
# display_name: straw2analysis
# language: python
@ -14,10 +14,13 @@
# ---
# %%
# %matplotlib inline
import datetime
import os
import sys
import seaborn as sns
from pytz import timezone
from tabulate import tabulate
nb_dir = os.path.split(os.getcwd())[0]
@ -26,9 +29,14 @@ if nb_dir not in sys.path:
import participants.query_db
TZ_LJ = timezone("Europe/Ljubljana")
# %%
from features.light import *
# %% [markdown]
# # Basic characteristics
# %%
df_light_nokia = get_light_data(["nokia_0000003"])
print(df_light_nokia)
@ -40,6 +48,17 @@ df_light_inactive = get_light_data(participants_inactive_usernames)
# %%
df_light_inactive.accuracy.value_counts()
# %% [markdown]
# From [SensorManager](https://developer.android.com/reference/android/hardware/SensorManager.html#SENSOR_STATUS_ACCURACY_HIGH):
#
# ```java
# public static final int SENSOR_STATUS_ACCURACY_HIGH
# ```
#
# This sensor is reporting data with maximum accuracy
#
# Constant Value: 3 (0x00000003)
# %%
df_light_inactive.double_light_lux.describe()
@ -71,3 +90,15 @@ df_light_low = df_light_inactive[df_light_inactive["double_light_lux"] <= 10]
sns.displot(data=df_light_low, x="double_light_lux", binwidth=0.5, height=8)
# %%
df_light_very_low = df_light_low[df_light_low["double_light_lux"] < 0.5]
df_light_very_low.double_light_lux.value_counts()
# %%
df_light_nokia["datetime_lj"] = df_light_nokia["timestamp"].apply(
lambda x: datetime.datetime.fromtimestamp(x / 1000.0, tz=TZ_LJ)
)
df_light_nokia.loc[df_light_nokia["double_light_lux"] == 0, ["datetime_lj"]]
# %% [markdown]
# Zeroes are present during the day. It does happens when the sensor is physically blocked.