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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: apmtools
3
- Version: 0.2.36
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>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "apmtools"
7
- version = "0.2.36"
7
+ version = "0.2.37"
8
8
  authors = [
9
9
  { name="Federico Lorenzetti", email="lorenzetti.federico@gmail.com" },
10
10
  ]
@@ -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(to_datetime)
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