<jupyter_start><jupyter_text>Introduction The timeseries module provides the TimeSeries class which deals with all 1D timeseries (sizedistribution timeseries are considered 2D timeseries and are delt with in a different place). Usually when reading in any type of data, that is in some way a time series it will end up beeing a TimeSeries instance. Data in a TimeSeries is stored at TimeSeries.data in form of a pandas DataFrame instance.  Imports<jupyter_code>from atmPy.instruments.POPS import housekeeping
from atmPy.instruments.piccolo import piccolo
%matplotlib inline<jupyter_output><empty_output><jupyter_text>Some usefull features of the TimeSeries class  Read (generate) TimeSeries Usually a TimeSeries is generated when data representing a timeseries is loaded, e.g. POPS housekeeping data, or piccolo telemetry data.<jupyter_code>pops_hk = housekeeping.read_csv('./data/POPS_housekeeping.csv')
picco_tel = piccolo.read_csv('./data/piccolo.log')<jupyter_output>reading ./data/POPS_housekeeping.csv<jupyter_text>merge TimeSeries instances with different time axes This attribute of a TimeSeries class allows the projection of a different instance on the current one. The resulting instance will have the collumns of both instances but with the time axes according to the first instance.<jupyter_code>pops_hk_merged = pops_hk.merge(picco_tel)
# pops_hk_merged.data<jupyter_output><empty_output><jupyter_text>After merging it is possible to plot for example the Particle rate as a function of altitude. Columns which where previously in different Timeseries with different time intervals and time values.<jupyter_code>f,ax = plt.subplots()
ax.plot(pops_hk_merged.data.Particle_rate_nops, pops_hk_merged.data.Altitude)
ax.set_ylabel('Altitude (m)')
ax.set_xlabel('Particle rate (#/s)')<jupyter_output><empty_output><jupyter_text>Plot on map When a TimeSeries instance has data columns named 'Lat' and 'Lon' it is possible to do a quick drowing of e.g. fligh path on a map. This uses matplotlib basemap.<jupyter_code>pops_hk_merged.plot_map(resolution = 'f')<jupyter_output>/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/mpl_toolkits/basemap/__init__.py:1624: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
  elif fill_color == 'none' or fill_color == 'None':
{'fraction_non_alphanumeric': 0.06963087248322147, 'fraction_numerical': 0.0041946308724832215, 'mean_word_length': 6.406832298136646, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '349717', 'license': 'MIT', 'n_tokens_mistral': 733, 'n_tokens_neox': 703, 'n_words': 247, 'path': 'examples/timeseries.ipynb', 'repo_name': 'msrconsulting/atm-py', 'size': '2384'}