apmtools 0.2.36__tar.gz → 0.2.37__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {apmtools-0.2.36 → apmtools-0.2.37}/PKG-INFO +1 -1
- {apmtools-0.2.36 → apmtools-0.2.37}/pyproject.toml +1 -1
- {apmtools-0.2.36 → apmtools-0.2.37}/src/apmtools/data_processing.py +9 -2
- {apmtools-0.2.36 → apmtools-0.2.37}/.gitignore +0 -0
- {apmtools-0.2.36 → apmtools-0.2.37}/LICENSE +0 -0
- {apmtools-0.2.36 → apmtools-0.2.37}/README.md +0 -0
- {apmtools-0.2.36 → apmtools-0.2.37}/src/apmtools/__init__.py +0 -0
- {apmtools-0.2.36 → apmtools-0.2.37}/src/apmtools/classes.py +0 -0
- {apmtools-0.2.36 → apmtools-0.2.37}/src/apmtools/functions.py +0 -0
- {apmtools-0.2.36 → apmtools-0.2.37}/src/apmtools/legacy.py +0 -0
- {apmtools-0.2.36 → apmtools-0.2.37}/src/apmtools/shiny/__init__.py +0 -0
- {apmtools-0.2.36 → apmtools-0.2.37}/src/apmtools/shiny/summary.py +0 -0
- {apmtools-0.2.36 → apmtools-0.2.37}/src/apmtools/units.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: apmtools
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.37
|
|
4
4
|
Summary: A collection of tools for processing air pollution monitoring data
|
|
5
5
|
Project-URL: Homepage, https://github.com/federlorenz/apmtools
|
|
6
6
|
Author-email: Federico Lorenzetti <lorenzetti.federico@gmail.com>
|
|
@@ -308,6 +308,14 @@ def to_datetime(x):
|
|
|
308
308
|
':')[0]), int(x.split('T')[1].split(':')[1]), int(x.split('T')[1].split(':')[2][:-1])
|
|
309
309
|
return dt.datetime(year, month, day, hour, minute, second)
|
|
310
310
|
|
|
311
|
+
|
|
312
|
+
def to_datetime_lcm(x):
|
|
313
|
+
year, month, day = int(x.split('T')[0].split(
|
|
314
|
+
'-')[0]), int(x.split('T')[0].split('-')[1]), int(x.split('T')[0].split('-')[2])
|
|
315
|
+
hour, minute, second = int(x.split('T')[1].split(
|
|
316
|
+
':')[0]), int(x.split('T')[1].split(':')[1]), int(x.split('T')[1].split(':')[2].split(".")[0])
|
|
317
|
+
return dt.datetime(year, month, day, hour, minute, second)
|
|
318
|
+
|
|
311
319
|
def to_datetime_polar(x):
|
|
312
320
|
year, month, day = int(x.split('T')[0].split(
|
|
313
321
|
'-')[0]), int(x.split('T')[0].split('-')[1]), int(x.split('T')[0].split('-')[2])
|
|
@@ -844,9 +852,8 @@ def lascar_processing(directory, file, interpolation=1,interval="30 seconds", in
|
|
|
844
852
|
|
|
845
853
|
def lcm_processing(directory, file, interpolation=1, interval="300 seconds", interpolate_data=True, timezone_shift=dt.timedelta(hours=0)):
|
|
846
854
|
numeric = ["PM2.5", "PM10", "CO2", "NO2", "Temperature", "Humidity"]
|
|
847
|
-
dtformat = '%Y-%m-%dT%H:%M:%S'
|
|
848
855
|
df = pd.read_csv(directory+file)
|
|
849
|
-
df['timestamp'] = df['timestamp'].map(
|
|
856
|
+
df['timestamp'] = df['timestamp'].map(to_datetime_lcm)
|
|
850
857
|
df.set_index('timestamp', inplace=True)
|
|
851
858
|
if interpolate_data:
|
|
852
859
|
df = interpolate(df, 300, interpolation, pd.Timedelta(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|