Main module

exception NX2.NX2.NX2InterpolationWarning(column, maxgap=inf)

Warning class for interpolation of data columns.

exception NX2.NX2.NX2RowingWarning

Warning class for warning related to the matching of rowing data files.

class NX2.NX2.NX2Table(*args, **kwargs)

Basic catalog object.

add_rowing_old_format(filename, verbose=True)

add rowing and sailing data

Input:filename for cvs file in format as used in 2008
datetime()

Return an np.array of datetime.datetime object for each data point

Useful for plotting, so matplotlib can label the x-axis correctly.

fit_BSP_corr()

fit a linear correlation between BSP and SOG

Only points which fullfill the following criteria are used:

  • BSP > 0
  • np.abs(COG-HDC) < 15
  • small gradients in speed
Returns:
  • myoutput (scipy.odr.odrpack.Output object) – contains the fit results
  • con (boolean array) – index array of points usef for fitting
minutes_index()

return an index array to acess exactly one field per minute.

Unfortunately, the NX2 time intervals are not exactly separated by 1s, some values are double or missing. This functions return an index array of those entries where the minute changes, i.e. the first entry within each minute.

plot_course(scale=50, n=300)

Return an x/y overview plot of boat path, wind and speeds

plot_polar(fct=<function median>, speedbins=array([ 0., 2., 4., 6., 8., 10., 12.]), anglebins=array([ 0. , 15.001, 30.002, 45.003, 60.004, 75.005, 90.006, 105.007, 120.008, 135.009, 150.01 , 165.011, 180.012]), color=['r', 'g', 'b', 'y', 'k', 'c', 'orange'])

Return a polar plot

plot_speeds(t1=(0, 0, 0), t2=(23, 59, 59))

Return a figure that shows BSP, SOG and rowing (if posible)

time()

Return an np.array of datetime.time object for each data point

Useful for plotting, so matplotlib can label the x-axis correctly.

when(t1=(0, 0, 0), t2=(23, 59, 59))

Select a subset of the table

Parameters:t2 (t1,) – Start and end time in the form (h, m, s)
write_geojson(filename)

write geojson file from a NX2 object

Parameters:filename (string) – file name or path for output
write_kml(filename, verbose=True)

write a kml file from an NX2 object

Parameters:filename (string) – file name or path for output
NX2.NX2.read_NX2(self, filename, date, corr_bsp=1.0, origin=None, timeoffset=2, verbose=True)

read in csv data and initialize table

Parameters:
  • filename (string) – filename as string or other input compatible with asciitable
  • date (tuple of integers (day, month, year)) – date of measurement
  • corr_bsp (float) – multiplictive correction factor for BSP
  • origin (tuple) – (lat, lon) in deg of x,y origin default: lat, lon at first datapoint
  • timeoffset (float) – hours to be added to convert UT to local
NX2.NX2.remove_Danube_current(data)

read Danube current simulation and transform data basis system

This procedure read a current simulation of the Danube current in the region north of Regensburg, where the Navis Lusoria was tested in 2006. It adds 2 columns to the NX2 table, that contain the current in the x,y coordinate system (measured west-> east and south-> north) at each position of the ship. Then, the speed over ground (contained in SOG and COG) is transformed into a coordinate system that moves with the water. Thus, after this procedure, the SOG is not longer the “speed over ground”, but instead the “speed over flowing river” and the COG is the “course over flowing river”! Similarly, the TWS and the TWA are transformed ino the same coortinate system of the flowing river.

The purpose of this is to correct SOG, COG, TWS and TWA in such a way that the usual procedures for plotting the polar diagram and the drift are applicable.

Parameters:data (NX2Table) – The dataset to be modified
NX2.NX2.write_leg(data, kmlFile, ind, name='', style='#yellowLine', skip=1)

write one leg of the journel to a kml file.

This does not write complete kml files, neither does it open the file!

Parameters:
  • data (NX2 instance) – LAT and LON are taken from this instance.
  • kmlFile (file handle) – file to write data
  • ind (index array) – indexed values are written in this leg
  • name (string , optional) – Name of this leg in kml file
  • style (string , optional) – name of a line stype defined in the kml header
  • skip (ind) – Skips skip values befroe a new position is written. Use for coarser, but smaller files.