# rowingdata package

## Submodules

## rowingdata.copystats module

`rowingdata.copystats.``main`()

## rowingdata.crewnerdplot module

`rowingdata.crewnerdplot.``main`()

## rowingdata.crewnerdplottime module

`rowingdata.crewnerdplottime.``main`()

## rowingdata.painsled_desktop_plot module

`rowingdata.painsled_desktop_plot.``main`()

## rowingdata.painsled_desktop_toc2 module

`rowingdata.painsled_desktop_toc2.``main`()

## rowingdata.painsledplot module

`rowingdata.painsledplot.``main`()

## rowingdata.painsledplottime module

`rowingdata.painsledplottime.``main`()

## rowingdata.painsledtoc2 module

`rowingdata.painsledtoc2.``main`()

## rowingdata.roweredit module

`rowingdata.roweredit.``main`()

## rowingdata.rowingdata module

class `rowingdata.rowingdata.``ErgDataParser`(ed_file='ed_test.csv', row_date=datetime.datetime(2016, 9, 1, 6, 34, 44, 998000))

  Parser for reading CSV files created by ErgData/Concept2 logbook

  Use: data = rowingdata.ErgDataParser(“ergdata.csv”)

  > data.write_csv(“speedcoach_data_out.csv”)

  `write_csv`(writeFile='example.csv')

    Exports data to the CSV format that I use in rowingdata

class `rowingdata.rowingdata.``ErgStickParser`(ed_file='ed_test.csv', row_date=datetime.datetime(2016, 9, 1, 6, 34, 44, 998000))

  Parser for reading CSV files created by ErgStick

  Use: data = rowingdata.ErgStickParser(“ergdata.csv”)

  > data.write_csv(“speedcoach_data_out.csv”)

  `write_csv`(writeFile='example.csv')

    Exports data to the CSV format that I use in rowingdata

class `rowingdata.rowingdata.``FITParser`(readFile)
  `write_csv`(writeFile='fit_o.csv')

class `rowingdata.rowingdata.``RowProParser`(RPfile='RPtest.csv', skiprows=14, row_date=datetime.datetime(2016, 9, 1, 6, 34, 44, 998000))

  Parser for reading CSV files created by RowPro

  Use: data = rowingdata.RowProParser(“RPdata.csv”)

  > data.write_csv(“RPdata_out.csv”)

  `write_csv`(writeFile='example.csv')

    Exports RowPro data to the CSV format that I use in rowingdata

class `rowingdata.rowingdata.``SpeedCoach2Parser`(NKfile='Speedcoach2example.csv', row_date=datetime.datetime(2016, 9, 1, 6, 34, 44, 998000))

  Parser for reading CSV files created by SpeedCoach GPS 2

  Use: data = rowingdata.SpeedCoach2Parser(“NKGPS2data.csv”)

  > data.write_csv(“NKGPS2data_out.csv”)

  `write_csv`(writeFile='example.csv')

    Exports RowPro data to the CSV format that I use in rowingdata

class `rowingdata.rowingdata.``TCXParser`(tcx_file)

  Parser for reading TCX files, e.g. from CrewNerd

  Use: data = rowingdata.TCXParser(“crewnerd_data.tcx”)

  > data.write_csv(“crewnerd_data_out.csv”)

  `write_csv`(writeFile='example.csv', window_size=5)

    Exports TCX data to the CSV format that I use in rowingdata

  `write_nogeo_csv`(writeFile='example.csv', window_size=5)

    Exports TCX data without position data (indoor) to the CSV format that I use in rowingdata

class `rowingdata.rowingdata.``TCXParserNoHR`(tcx_file)

  Parser for reading TCX files, e.g. from CrewNerd

  Use: data = rowingdata.TCXParser(“crewnerd_data.tcx”)

  > data.write_csv(“crewnerd_data_out.csv”)

  `write_csv`(writeFile='example.csv', window_size=5)

    Exports TCX data to the CSV format that I use in rowingdata

  `write_nogeo_csv`(writeFile='example.csv', window_size=5)

    Exports TCX data without position data (indoor) to the CSV format that I use in rowingdata

class `rowingdata.rowingdata.``TCXParserTester`(tcx_file)
  `getarray`(str1, str2='')

`rowingdata.rowingdata.``boatedit`(fileName='my1x.txt')

  Easy editing or creation of a boat rigging data file. Mainly for using from the windows command line

`rowingdata.rowingdata.``copytocb`(s)

  Copy to clipboard for pasting into blog

  Doesn’t work on Mac OS X

`rowingdata.rowingdata.``cumcpdata`(rows)

`rowingdata.rowingdata.``dorowall`(readFile='testdata', window_size=20)

  Used if you have CrewNerd TCX and summary CSV with the same file name

  Creates all the plots and spits out a text summary (and copies it to the clipboard too!)

`rowingdata.rowingdata.``ewmovingaverage`(interval, window_size)

class `rowingdata.rowingdata.``fitsummarydata`(readFile)
  `setsummary`(separator='|')

`rowingdata.rowingdata.``format_dist_tick`(x, pos=None)

`rowingdata.rowingdata.``format_pace`(x, pos=None)

`rowingdata.rowingdata.``format_pace_tick`(x, pos=None)

`rowingdata.rowingdata.``format_time`(x, pos=None)

`rowingdata.rowingdata.``format_time_tick`(x, pos=None)

`rowingdata.rowingdata.``geo_distance`(lat1, lon1, lat2, lon2)

  Approximate distance and bearing between two points defined by lat1,lon1 and lat2,lon2 This is a slight underestimate but is close enough for our purposes, We’re never moving more than 10 meters between trackpoints

  Bearing calculation fails if one of the points is a pole.

`rowingdata.rowingdata.``get_file_line`(linenr, f)

`rowingdata.rowingdata.``get_file_type`(f)

`rowingdata.rowingdata.``getrigging`(fileName='my1x.txt')

  Read a rigging object

`rowingdata.rowingdata.``getrower`(fileName='defaultrower.txt', mc=70.0)

  Read a rower object

`rowingdata.rowingdata.``getrowtype`()

`rowingdata.rowingdata.``interval_string`(nr, totaldist, totaltime, avgpace, avgspm, avghr, maxhr, avgdps, separator='|')

  Used to create a nifty text string with the data for the interval

`rowingdata.rowingdata.``main`()

`rowingdata.rowingdata.``make_cumvalues`(xvalues)

  Takes a Pandas dataframe with one column as input value. Tries to create a cumulative series.

`rowingdata.rowingdata.``make_cumvalues_array`(xvalues)

  Takes a Pandas dataframe with one column as input value. Tries to create a cumulative series.

`rowingdata.rowingdata.``movingaverage`(interval, window_size)

class `rowingdata.rowingdata.``painsledDesktopParser`(sled_file='sled_test.csv')

  Parser for reading CSV files created by Painsled (desktop version)

  Use: data = rowingdata.painsledDesktopParser(“sled_data.csv”)

  > data.write_csv(“sled_data_out.csv”)

  `time_values`()

    Converts painsled style time stamps to Unix time stamps

  `write_csv`(writeFile='example.csv')

    Exports Painsled (desktop) data to the CSV format that I use in rowingdata

`rowingdata.rowingdata.``phys_getpower`(velo, rower, rigging, bearing, vwind, winddirection, vstream=0)

`rowingdata.rowingdata.``read_obj`(filename)

  Read an object (e.g. your rower, including passwords) from a file Usage: john = rowingdata.read_obj(“john.txt”)

class `rowingdata.rowingdata.``rower`(hrut2=142, hrut1=146, hrat=160, hrtr=167, hran=180, hrmax=192, c2username='', c2password='', weightcategory='hwt', mc=72.5, strokelength=1.35)

  This class contains all the personal data about the rower

  - HR threshold values
  - C2 logbook username and password
  - weight category
  `write`(fileName)

`rowingdata.rowingdata.``roweredit`(fileName='defaultrower.txt')

  Easy editing or creation of a rower file. Mainly for using from the windows command line

class `rowingdata.rowingdata.``rowingdata`(readFile, rower=<rowingdata.rowingdata.rower instance>, rowtype='Indoor Rower')

  This is the main class. Read the data from the csv file and do all kinds of cool stuff with it.

  Usage: row = rowingdata.rowingdata(“testdata.csv”,rowtype = “Indoor Rower”)
    row.plotmeters_all()

  The default rower looks for a defaultrower.txt file. If it is not found, it reverts to some arbitrary rower.

  `add_bearing`(window_size=20)

    Adds bearing. Only works if long and lat values are known

  `add_stream`(vstream, units='m')
  `add_wind`(vwind, winddirection, units='m')
  `allstats`(separator='|')

    Creates a nice text summary, both overall summary and a one line per interval summary

    Works for painsled (both iOS and desktop)

    Also copies the string to the clipboard (handy!)

  `bokehpaceplot`()
  `erg_recalculatepower`()
  `exporttotcx`(fileName)
  `get_metersplot_erg`(title)
  `get_metersplot_erg2`(title)
  `get_metersplot_otw`(title)
  `get_pacehrplot`(title)
  `get_paceplot`(title)
  `get_piechart`(title)

    Figure 3 - Heart Rate Time in band. This is not as simple as just totalling up the hits for each band of HR. Since each data point represents a different increment of time. This loop scans through the HR data and adds that incremental time in each band

  `get_time_otwpower`()
  `get_timeplot_erg`(title)
  `get_timeplot_erg2`(title)
  `get_timeplot_otw`(title)
  `getcp`()
  `getvalues`(keystring)

    Just a tool to get a column of the row data as a numpy array

    You can also just access row.df[keystring] to get a pandas Series

  `intervalstats`(separator='|')

    Used to create a nifty text summary, one row for each interval

    Also copies the string to the clipboard (handy!)

    Works for painsled (both iOS and desktop version) because they use the lapIdx column

  `otw_setpower`(skiprows=0, rg=<rowingphysics.rigging.rigging instance>, mc=70.0)

    Adds power from rowing physics calculations to OTW result

    For now, works only in singles

  `otw_setpower_silent`(skiprows=0, rg=<rowingphysics.rigging.rigging instance at 0x088983C8>, mc=70.0)

    Adds power from rowing physics calculations to OTW result

    For now, works only in singles

  `otw_setpower_verbose`(skiprows=0, rg=<rowingphysics.rigging.rigging instance at 0x088987B0>, mc=70.0)

    Adds power from rowing physics calculations to OTW result

    For now, works only in singles

  `otw_testphysics`(rg=<rowingphysics.rigging.rigging instance at 0x088985D0>, mc=70.0, p=120.0, spm=30.0)

    Check if erg pace is in right order

    For now, works only in singles

  `piechart`()

    Figure 3 - Heart Rate Time in band. This is not as simple as just totalling up the hits for each band of HR. Since each data point represents a different increment of time. This loop scans through the HR data and adds that incremental time in each band

  `plotcp`()
  `plotmeters_erg`()

    Creates two images containing interesting plots

    x-axis is distance

    Used with painsled (erg) data

  `plotmeters_otw`()

    Creates two images containing interesting plots

    x-axis is distance

    Used with OTW data (no Power plot)

  `plototwergpower`()
  `plottime_erg`()

    Creates two images containing interesting plots

    x-axis is time

    Used with painsled (erg) data

  `plottime_hr`()

    Creates a HR vs time plot

  `plottime_otw`()

    Creates two images containing interesting plots

    x-axis is time

    Used with OTW data (no Power plot)

  `plottime_otwpower`()

    Creates two images containing interesting plots

    x-axis is time

    Used with painsled (erg) data

  `spm_fromtimestamps`()
  `summary`(separator='|')

    Creates a nifty text string that contains the key data for the row and copies it to the clipboard

  `update_stream`(stream1, stream2, dist1, dist2, units='m')
  `update_wind`(vwind1, vwind2, winddirection1, winddirection2, dist1, dist2, units='m')
  `uploadtoc2`(comment='uploaded by rowingdata tool\n', rowerFile='defaultrower.txt')

    Upload your row to the Concept2 logbook

    Will ask for username and password if not known Will offer to store username and password locally for you. This is not mandatory

    This just fills the online logbook form. It may break if Concept2 changes their website. I am waiting for a Concept2 Logbook API

  `write_csv`(writeFile)

`rowingdata.rowingdata.``skip_variable_footer`(f)

`rowingdata.rowingdata.``skip_variable_header`(f)

class `rowingdata.rowingdata.``speedcoachParser`(sc_file='sc_test.csv', row_date=datetime.datetime(2016, 9, 1, 6, 34, 44, 998000))

  Parser for reading CSV files created by SpeedCoach

  Use: data = rowingdata.speedcoachParser(“speedcoachdata.csv”)

  > data.write_csv(“speedcoach_data_out.csv”)

  `write_csv`(writeFile='example.csv')

    Exports SpeedCoach CSV data to the CSV format that I use in rowingdata

`rowingdata.rowingdata.``spm_toarray`(l)

class `rowingdata.rowingdata.``summarydata`(readFile)

  This is used to create nice summary texts from CrewNerd’s summary CSV

  Usage: sumd = rowingdata.summarydata(“crewnerdsummary.CSV”)

  > sumd.allstats()

  > sumd.shortstats()

  `allstats`(separator='|')
  `shortstats`()

`rowingdata.rowingdata.``summarystring`(totaldist, totaltime, avgpace, avgspm, avghr, maxhr, avgdps, readFile='', separator='|')

  Used to create a nifty string summarizing your entire row

`rowingdata.rowingdata.``tailwind`(bearing, vwind, winddir, vstream=0)

  Calculates head-on head/tailwind in direction of rowing

  positive numbers are tail wind

`rowingdata.rowingdata.``totimestamp`(dt, epoch=datetime.datetime(1970, 1, 1, 0, 0))

`rowingdata.rowingdata.``write_obj`(obj, filename)

  Save an object (e.g. your rower) to a file

`rowingdata.rowingdata.``y_axis_range`(ydata, miny=0, padding=0.1, ultimate=[-1000000000.0, 1000000000.0])

## rowingdata.speedcoachplot module

`rowingdata.speedcoachplot.``main`()

## rowingdata.speedcoachplottime module

`rowingdata.speedcoachplottime.``main`()

## rowingdata.speedcoachtoc2 module

`rowingdata.speedcoachtoc2.``main`()

## rowingdata.tcxplot module

`rowingdata.tcxplot.``main`()

## rowingdata.tcxplot_nogeo module

`rowingdata.tcxplot_nogeo.``main`()

## rowingdata.tcxplottime module

`rowingdata.tcxplottime.``main`()

## rowingdata.tcxplottime_nogeo module

`rowingdata.tcxplottime_nogeo.``main`()

## rowingdata.tcxtoc2 module

`rowingdata.tcxtoc2.``main`()

## Module contents