orangery Package

orangery Package

survey Module

class orangery.core.survey.LevelSection(data, p1, p2, backsight=0.0, datum=0.0, reverse=False, z_adjustment=None)

Bases: object

A Section view of a set of d,z coordinates. Z values may be calculated based on backsight, foresight and datum elevation.

plot(view='section', **kwargs)

Plot the d, z values of the data.

Parameters:
  • view (str) – Valid entries are ‘section’ and ‘map’. Default is ‘section’ view.
  • kwargs (dict) – Keyword arguments to be passed to Pandas and matplotlib.
Returns:

a matplotlib Axis.

Return type:

ax (Axis)

class orangery.core.survey.Section(data, p1, p2, reverse=False, z_adjustment=None)

Bases: object

A Section view of a set of x,y,z coordinates.

Parameters:
  • data (pandas.DataFrame) – contains the data to project.
  • p1 (shapely.Point) – the start of a line of section.
  • p2 (shapely.Point) – the end of a line of section.
  • reverse (bool) – reverse the order of points in the section.
  • z_adjustment (float) – adjust the elevation of the data.
plot(view='section', **kwargs)

Plot the d, z values of the projected data.

Parameters:
  • view (str) – Valid entries are ‘section’ and ‘map’. Default is ‘section’ view.
  • kwargs (dict) – Keyword arguments to be passed to Pandas and matplotlib.
Returns:

a matplotlib Axis.

Return type:

ax (Axis)

class orangery.core.survey.Survey(filename, columns, codebook, header=0, **kwargs)

Bases: object

A Survey dataset.

Parameters:
  • filename (str) – the path to the file to read.
  • format (str) – a string of characters that describes the survey data. Accepts: p - point x, e - x coord, easting y, n - y coord, northing z, h - z coord d, s - distance, station o - offset t - timestamp c - code r - remark q - quality f - foresight a - attribute The string may contain the characters in any order, without duplicates, except for ‘a’ which may occur multiple times. The string must contain x/e,y/n,z/h or d/s,z/h. Examples: ‘pyxzctnff’, ‘pnezfrf’
  • codebook (dict) – a dict that describes the codes used in the survey.
  • header (int) – the row number of the header. As in pandas it is 0 by default. If there is no header row specify ‘None’.
  • kwargs (dict) – keyword arguments passed to pandas.read_csv.
plot(**kwargs)

Plot the x, y values of the data.

Parameters:kwargs (dict) – Keyword arguments to be passed to Pandas and matplotlib.
Returns:a matplotlib Axis.
Return type:ax (Axis)
save(filename=None, original_header=False, write_history=False)

Save the data to a file

translate(deltas)

Translate the data by an xyz offset and add a line to history.

evaluation Module

filter Module

orangery.core.filter.benchmarks(df, code_table, codebook)

Given a DataFrame return survey records with benchmark codes.

Parameters:
  • df (pandas.DataFrame) – survey data records.
  • code_table (pandas.DataFrame) – survey data record properties extracted by parse function.
  • codebook (dict) – a dict that describes the codes used in the survey.
Returns:

records having benchmark codes.

Return type:

result (DataFrame)

orangery.core.filter.controls(df, code_table, codebook)

Given a DataFrame return survey records that have control codes.

Parameters:
  • df (pandas.DataFrame) – survey data records.
  • code_table (pandas.DataFrame) – survey data record properties extracted by parse function.
  • codebook (dict) – a dict that describes the codes used in the survey.
Returns:

records having control codes.

Return type:

result (DataFrame)

orangery.core.filter.endpoints(df, reverse=False)

Given a DataFrame return the first and last survey records.

Parameters:
  • df (pandas.DataFrame) – survey data records.
  • reverse (bool) – False returns first then last point, True returns last then first.
Returns:

first and last records in a DataFrame as Points.

Return type:

p1, p2 (Point)

orangery.core.filter.group(df, code_table, group, exclude=[])

Given a DataFrame return a copy of the survey records belonging to a given group

Parameters:
  • df (DataFrame) – survey data records.
  • code_table (DataFrame) – survey data record properties extracted by parse function.
  • group (str) – name of the group to select.
Returns:

records matching the given group name.

Return type:

result (DataFrame)

orangery.core.filter.pointname(df, name)

Given a DataFrame return the named point or survey record.

Parameters:
  • df (DataFrame) – survey data records.
  • name (str) – name of the point to select.
Returns:

records where point field (equivalent to the ‘Point name’ on Trimble data collectors) is equivalent to the name argument.

Return type:

result (DataFrame)