gpstimeseries class

class csi.gpstimeseries(name, utmzone=None, verbose=True, lon0=None, lat0=None, ellps='WGS84')

A class that handles a time series of gps data

Args:
  • name : Name of the dataset.

Kwargs:
  • utmzone : UTM zone (optional, default=None)

  • lon0 : Longitude of the center of the UTM zone

  • lat0 : Latitude of the center of the UTM zone

  • ellps : ellipsoid (optional, default=’WGS84’)

  • verbose : Speak to me (default=True)

addPointInTime(time, east=0.0, north=0.0, up=0.0, std_east=0.0, std_north=0.0, std_up=0.0)

Augments the time series by one point.

Args:
  • time: datetime object.a

Kwargs:
  • east, north, up : Time series values. Default is 0

  • std_east, std_north, std_up: Uncertainty values. Default is 0

Returns:
  • None

fitFunction(function, m0, solver='L-BFGS-B', iteration=1000, tol=1e-08)

Fits a function to the timeseries

Args:
  • function : Prediction function,

  • m0 : Initial model

Kwargs:
  • solver : Solver type (see list of solver in scipy.optimize.minimize)

  • iteration : Number of iteration for the solver

  • tol : Tolerance

Returns:
  • None. Parameters are stored in attribute {m} of each time series object

fitTidalConstituents(steps=None, linear=False, tZero=datetime.datetime(2000, 1, 1, 0, 0), chunks=None, cossin=False, constituents='all')

Fits tidal constituents on the time series.

Args:
  • steps : list of datetime instances to add step functions in the estimation process.

  • linear : estimate a linear trend.

  • tZero : origin time (datetime instance).

  • chunks : List [ [start1, end1], [start2, end2]] where the fit is performed.

  • cossin : Add an extra cosine+sine term (weird…)

  • constituents: list of constituents to fit (default is ‘all’)

Returns:
  • None

getOffset(date1, date2, nodate=nan, data='data')

Get the offset between date1 and date2. If the 2 dates are not available, returns NaN.

Args:
  • date1 : datetime object

  • date2 : datetime object

Kwargs:
  • data : can be ‘data’ or ‘std’

  • nodate : If there is no date, return this value

Returns:
  • tuple of floats

initializeTimeSeries(time=None, start=None, end=None, interval=1, los=False)

Initializes the time series by creating whatever is necessary.

Kwargs:
  • time Time vector

  • starttime: Begining of the time series.

  • endtime: End of the time series.

  • interval: In days.

  • los: True/False

plot(figure=1, styles=['.r'], show=True, data='data')

Plots the time series.

Kwargs:
  • figure : Figure id number (default=1)

  • styles : List of styles (default=[‘.r’])

  • show : Show to me (default=True)

  • data : What do you show (data, synth)

Returns:
  • None

project2InSAR(los)

Projects the time series of east, north and up displacements into the line-of-sight given as argument

Args:
  • los : list of three component. L2-norm of los must be equal to 1

Returns:
  • None. Results are stored in attribute {losvector}

read_from_JPL(filename)

Reads the time series from a file which has been sent from JPL. Format is a bit awkward and you should not see that a lot. Look inside the code to find out…

read_from_caltech(filename)

Reads the data from a time series file from CalTech (Avouac’s group). Time is in decimal year…

Args:
  • filename : Input file

Returns:
  • None

read_from_file(filename, verbose=False)

Reads the time series from a file which has been written by write2file

Args:
  • filename : name of the file

Kwargs:
  • verbose : talk to me

Returns:
  • None

read_from_renoxyz(filename, verbose=False)

Reads the time series from a file which has been downloaded on http://geodesy.unr.edu/NGLStationPages/gpsnetmap/GPSNetMap.html

This was true on 2015.

Args:
  • filename : name of file

Kwargs:
  • verbose : talk to me

Returns:
  • None

read_from_sql(filename, tables={'e': 'east', 'n': 'north', 'u': 'up'}, sigma={'e': 'sigma_east', 'n': 'sigma_north', 'u': 'sigma_up'}, factor=1.0)

Reads the East, North and Up components of the station in a sql file. This follows the organization of M. Simons’ group at Caltech. The sql file has tables called as indicated in the dictionary tables and sigma.

This method requires pandas and sqlalchemy

Args:
  • filename : Name of the sql file

Kwargs:
  • tables : Dictionary of the names of the table for the east, north and up displacement time series

  • sigma : Dictionary of the names of the tables for the east, north and up uncertainties time series

  • factor : scaling factor

Returns:
  • None

reference2timeseries(timeseries, verbose=True)

Removes to another gps timeseries the difference between self and timeseries

Args:
  • timeseries : Another gpstimeseries

Kwargs:
  • verbose : Talk to me

Returns:
  • None

removeNaNs()

Remove NaNs in the time series

Returns:
  • None

removePointsInTime(u)

Remove points from the time series.

Args:
  • u : List or array of indexes to remove

Returns:
  • None

trimTime(start, end=datetime.datetime(2100, 1, 1, 0, 0))

Keeps the epochs between start and end

Args:
  • start: starting date (datetime instance)

Kwargs:
  • end: ending date (datetime instance)

Returns:
  • None

write2file(outfile, steplike=False)

Writes the time series to a file.

Args:
  • outfile : output file.

Kwargs:
  • steplike : doubles the output each time so that the plot looks like steps.

Returns:
  • None