pyacs.sol package

Submodules

pyacs.sol.discontinuity module

class pyacs.sol.discontinuity.Discontinuities[source]

Bases: object

Reads an IGS Discontinuity file

read_igs_discontinuity(discontinuities_file)[source]
display(code=None)[source]
get_soln(code, date)[source]

Returns the soln code corresponding to the given site and date

pyacs.sol.errors module

Exception class for pyacs.sol

exception pyacs.sol.errors.PyacsSolError[source]

Bases: Exception

exception pyacs.sol.errors.PyacsSol_BadLsnx(lsnx)[source]

Bases: pyacs.sol.errors.PyacsSolError

exception pyacs.sol.errors.PyacsSol_HelmertError(method_name, lib, msg)[source]

Bases: pyacs.sol.errors.PyacsSolError

pyacs.sol.gpoint module

class pyacs.sol.gpoint.Gpoint(X=None, Y=None, Z=None, SX=None, SY=None, SZ=None, epoch=None, code=None, pt=None, soln=None, domes=None, VX=None, VY=None, VZ=None, SVX=None, SVY=None, SVZ=None, Ve=None, Vn=None, Vu=None, SVe=None, SVn=None, SVu=None, lon=None, lat=None, he=None, Cv_xyz=None, Cv_enu=None, index=None)[source]

Bases: object

Geodetic point

Used with sinex class

assign_index(index)[source]
posxyz()[source]
staxyz()[source]
covarxyz()[source]
covarenu()[source]
velxyz()[source]
read_from_sinex(sinex_name)[source]

Reads an populate self from a sinex file

write_as_estimate(fname, index=1, VEL=True, VENU=None, CVENU=None, ENU=None, soln=1, epoch=2010.0)[source]

Writes site information formatted for a ESTIMATE section of a sinex file

apply_helmert(T)[source]
substract_pole(W=None, type='rot')[source]

Substract the velocity predicted by an Euler pole or a rotation rate vector

xyz_distance(M)[source]

pyacs.sol.helmert module

calculates Helmert transformation

pyacs.sol.helmert.helmert_matrix(x, y, z, tran=True, rot=True, scale=True, equilibrate=True)[source]

Generates a Helmert transformation matrix for a single point Can also create translation/rotation/scale transformation matrix

Parameters
  • x,y,z – point geocentric coordinates (m)

  • tran,rot,scale – boolean telling that translation/rotation/scale will be included

  • equilibrate – (default True) changes the unit of the matrix so that x are in km and scale in mas for better conditionning of the matrix

Returns H

the transformation matrix as 2D numpy matrix

pyacs.sol.helmert.observation_equation_helmert_local(xf, yf, zf, xr, yr, zr, tran=True, rot=True, scale=True)[source]

Generate the linear transformation equation system for coordinate of a sites in two reference system. The equation system is generated for E,N,U components

Parameters
  • xf,yf,zf – geocentric coordinates in the initial reference (also called ‘free’ frame)

  • xr,yr,zr – geocentric coordinates in the final reference (the reference frame)

  • tran,rot,scale – boolean telling that translation/rotation/scale will be included

Return A,B

the design matrix and observation vector

Note

VCV not accounted yet

pyacs.sol.helmert.estimate_helmert(H_Gpoint_ref, H_Gpoint_free, vcv_xyz=None, psd=None, tran=True, rot=True, scale=True, lexclude=[], method='Dikin_LS', threshold=5.0, verbose=True)[source]

Estimates Helmert or transformation parameters between two sets of coordinates Default is a 7-parameters transformation (translation, rotation & scale)

:param H_Gpoint_ref : dictionary of Geodetic Points (Gpoint instance) used as reference :param H_Gpoint_free: dictionary of Geodetic Points (Gpoint instance) used as free :param psd: psd object from sinex library for post-seismic deformation :param tran,rot,scale: boolean telling if the transformation will use translation/rotation/scale :param method: ‘LS’ (Least-Squares) or ‘Dikin_LS’ (a sequence of L1 and L2 norm) estimation :param threshold: threshold value for outlier rejection (default 5.) :param verbose: boolean

pyacs.sol.helmert.find_outliers_Helmert(R, threshold=5)[source]

Returns index outliers points

pyacs.sol.log module

Various routines for pyacs/sol module

pyacs.sol.log.output_directories(wdir)[source]

Creates or reads pyacs output directory

pyacs.sol.log.write_tsg(lsinex, TSG, ofile)[source]

Write Helmert parameters

pyacs.sol.log.helmert_residuals(RESIDUALS, H_STAT, name, ofile, verbose=True)[source]

Print residuals of a Helmert transformation

pyacs.sol.read_conf module

class pyacs.sol.read_conf.Conf(conf_file=None, verbose=False)[source]

Bases: object

Configuration: various parameters read by the program

pyacs.sol.read_conf.main()[source]

pyacs.sol.sinex module

pyacs.sol.sinex.glx2snx(glx, snx, dir_snx='.')[source]

converts a GLOBK glx file into a sinex file

pyacs.sol.sinex.snx2ssc(snx, ssc, dir_ssc)[source]

simplifies a sinex file into a ssc file

pyacs.sol.sinex.glred_1_day(glx, dir_prt, dir_log, apr, eq_rename=None)[source]

run glred over a day

class pyacs.sol.sinex.SSinex(name=None, estimates=None, VCV=None)[source]

Bases: object

Sinex class: reads and manipulates a Sinex solution. Sinex (Solution/Technique Independent Exchange format) : Sinex format handling Description of the Sinex format is available at: http://www.iers.org/documents/ac/sinex/sinex_v210_proposal.pdf

classmethod from_sinex(snx)[source]

Constructs a PYACS Sinex instance from a P. Rebishung sinex instance

clear()[source]

Clear the sinex

add_site(M)[source]

Adds a Gpoint M in the current Sinex instance

subset_from_code(lcode, lsoln=None)[source]

Takes a subset from a SINEX according to a list of code and optionally a list of associated soln. Returns a dictionary of Gpoint with key (code,soln)

subset_from_keys(H)[source]

Takes a subset from a SINEX according to the key of a dictionary made of (code,soln) Returns a dictionary of Gpoint with key (code,soln)

apply_helmert(T, verbose=True)[source]

Applies an Helmert transformation to a SINEX instance returns a new SINEX instance

write_tsxyz(fname, HCOV=None)[source]

Write a tsxyz file from the current Sinex instance

common(H_Gpoint, prefit=3.5, strict=True, verbose=True)[source]

Returns a dictionary of Gpoint common to the current Sinex object and a dictionary (code,soln) of Gpoint Coordinates will be the ones from the Sinex and NOT from the list of Gpoints commons point are points with the same code pt and soln

read_section_estimate(lexclude=[], lonly=[], discontinuity=None, rename=None, verbose=False)[source]

Reads the ESTIMATE section of a SINEX file. a dictionary with double key 4-letters code and SOLN

Parameters
  • lexclude – list of code to be excluded from reading

  • lonly – lonly code on lonly will be considered

  • discontinuity – if provided, discontinuity will be used to populate the SOLN field.

Generated by the Discontinuity module usually from a IGS soln file. :param rename: a dictionary having as key the sinex file for which rename will be applied and values a list of tuples (‘OLD_CODE’,’NEW_CODE’). The dictionary is usually generated by the Read_Conf_Pyacs module :param verbose: boolean for verbose mode

Returns

a dictionary with double key 4-letters CODE and SOLN and values of Gpoint instance

Note

Strictly, a point in a SINEX file is defined by several codes, including CODE, PT, DOMES and SOLN. The choice here is to ignore the PT and DOMES for versatility.

write_sinex(sinex_name, Agency_Code='IRD')[source]
get_STA(code, epoch, soln=None, soln_file=None, psd_file=None, discontinuity=None, verbose=False)[source]

Provides the predicted coordinates for a site at a given epoch. Accounts for soln and psd if provided.

print_STA(code, soln=None)[source]

print STA values for a given code and optional soln

add_to_STA(code, soln, add_sta)[source]

add sta [dx,dx,dz] to STA values for a given code and soln

change_STA(code, soln, add_sta)[source]

change STA values for a given code and soln

site(code, soln)[source]

return site for a given code and soln

info_gpoint(code, soln=None)[source]

Print info for a given code and optionally soln

lcode()[source]

Returns a list of all point codes in current Sinex object

read_apr(lexclude=[], discontinuity=None, rename=None, verbose=False)[source]

Reads a Globk apr file.

Parameters
  • lexclude – list of code to be excluded from reading

  • discontinuity – if provided, discontinuity will be used to populate the SOLN field.

Generated by the Discontinuity module usually from a IGS soln file. :param rename: a dictionary having as key the sinex file for which rename will be applied and values a list of tuples (‘OLD_CODE’,’NEW_CODE’). The dictionary is usually generated by the Read_Conf_Pyacs module :param verbose: boolean for verbose mode

Returns

a dictionary with double key 4-letters CODE and SOLN and values of Gpoint instance

pyacs.sol.soln module

class pyacs.sol.soln.Soln(name=None)[source]

Bases: object

Soln class: reads and manipulates a Soln information taken from a Sinex solution Sinex (Solution/Technique Independant Exchange format) : Sinex format handling Description of the Sinex format is available at: http://www.iers.org/documents/ac/sinex/sinex_v210_proposal.pdf Soln allow to account for discontinuity in sites positions

append_period(soln, period)[source]

Module contents