From 3f08a82b6de42ae250dd4c0dae4ef1e4886c6174 Mon Sep 17 00:00:00 2001 From: xanthos Date: Mon, 23 Aug 2021 17:26:45 +0300 Subject: [PATCH 01/20] fixing bug 68 --- bin/StrainTensor.py | 44 +++++----- pystrain/pystrain/geodesy/utm.py | 140 ++++++++++++++++--------------- pystrain/pystrain/strain.py | 16 ++-- 3 files changed, 106 insertions(+), 94 deletions(-) diff --git a/bin/StrainTensor.py b/bin/StrainTensor.py index dca6cd4..81682f6 100755 --- a/bin/StrainTensor.py +++ b/bin/StrainTensor.py @@ -79,7 +79,8 @@ def print_model_info(fout, cmd, clargs): print('\t{:20s} -> {:}'.format(key, clargs[key]), file=fout) return -def compute__(grd, sta_list_utm, utmzone, fout, fstats, vprint_fun, **dargs): +#def compute__(grid, sta_list_utm, utmzone, fout, fstats, vprint_fun, **dargs): +def compute__(grid, sta_list_utm, utm_lcm, fout, fstats, vprint_fun, **dargs): """ Function to perform the bulk of a Strain Tensor estimation. For each of the grid cells, a ShenStrain object will be created, using the list of stations and the **dargs options. @@ -114,20 +115,22 @@ def compute__(grd, sta_list_utm, utmzone, fout, fstats, vprint_fun, **dargs): node_nr, nodes_estim = 0, 0 for x, y in grd: clat, clon = radians(y), radians(x) - N, E, ZN, _ = ell2utm(clat, clon, Ellipsoid("wgs84"), utmzone) - assert ZN == utmzone + N, E, ZN, lcm = ell2utm(clat, clon, Ellipsoid("wgs84"), utm_lcm) + #assert ZN == utmzone + assert utm_lcm == lcm vprint_fun('[DEBUG] Grid point at {:+8.4f}, {:8.4f} or E={:}, N={:}'.format( x, y, E, N)) if not dargs['multiproc_mode']: print('[DEBUG] {:5d}/{:7d}'.format(node_nr+1, grd.xpts*grd.ypts), end="\r") ## Construct the Strain instance, with all args (from input) - sstr = ShenStrain(E, N, sta_list_utm, **dargs) + # sstr = ShenStrain(E, N, sta_list_utm, **dargs) + sstr = ShenStrain(E, N, clat<0e0, sta_list_utm, **dargs) ## check azimouth coverage (aka max β angle) if degrees(max(sstr.beta_angles())) <= dargs['max_beta_angle']: try: sstr.estimate() vprint_fun('[DEBUG] Computed tensor at {:+8.4f} {:+8.4f} for node {:3d}/{:3d}'.format(x, y, node_nr+1, grd.xpts*grd.ypts)) - sstr.print_details_v2(fout, utmzone) + sstr.print_details_v2(fout, utm_lcm) if fstats: print('{:+9.4f} {:+10.4f} {:6d} {:14.2f} {:10.2f} {:12.3f}'.format(x,y,len(sstr.__stalst__), sstr.__options__['d_coef'],sstr.__options__['cutoff_dis'], sstr.__sigma0__), file=fstats) nodes_estim += 1 except RuntimeError: @@ -405,15 +408,16 @@ class myFormatter( ## TODO is this mean_lon the optimal?? or should it be the region's mean longtitude ## mean_lon = degrees(sum([ x.lon for x in sta_list_ell ]) / len(sta_list_ell)) - utm_zone = floor(mean_lon/6)+31 - utm_zone = utm_zone + int(utm_zone<=0)*60 - int(utm_zone>60)*60 - vprint('[DEBUG] Mean longtitude is {} deg.; using Zone = {} for UTM'.format(mean_lon, utm_zone)) + #utm_zone = floor(mean_lon/6)+31 + #utm_zone = utm_zone + int(utm_zone<=0)*60 - int(utm_zone>60)*60 + lcm = radians(floor(mean_lon)) + #print('[DEBUG] Mean longtitude is {} deg.; using Zone = {} for UTM'.format(mean_lon, utm_zone)) sta_list_utm = deepcopy(sta_list_ell) for idx, sta in enumerate(sta_list_utm): - N, E, Zone, lcm = ell2utm(sta.lat, sta.lon, Ellipsoid("wgs84"), utm_zone) + N, E, Zone, lcm = ell2utm(sta.lat, sta.lon, Ellipsoid("wgs84"), lcm) sta_list_utm[idx].lon = E sta_list_utm[idx].lat = N - assert Zone == utm_zone, "[ERROR] Invalid UTM Zone." + # assert Zone == utm_zone, "[ERROR] Invalid UTM Zone." vprint('[DEBUG] Station list transformed to UTM.') ## Open file to write Strain Tensor estimates; write the header @@ -426,12 +430,12 @@ class myFormatter( if args.one_tensor: print('[DEBUG] Estimating Strain Tensor at region\'s barycentre.') if args.method == 'shen': - sstr = ShenStrain(0e0, 0e0, sta_list_utm, **dargs) + sstr = ShenStrain(0e0, 0e0, False, sta_list_utm, **dargs) else: - sstr = ShenStrain(0e0, 0e0, sta_list_utm, weighting_function='equal_weights') + sstr = ShenStrain(0e0, 0e0, False, sta_list_utm, weighting_function='equal_weights') sstr.set_to_barycenter() sstr.estimate() - sstr.print_details(fout, utm_zone) + sstr.print_details(fout, utm_lcm) fout.close() write_station_info(sta_list_ell) print('[DEBUG] Total running time: {:10.2f} sec.'.format((time.time() - start_time))) @@ -470,10 +474,10 @@ class myFormatter( else: fstats1 = fstats2 = fstats3 = fstats4 = None print('[DEBUG] Estimating strain tensors in multi-threading mode') - p1 = multiprocessing.Process(target=compute__, args=(grd1, sta_list_utm, utm_zone, fout1, fstats1, vprint), kwargs=dargs) - p2 = multiprocessing.Process(target=compute__, args=(grd2, sta_list_utm, utm_zone, fout2, fstats2, vprint), kwargs=dargs) - p3 = multiprocessing.Process(target=compute__, args=(grd3, sta_list_utm, utm_zone, fout3, fstats3, vprint), kwargs=dargs) - p4 = multiprocessing.Process(target=compute__, args=(grd4, sta_list_utm, utm_zone, fout4, fstats4, vprint), kwargs=dargs) + p1 = multiprocessing.Process(target=compute__, args=(grd1, sta_list_utm, lcm, fout1, fstats1, vprint), kwargs=dargs) + p2 = multiprocessing.Process(target=compute__, args=(grd2, sta_list_utm, lcm, fout2, fstats2, vprint), kwargs=dargs) + p3 = multiprocessing.Process(target=compute__, args=(grd3, sta_list_utm, lcm, fout3, fstats3, vprint), kwargs=dargs) + p4 = multiprocessing.Process(target=compute__, args=(grd4, sta_list_utm, lcm, fout4, fstats4, vprint), kwargs=dargs) [ p.start() for p in [p1, p2, p3, p4]] [ p.join() for p in [p1, p2, p3, p4]] for fl in [fout1, fout2, fout3, fout4]: @@ -498,7 +502,7 @@ class myFormatter( os.remove(".sta.thread"+str(fnr)) else: - compute__(grd, sta_list_utm, utm_zone, fout, fstats, vprint, **dargs) + compute__(grd, sta_list_utm, lcm, fout, fstats, vprint, **dargs) else: ## Using veis method. Compute delaunay triangles and estimate one tensor ##+ per triangle centre @@ -515,9 +519,9 @@ class myFormatter( cy = (sta_list_utm[trng[0]].lat + sta_list_utm[trng[1]].lat + sta_list_utm[trng[2]].lat)/3e0 ## Construct a strain instance, at the triangle's barycentre, with only ##+ 3 points (in UTM) and equal_weights weighting scheme. - sstr = ShenStrain(cx, cy, [sta_list_utm[trng[0]], sta_list_utm[trng[1]], sta_list_utm[trng[2]]], weighting_function='equal_weights') + sstr = ShenStrain(cx, cy, cy<0e0, [sta_list_utm[trng[0]], sta_list_utm[trng[1]], sta_list_utm[trng[2]]], weighting_function='equal_weights') sstr.estimate() - sstr.print_details(fout, utm_zone) + sstr.print_details(fout, utm_lcm) ## Print the triangle in the corresponding file (ellipsoidal crd, degrees) print('> {:}, {:}, {:}'.format(sta_list_utm[trng[0]].name, sta_list_utm[trng[1]].name, sta_list_utm[trng[2]].name), file=dlnout) print('{:+8.5f} {:8.5f}\n{:+8.5f} {:8.5f}\n{:+8.5f} {:8.5f}\n{:+8.5f} {:8.5f}'.format(*[ degrees(x) for x in [sta_list_ell[trng[0]].lon, sta_list_ell[trng[0]].lat, sta_list_ell[trng[1]].lon, sta_list_ell[trng[1]].lat, sta_list_ell[trng[2]].lon, sta_list_ell[trng[2]].lat, sta_list_ell[trng[0]].lon, sta_list_ell[trng[0]].lat]]), file=dlnout) diff --git a/pystrain/pystrain/geodesy/utm.py b/pystrain/pystrain/geodesy/utm.py index 317fab8..f3d4050 100755 --- a/pystrain/pystrain/geodesy/utm.py +++ b/pystrain/pystrain/geodesy/utm.py @@ -2,8 +2,8 @@ #-*- coding: utf-8 -*- from __future__ import print_function -from math import floor, degrees, radians, pi, sin, cos, tan from pystrain.geodesy.ellipsoid import Ellipsoid +import math def dd2dms(dd): ''' Decimal degrees to hexicondal degrees. @@ -25,7 +25,10 @@ def dd2dms(dd): if dd < 0e0: cdeg = cdeg * -1 return cdeg,cmin,csec -def utm2ell(E, N, zone, ell=Ellipsoid("wgs84"), lcm=None): +def zone2lcm(zone_number): + return (zone_number-1)*6-180+3 + +def utm2ell(E, N, zone=None, ell=Ellipsoid("wgs84"), lcm=None, southern_hemisphere=False): '''UTM to ellipsoidal coordinates. Convert UTM coordinates (i.e. Easting and Northing) to ellipsoidal @@ -34,16 +37,22 @@ def utm2ell(E, N, zone, ell=Ellipsoid("wgs84"), lcm=None): Args: E (float): Easting in meters N (float): Northing in meters - zone (int): the zone in degrees (?) + zone (int): the zone in degrees (ignored if lcm set) ell (Ellipsoid): the ellipsoid of choice - lcm: central meridian (?) + lcm: non-standard central meridian (radians) Returns: tuple (float, float): first is latitude and second is longtitude, both in degrees. ''' + if zone == lcm == None: + raise RuntimeError('[ERROR] utm2ell:: need to specify at least zone or non-standard central meridian') + if not lcm: - lcm = radians(abs(zone)*6-183) + lcm = math.radians(abs(zone)*6-183) + + if southern_hemisphere: + N -= 10000000e0 f = ell.f a = ell.a @@ -52,53 +61,51 @@ def utm2ell(E, N, zone, ell=Ellipsoid("wgs84"), lcm=None): e23 = e22*e2 e24 = e23*e2 - No = 0 # False northing (north) - if zone < 0: - No = 1e7 # False northing (south) + No = 1e7 if lcm < 0 else 0e0 # False northing (north) Eo = 500000 # False easting N = N-No E = E-Eo - Zone = abs(zone) # Remove negative zone indicator for southern hemisphere - ko = 0.9996 # UTM scale factor + # Zone = abs(zone) # Remove negative zone indicator for southern hemisphere + ko = 0.9996e0 # UTM scale factor lat1 = N/ko/a - dlat = 1 + dlat = 1e0 while abs(dlat) > 1e-12: - A0=1-(e2/4)-(e22*3/64.0)-(e23*5/256.0)-(e24*175/16384.0) - A2=(3/8.0)*( e2+(e22/4.0)+(e23*15/128.0)-(e24*455/4096.0) ) - A4=(15/256.0)*( e22+(e23*3/4.0)-(e24*77/128.0) ) - A6=(35/3072.0)*( e23-(e24*41/32.0) ) - A8=-(315/131072.0)*e24 - f1=a*( A0*lat1-A2*sin(2*lat1)+A4*sin(4*lat1)-A6*sin(6*lat1)+A8*sin(8*lat1) )-N/ko - f2=a*( A0-2*A2*cos(2*lat1)+4*A4*cos(4*lat1)-6*A6*cos(6*lat1)+8*A8*cos(8*lat1) ) + A0=1e0-(e2/4e0)-(e22*3e0/64e0)-(e23*5e0/256e0)-(e24*175e0/16384e0) + A2=(3e0/8e0)*( e2+(e22/4e0)+(e23*15e0/128e0)-(e24*455e0/4096e0) ) + A4=(15e0/256e0)*( e22+(e23*3e0/4e0)-(e24*77e0/128e0) ) + A6=(35e0/3072e0)*( e23-(e24*41e0/32e0) ) + A8=-(315e0/131072e0)*e24 + f1=a*( A0*lat1-A2*math.sin(2e0*lat1)+A4*math.sin(4e0*lat1)-A6*math.sin(6e0*lat1)+A8*math.sin(8e0*lat1) )-N/ko + f2=a*( A0-2e0*A2*math.cos(2e0*lat1)+4e0*A4*math.cos(4e0*lat1)-6e0*A6*math.cos(6e0*lat1)+8e0*A8*math.cos(8e0*lat1) ) dlat=-f1/f2 lat1=lat1+dlat RN = ell.N(lat1) RM = ell.M(lat1) - h2 = e2*pow(cos(lat1),2)/(1-e2) - t = tan(lat1) - t2 = pow(t,2) + h2 = e2*pow(math.cos(lat1),2e0)/(1e0-e2) + t = math.tan(lat1) + t2 = pow(t,2e0) t4 = t2*t2 t6 = t4*t2 - h22 = pow(h2,2) + h22 = pow(h2,2e0) h23 = h22*h2 h24 = h23*h2 E0 = E/ko/RN E1 = E0 - E2 = pow(E0,3)/6.*(1+2*t2+h2) - E3 = pow(E0,5)/120.*(5+6*h2+28*t2-3*h22+8*t2*h2+24*t4-4*h23+4*t2*h22+24*t2*h23) - E4 = pow(E0,7)/5040.*(61 + 662*t2 + 1320*t4 + 720*t6) - lon = (1/cos(lat1))*(E1-E2+E3-E4)+lcm + E2 = pow(E0,3e0)/6e0*(1e0+2e0*t2+h2) + E3 = pow(E0,5e0)/120e0*(5e0+6e0*h2+28e0*t2-3e0*h22+8e0*t2*h2+24e0*t4-4e0*h23+4e0*t2*h22+24e0*t2*h23) + E4 = pow(E0,7e0)/5040e0*(61e0 + 662e0*t2 + 1320e0*t4 + 720e0*t6) + lon = (1e0/math.cos(lat1))*(E1-E2+E3-E4)+lcm E0 = E/ko - N1 = (t*pow(E0,2))/(2*RM*RN) - N2 = (t*pow(E0,4))/(24*RM*pow(RN,3))*(5+3.*t2+h2-4*h22-9*h2*t2) - N3 = (t*pow(E0,6))/(720*RM*pow(RN,5))*(61-90*t2+46*h2+45*t4-252*t2*h2-5*h22+100*h23-66*t2*h22-90*t4*h2+88*h24+225*t4*h22+84*t2*h23-192*t2*h24) - N4 = (t*pow(E0,8))/(40320*RM*pow(RN,7))*(1385+3633*t2+4095*t4+1575*t6) + N1 = (t*pow(E0,2e0))/(2e0*RM*RN) + N2 = (t*pow(E0,4e0))/(24e0*RM*pow(RN,3e0))*(5e0+3e0*t2+h2-4e0*h22-9e0*h2*t2) + N3 = (t*pow(E0,6e0))/(720e0*RM*pow(RN,5e0))*(61e0-90e0*t2+46e0*h2+45e0*t4-252e0*t2*h2-5e0*h22+100e0*h23-66e0*t2*h22-90e0*t4*h2+88e0*h24+225e0*t4*h22+84e0*t2*h23-192e0*t2*h24) + N4 = (t*pow(E0,8e0))/(40320e0*RM*pow(RN,7e0))*(1385e0+3633e0*t2+4095e0*t4+1575e0*t6) lat= lat1-N1+N2-N3+N4 return lat, lon -def ell2utm(lat, lon, ell=Ellipsoid("wgs84"), zone=None, lcm=None): +def ell2utm(lat, lon, ell=Ellipsoid("wgs84"), lcm=None): """Ellipsoidal coordinates to UTM. Convert ellipsoidal coordinates (actualy longtitude and latitude) to @@ -111,8 +118,7 @@ def ell2utm(lat, lon, ell=Ellipsoid("wgs84"), zone=None, lcm=None): lat (float): latitude in radians lon (float): longtitude in radians ell (Ellipsoid): ellipsoid of choice - zone (int): zone in degrees - lcm : + lcm : optional non-standard central meridian in radians Returns: tuple (float, float, int, int): a tuple of type: @@ -122,38 +128,38 @@ def ell2utm(lat, lon, ell=Ellipsoid("wgs84"), zone=None, lcm=None): a = ell.a e2 = ell.eccentricity_squared() - if zone: - Zone = zone + if lcm: + Zone = 0 else: - Zone = floor(degrees(lon)/6)+31 + Zone = floor(math.degrees(lon)/6e0)+31 Zone = Zone + int(Zone<=0)*60 - int(Zone>60)*60 - lcm = radians(Zone*6-183) + lcm = math.radians(Zone*6-183) + # assert Zone >= 1 and Zone <= 60 - ko = 0.9996 # Scale factor - if lat > 0: - No = 0 # False northing (north) - else: - No = 1e7 # False northing (south) - Zone *= -1e0 + if abs(lat) > math.radians(80): + print('[WARNING] Latitude outside 80N/S limit for UTM') + + ko = 0.9996e0 # Scale factor + No = 0e0 if lat > 0e0 else 1e7 Eo = 500000 # False easting lam = lon-lcm - if lam >= pi: lam = lam - pi*2 + lam = lam - int(lam>=math.pi) * (math.pi * 2e0) RN = ell.N(lat) RM = ell.M(lat) - coslat = cos(lat) - sinlat = sin(lat) - h2 = e2*coslat*coslat/(1-e2) - t = tan(lat) - n = f/(2-f) + coslat = math.cos(lat) + sinlat = math.sin(lat) + h2 = e2*coslat*coslat/(1e0-e2) + t = math.tan(lat) + n = f/(2e0-f) # powers of various values - n2 = pow(n,2) + n2 = pow(n,2e0) n3 = n2*n n4 = n3*n - t2 = pow(t,2) + t2 = pow(t,2e0) t3 = t2*t t4 = t3*t t6 = t4*t2 @@ -161,27 +167,27 @@ def ell2utm(lat, lon, ell=Ellipsoid("wgs84"), zone=None, lcm=None): h23 = h22*h2 h24 = h23*h2 - A0 = 1+n2/4.0+n4/64.0 - A2 = 3.0/2.0*(n-n3/8) - A4 = 15.0/16.0*(n2-n4/4) - A6 = 35.0/48.0*n3 - A8 = 315.0/512.0*n4 - S = a/(1+n)*(A0*lat-A2*sin(2*lat)+A4*sin(4*lat)-A6*sin(6*lat)+A8*sin(8*lat)) + A0 = 1e0+n2/4e0+n4/64e0 + A2 = 3e0/2e0*(n-n3/8e0) + A4 = 15e0/16e0*(n2-n4/4e0) + A6 = 35e0/48e0*n3 + A8 = 315e0/512e0*n4 + S = a/(1e0+n)*(A0*lat-A2*math.sin(2e0*lat)+A4*math.sin(4e0*lat)-A6*math.sin(6e0*lat)+A8*math.sin(8e0*lat)) E1 = lam*coslat - E2 = pow(lam,3)*pow(coslat,3)/6*(1-t2+h2) - E3 = pow(lam,5)*pow(coslat,5)/120*(5-18*t2+t4+14*h2-58*t2*h2+ - 13*h22+4*h23-64*t2*h22-24*t2*h23) - E4 = pow(lam,7)*pow(coslat,7)/5040*(61-479*t2+179*t4-t4*t2) + E2 = pow(lam,3e0)*pow(coslat,3e0)/6e0*(1e0-t2+h2) + E3 = pow(lam,5e0)*pow(coslat,5e0)/120e0*(5e0-18e0*t2+t4+14e0*h2-58e0*t2*h2+ + 13e0*h22+4e0*h23-64e0*t2*h22-24e0*t2*h23) + E4 = pow(lam,7e0)*pow(coslat,7e0)/5040e0*(61e0-479e0*t2+179e0*t4-t4*t2) E = Eo+ko*RN*(E1+E2+E3+E4) N1 = S/RN - N2 = pow(lam,2)/2*sinlat*coslat; - N3 = pow(lam,4)/24*sinlat*pow(coslat,3)*(5-t2+9*h2+4*h22) - N4 = pow(lam,6)/720*sinlat*pow(coslat,5)*(61-58*t2+t4+ - 270*h2-330*t2*h2+445*h22+324*h23-680*t2*h22+ - 88*h24-600*t2*h23-192*t2*h24) - N5 = pow(lam,8)/40320*sinlat*pow(coslat,7)*(1385-311*t2+543*t4-t6) + N2 = pow(lam,2e0)/2e0*sinlat*coslat; + N3 = pow(lam,4e0)/24e0*sinlat*pow(coslat,3e0)*(5e0-t2+9e0*h2+4e0*h22) + N4 = pow(lam,6e0)/720e0*sinlat*pow(coslat,5e0)*(61e0-58e0*t2+t4+ + 270e0*h2-330e0*t2*h2+445e0*h22+324e0*h23-680e0*t2*h22+ + 88e0*h24-600e0*t2*h23-192e0*t2*h24) + N5 = pow(lam,8e0)/40320e0*sinlat*pow(coslat,7e0)*(1385e0-311e0*t2+543e0*t4-t6) N = No+ko*RN*(N1+N2+N3+N4+N5) return N, E, Zone, lcm diff --git a/pystrain/pystrain/strain.py b/pystrain/pystrain/strain.py index 8b267cb..052c1c9 100755 --- a/pystrain/pystrain/strain.py +++ b/pystrain/pystrain/strain.py @@ -81,7 +81,7 @@ class ShenStrain: d = sqrt((__stalst__[i].lon - __xcmp__)^2 + (__stalst__[i].lat - __ycmp__)^2) """ - def __init__(self, x=0e0, y=0e0, station_list=[], **kwargs): + def __init__(self, x=0e0, y=0e0, in_southern_hemisphere=False, station_list=[], **kwargs): """ ShenStrain constructor. Args: @@ -115,6 +115,7 @@ def __init__(self, x=0e0, y=0e0, station_list=[], **kwargs): self.__stalst__ = station_list self.__xcmp__ = x self.__ycmp__ = y + self.__in_shemisphere__ = in_southern_hemisphere self.__zweights__ = None self.__lweights__ = None self.__options__ = { @@ -781,7 +782,7 @@ def cmp_strain(self, params_cov=None): def info(self): return __strain_info__(self.__parameters__) - def print_details(self, fout, utm_zone=None): + def print_details(self, fout, utm_lcm=None): """Print Strain Tensor details With details, we mean the following parameters: @@ -805,8 +806,8 @@ def print_details(self, fout, utm_zone=None): if the instance's __vcv__ is None (aka we have no var-covar matrix), then the sigmas will be printed as '-' """ - if utm_zone: - cy, cx = [ degrees(c) for c in utm2ell(self.__xcmp__, self.__ycmp__ , utm_zone) ] + if utm_lcm: + cy, cx = [ degrees(c) for c in utm2ell(self.__xcmp__, self.__ycmp__ , None, Ellipsoid("wgs84"), utm_lcm, self.__in_shemisphere__) ] else: cx, cy = self.__xcmp__, self.__ycmp__ emean, ediff, taumax, staumax, emax, semax, emin, semin, azim, sazim, \ @@ -839,9 +840,10 @@ def print_details(self, fout, utm_zone=None): emax*1e9, novar, emin*1e9, novar, taumax*1e9, \ novar, azim, novar, dilat*1e9, novar, sec_inv*1e9, novar), file=fout) - def print_details_v2(self, fout, utm_zone=None): - if utm_zone: - cy, cx = [ degrees(c) for c in utm2ell(self.__xcmp__, self.__ycmp__ , utm_zone) ] + def print_details_v2(self, fout, utm_lcm=None): + if utm_lcm: + #cy, cx = [ degrees(c) for c in utm2ell(self.__xcmp__, self.__ycmp__ , utm_zone) ] + cy, cx = [ degrees(c) for c in utm2ell(self.__xcmp__, self.__ycmp__ , None, Ellipsoid("wgs84"), utm_lcm, self.__in_shemisphere__) ] else: cx, cy = self.__xcmp__, self.__ycmp__ emean, ediff, taumax, staumax, emax, semax, emin, semin, azim, sazim, \ From 4adced4cad55c0cf0f8b7f4ab42c32f91b33d7a3 Mon Sep 17 00:00:00 2001 From: xanthos Date: Tue, 24 Aug 2021 11:12:21 +0300 Subject: [PATCH 02/20] checking bugfix --- bin/StrainTensor.py | 12 +++++++++--- pystrain/pystrain/geodesy/utm.py | 8 +++++++- pystrain/pystrain/grid.py | 4 ++++ pystrain/pystrain/strain.py | 4 ++-- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/bin/StrainTensor.py b/bin/StrainTensor.py index 81682f6..96d5213 100755 --- a/bin/StrainTensor.py +++ b/bin/StrainTensor.py @@ -79,8 +79,7 @@ def print_model_info(fout, cmd, clargs): print('\t{:20s} -> {:}'.format(key, clargs[key]), file=fout) return -#def compute__(grid, sta_list_utm, utmzone, fout, fstats, vprint_fun, **dargs): -def compute__(grid, sta_list_utm, utm_lcm, fout, fstats, vprint_fun, **dargs): +def compute__(igrd, sta_list_utm, utm_lcm, fout, fstats, vprint_fun, **dargs): """ Function to perform the bulk of a Strain Tensor estimation. For each of the grid cells, a ShenStrain object will be created, using the list of stations and the **dargs options. @@ -112,9 +111,11 @@ def compute__(grid, sta_list_utm, utm_lcm, fout, fstats, vprint_fun, **dargs): not flushed before returning or something). Anyway, always close the streams before exiting. """ + #print('--> Thread given grid : X:{:}/{:}/{:} Y:{:}/{:}/{:}'.format(igrd.x_min, igrd.x_max, igrd.x_step, igrd.y_min, igrd.y_max, igrd.y_step)) node_nr, nodes_estim = 0, 0 - for x, y in grd: + for x, y in igrd: clat, clon = radians(y), radians(x) + #print('--> computing tensor at lon {:}, lat {:}'.format(x, y)) N, E, ZN, lcm = ell2utm(clat, clon, Ellipsoid("wgs84"), utm_lcm) #assert ZN == utmzone assert utm_lcm == lcm @@ -462,6 +463,7 @@ class myFormatter( ##+ coordinates in lon/lat pairs, in degrees! if args.multiproc_mode: grd1, grd2, grd3, grd4 = grd.split2four() + print('--> grid split to four!') fout1=open(".out.thread1", "w") fout2=open(".out.thread2", "w") fout3=open(".out.thread3", "w") @@ -474,6 +476,10 @@ class myFormatter( else: fstats1 = fstats2 = fstats3 = fstats4 = None print('[DEBUG] Estimating strain tensors in multi-threading mode') + #print('--> Thread will be given grid : X:{:}/{:}/{:} Y:{:}/{:}/{:}'.format(grd1.x_min, grd1.x_max, grd1.x_step, grd1.y_min, grd1.y_max, grd1.y_step)) + #print('--> Thread will be given grid : X:{:}/{:}/{:} Y:{:}/{:}/{:}'.format(grd2.x_min, grd2.x_max, grd2.x_step, grd2.y_min, grd2.y_max, grd2.y_step)) + #print('--> Thread will be given grid : X:{:}/{:}/{:} Y:{:}/{:}/{:}'.format(grd3.x_min, grd3.x_max, grd3.x_step, grd3.y_min, grd3.y_max, grd3.y_step)) + #print('--> Thread will be given grid : X:{:}/{:}/{:} Y:{:}/{:}/{:}'.format(grd4.x_min, grd4.x_max, grd4.x_step, grd4.y_min, grd4.y_max, grd4.y_step)) p1 = multiprocessing.Process(target=compute__, args=(grd1, sta_list_utm, lcm, fout1, fstats1, vprint), kwargs=dargs) p2 = multiprocessing.Process(target=compute__, args=(grd2, sta_list_utm, lcm, fout2, fstats2, vprint), kwargs=dargs) p3 = multiprocessing.Process(target=compute__, args=(grd3, sta_list_utm, lcm, fout3, fstats3, vprint), kwargs=dargs) diff --git a/pystrain/pystrain/geodesy/utm.py b/pystrain/pystrain/geodesy/utm.py index f3d4050..3a5309a 100755 --- a/pystrain/pystrain/geodesy/utm.py +++ b/pystrain/pystrain/geodesy/utm.py @@ -5,6 +5,8 @@ from pystrain.geodesy.ellipsoid import Ellipsoid import math +MAX_UTM_ITERATIONS = 100 + def dd2dms(dd): ''' Decimal degrees to hexicondal degrees. @@ -69,7 +71,8 @@ def utm2ell(E, N, zone=None, ell=Ellipsoid("wgs84"), lcm=None, southern_hemisphe ko = 0.9996e0 # UTM scale factor lat1 = N/ko/a dlat = 1e0 - while abs(dlat) > 1e-12: + iterations = 0 + while abs(dlat) > 1e-12 and iterations < MAX_UTM_ITERATIONS: A0=1e0-(e2/4e0)-(e22*3e0/64e0)-(e23*5e0/256e0)-(e24*175e0/16384e0) A2=(3e0/8e0)*( e2+(e22/4e0)+(e23*15e0/128e0)-(e24*455e0/4096e0) ) A4=(15e0/256e0)*( e22+(e23*3e0/4e0)-(e24*77e0/128e0) ) @@ -79,6 +82,9 @@ def utm2ell(E, N, zone=None, ell=Ellipsoid("wgs84"), lcm=None, southern_hemisphe f2=a*( A0-2e0*A2*math.cos(2e0*lat1)+4e0*A4*math.cos(4e0*lat1)-6e0*A6*math.cos(6e0*lat1)+8e0*A8*math.cos(8e0*lat1) ) dlat=-f1/f2 lat1=lat1+dlat + iterations += 1 + if iterations >= MAX_UTM_ITERATIONS: + raise RuntimeError('[ERROR] utm2ell failed to converge after 100 iterations') RN = ell.N(lat1) RM = ell.M(lat1) h2 = e2*pow(math.cos(lat1),2e0)/(1e0-e2) diff --git a/pystrain/pystrain/grid.py b/pystrain/pystrain/grid.py index 741106f..befcb23 100755 --- a/pystrain/pystrain/grid.py +++ b/pystrain/pystrain/grid.py @@ -44,6 +44,10 @@ def split2four(self): g2 = Grid(x2, self.x_max, self.x_step, self.y_min, y2, self.y_step) g3 = Grid(self.x_min, x2, self.x_step, y2, self.y_max, self.y_step) g4 = Grid(x2, self.x_max, self.x_step, y2, self.y_max, self.y_step) + #print('--> /grd1/: X:{:}/{:}/{:} Y:{:}/{:}/{:}'.format(g1.x_min, g1.x_max, g1.x_step, g1.y_min, g1.y_max, g1.y_step)) + #print('--> /grd2/: X:{:}/{:}/{:} Y:{:}/{:}/{:}'.format(g2.x_min, g2.x_max, g2.x_step, g2.y_min, g2.y_max, g2.y_step)) + #print('--> /grd3/: X:{:}/{:}/{:} Y:{:}/{:}/{:}'.format(g3.x_min, g3.x_max, g3.x_step, g3.y_min, g3.y_max, g3.y_step)) + #print('--> /grd4/: X:{:}/{:}/{:} Y:{:}/{:}/{:}'.format(g4.x_min, g4.x_max, g4.x_step, g4.y_min, g4.y_max, g4.y_step)) return g1, g2, g3, g4 ## TODO write about ceil/floor and [x|y]_max in documentation diff --git a/pystrain/pystrain/strain.py b/pystrain/pystrain/strain.py index 052c1c9..413ebba 100755 --- a/pystrain/pystrain/strain.py +++ b/pystrain/pystrain/strain.py @@ -807,7 +807,7 @@ def print_details(self, fout, utm_lcm=None): matrix), then the sigmas will be printed as '-' """ if utm_lcm: - cy, cx = [ degrees(c) for c in utm2ell(self.__xcmp__, self.__ycmp__ , None, Ellipsoid("wgs84"), utm_lcm, self.__in_shemisphere__) ] + cy, cx = [ degrees(c) for c in utm2ell(self.__xcmp__, self.__ycmp__ , None, Ellipsoid("wgs84"), utm_lcm, self.__in_shemisphere__ and utm_lcm>0) ] else: cx, cy = self.__xcmp__, self.__ycmp__ emean, ediff, taumax, staumax, emax, semax, emin, semin, azim, sazim, \ @@ -843,7 +843,7 @@ def print_details(self, fout, utm_lcm=None): def print_details_v2(self, fout, utm_lcm=None): if utm_lcm: #cy, cx = [ degrees(c) for c in utm2ell(self.__xcmp__, self.__ycmp__ , utm_zone) ] - cy, cx = [ degrees(c) for c in utm2ell(self.__xcmp__, self.__ycmp__ , None, Ellipsoid("wgs84"), utm_lcm, self.__in_shemisphere__) ] + cy, cx = [ degrees(c) for c in utm2ell(self.__xcmp__, self.__ycmp__ , None, Ellipsoid("wgs84"), utm_lcm, self.__in_shemisphere__ and utm_lcm>0) ] else: cx, cy = self.__xcmp__, self.__ycmp__ emean, ediff, taumax, staumax, emax, semax, emin, semin, azim, sazim, \ From 533638e0eaa16becdcf10f4272cd80423673fe31 Mon Sep 17 00:00:00 2001 From: "danast.triangle" Date: Wed, 8 Sep 2021 12:39:34 +0300 Subject: [PATCH 03/20] update utm for veis method #68 --- .github/CHANGELOG.md | 0 .github/CODE_OF_CONDUCT.md | 0 .github/CONTRIBUTING.md | 0 .github/ISSUE_TEMPLATE.md | 0 .github/ISSUE_TEMPLATE/bug_report.md | 0 .github/ISSUE_TEMPLATE/custom.md | 0 .github/ISSUE_TEMPLATE/feature_request.md | 0 .github/PULL_REQUEST_TEMPLATE.md | 0 .gitignore | 0 .travis.yml | 0 LICENSE | 0 README.md | 0 bin/StrainTensor.py | 2 +- data/station_info.dat.ref | 0 data/strain_info.dat.ref | 0 doc/readme.html | 0 doc/readme.md | 0 doc/straindoc.js | 0 plot/default-param | 12 ++++++------ plot/default-param.def | 0 pystrain/pystrain/Makefile | 0 pystrain/pystrain/__init__.py | 0 pystrain/pystrain/geodesy/__init__.py | 0 pystrain/pystrain/iotools/__init__.py | 0 pystrain/pystrain/iotools/iparser.py | 0 pystrain/pystrain/station.py | 0 pystrain/setup.py | 0 27 files changed, 7 insertions(+), 7 deletions(-) mode change 100644 => 100755 .github/CHANGELOG.md mode change 100644 => 100755 .github/CODE_OF_CONDUCT.md mode change 100644 => 100755 .github/CONTRIBUTING.md mode change 100644 => 100755 .github/ISSUE_TEMPLATE.md mode change 100644 => 100755 .github/ISSUE_TEMPLATE/bug_report.md mode change 100644 => 100755 .github/ISSUE_TEMPLATE/custom.md mode change 100644 => 100755 .github/ISSUE_TEMPLATE/feature_request.md mode change 100644 => 100755 .github/PULL_REQUEST_TEMPLATE.md mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .travis.yml mode change 100644 => 100755 LICENSE mode change 100644 => 100755 README.md mode change 100644 => 100755 data/station_info.dat.ref mode change 100644 => 100755 data/strain_info.dat.ref mode change 100644 => 100755 doc/readme.html mode change 100644 => 100755 doc/readme.md mode change 100644 => 100755 doc/straindoc.js mode change 100644 => 100755 plot/default-param mode change 100644 => 100755 plot/default-param.def mode change 100644 => 100755 pystrain/pystrain/Makefile mode change 100644 => 100755 pystrain/pystrain/__init__.py mode change 100644 => 100755 pystrain/pystrain/geodesy/__init__.py mode change 100644 => 100755 pystrain/pystrain/iotools/__init__.py mode change 100644 => 100755 pystrain/pystrain/iotools/iparser.py mode change 100644 => 100755 pystrain/pystrain/station.py mode change 100644 => 100755 pystrain/setup.py diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md old mode 100644 new mode 100755 diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md old mode 100644 new mode 100755 diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md old mode 100644 new mode 100755 diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md old mode 100644 new mode 100755 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md old mode 100644 new mode 100755 diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md old mode 100644 new mode 100755 diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md old mode 100644 new mode 100755 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.travis.yml b/.travis.yml old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/bin/StrainTensor.py b/bin/StrainTensor.py index 96d5213..3db53f0 100755 --- a/bin/StrainTensor.py +++ b/bin/StrainTensor.py @@ -527,7 +527,7 @@ class myFormatter( ##+ 3 points (in UTM) and equal_weights weighting scheme. sstr = ShenStrain(cx, cy, cy<0e0, [sta_list_utm[trng[0]], sta_list_utm[trng[1]], sta_list_utm[trng[2]]], weighting_function='equal_weights') sstr.estimate() - sstr.print_details(fout, utm_lcm) + sstr.print_details(fout, lcm) ## Print the triangle in the corresponding file (ellipsoidal crd, degrees) print('> {:}, {:}, {:}'.format(sta_list_utm[trng[0]].name, sta_list_utm[trng[1]].name, sta_list_utm[trng[2]].name), file=dlnout) print('{:+8.5f} {:8.5f}\n{:+8.5f} {:8.5f}\n{:+8.5f} {:8.5f}\n{:+8.5f} {:8.5f}'.format(*[ degrees(x) for x in [sta_list_ell[trng[0]].lon, sta_list_ell[trng[0]].lat, sta_list_ell[trng[1]].lon, sta_list_ell[trng[1]].lat, sta_list_ell[trng[2]].lon, sta_list_ell[trng[2]].lat, sta_list_ell[trng[0]].lon, sta_list_ell[trng[0]].lat]]), file=dlnout) diff --git a/data/station_info.dat.ref b/data/station_info.dat.ref old mode 100644 new mode 100755 diff --git a/data/strain_info.dat.ref b/data/strain_info.dat.ref old mode 100644 new mode 100755 diff --git a/doc/readme.html b/doc/readme.html old mode 100644 new mode 100755 diff --git a/doc/readme.md b/doc/readme.md old mode 100644 new mode 100755 diff --git a/doc/straindoc.js b/doc/straindoc.js old mode 100644 new mode 100755 diff --git a/plot/default-param b/plot/default-param old mode 100644 new mode 100755 index d4de8f8..878cab0 --- a/plot/default-param +++ b/plot/default-param @@ -16,12 +16,12 @@ PAPER_SIZE="30cx30c" # width x height # ////////////////////////////////////////////////////////////////////////////// # Set default REGION -west=17 #19.5 -east=30 #29 -south=34 -north=43 #42 -projscale=6000000 -frame=1 +west=25 +east=50 +south=-30 +north=22 +projscale=20000000 +frame=2 # length of plot scale (Km) sclength=100 diff --git a/plot/default-param.def b/plot/default-param.def old mode 100644 new mode 100755 diff --git a/pystrain/pystrain/Makefile b/pystrain/pystrain/Makefile old mode 100644 new mode 100755 diff --git a/pystrain/pystrain/__init__.py b/pystrain/pystrain/__init__.py old mode 100644 new mode 100755 diff --git a/pystrain/pystrain/geodesy/__init__.py b/pystrain/pystrain/geodesy/__init__.py old mode 100644 new mode 100755 diff --git a/pystrain/pystrain/iotools/__init__.py b/pystrain/pystrain/iotools/__init__.py old mode 100644 new mode 100755 diff --git a/pystrain/pystrain/iotools/iparser.py b/pystrain/pystrain/iotools/iparser.py old mode 100644 new mode 100755 diff --git a/pystrain/pystrain/station.py b/pystrain/pystrain/station.py old mode 100644 new mode 100755 diff --git a/pystrain/setup.py b/pystrain/setup.py old mode 100644 new mode 100755 From d1760206c7a0864213b30ec2f07497eb9ad5fe45 Mon Sep 17 00:00:00 2001 From: "danast.triangle" Date: Sat, 11 Sep 2021 11:47:03 +0300 Subject: [PATCH 04/20] updates --- pystrain/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pystrain/setup.py b/pystrain/setup.py index cb9a827..0ac15cd 100755 --- a/pystrain/setup.py +++ b/pystrain/setup.py @@ -5,7 +5,7 @@ description='Python Strain Tensor estimation tool.', url='https://github.com/DSOlab/StrainTool.git', author='Xanthos Papanikolaou, Dimitris Anastasiou', - author_email='xanthos@mail.ntua.gr, danast@mail.ntua.gr', + author_email='xanthos@mail.ntua.gr, dganastasiou@gmail.com', packages=setuptools.find_packages(),#['pystrain', 'pystrain.geodesy', 'pystrain.iotools'], install_requires=['numpy', 'scipy'] ) From a811f3f9b4201740c73472294941085a9d5371a6 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 11:52:17 +0300 Subject: [PATCH 05/20] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 25bfd2a..ad7e16c 100755 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ install: - sudo python pystrain/setup.py install # - pip install -r test/requirements.txt -script: +# script: # - bin/StrainTensor.py -i data/CNRS_midas.vel -r=18/30/34/43 -c -after_script: cd ~ +# after_script: cd ~ From fe5a6ede936bd3bc899806af6af3f5de4bab46f7 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 11:52:59 +0300 Subject: [PATCH 06/20] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad7e16c..f42b6fa 100755 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: include: - python: 2.7 dist: trusty - sudo: required + #sudo: required virtualenv: system_site_packages: true addons: @@ -26,7 +26,7 @@ before_script: - export PYTHONPATH=$PYTHONPATH:$(pwd)/pystrain install: - - sudo python pystrain/setup.py install + - python pystrain/setup.py install # - pip install -r test/requirements.txt # script: From 97a72fd2ff50a6db392fd4c5a253c55d1a0b1665 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 12:09:30 +0300 Subject: [PATCH 07/20] Update .travis.yml --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f42b6fa..4a27230 100755 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,8 @@ python: # - 3.4 # - 3.5 # - 3.6 - - 3.7 +# - 3.8 + - 3.9 matrix: include: - python: 2.7 @@ -29,7 +30,8 @@ install: - python pystrain/setup.py install # - pip install -r test/requirements.txt -# script: -# - bin/StrainTensor.py -i data/CNRS_midas.vel -r=18/30/34/43 -c +script: + - bin/StrainTensor.py --help + #- bin/StrainTensor.py -i data/CNRS_midas.vel -r=18/30/34/43 -c # after_script: cd ~ From a1283e2176549a8bc240a437edec7c0e79aa6c15 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 12:11:30 +0300 Subject: [PATCH 08/20] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4a27230..f72e3ac 100755 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ python: - 3.9 matrix: include: - - python: 2.7 + - python: 3.9 dist: trusty #sudo: required virtualenv: From 7743aea1f2c44376185dffb5019e729ff0408ce3 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 12:15:40 +0300 Subject: [PATCH 09/20] Update .travis.yml --- .travis.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index f72e3ac..b6a1ef3 100755 --- a/.travis.yml +++ b/.travis.yml @@ -2,17 +2,20 @@ language: python notifications: email: false sudo: true +language: python python: -# - 2.7 -# - 3.4 -# - 3.5 -# - 3.6 -# - 3.8 - - 3.9 + - "2.7" + - "3.4" + - "3.5" + - "3.6" # current default Python on Travis CI + - "3.7" + - "3.8" + - "3.9" + - "3.9-dev" # 3.9 development branch + - "nightly" # nightly build matrix: include: - - python: 3.9 - dist: trusty + - dist: trusty #sudo: required virtualenv: system_site_packages: true From 1e2e151586415b8db538883ac1093b5488b8c3b5 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 12:21:41 +0300 Subject: [PATCH 10/20] Update StrainTensor.py --- bin/StrainTensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/StrainTensor.py b/bin/StrainTensor.py index 3db53f0..31d6b76 100755 --- a/bin/StrainTensor.py +++ b/bin/StrainTensor.py @@ -160,8 +160,8 @@ class myFormatter( Dionysos Satellite Observatory\n Send bug reports to: Xanthos Papanikolaou, xanthos@mail.ntua.gr - Dimitris Anastasiou,danast@mail.ntua.gr -November, 2017''')) + Dimitris Anastasiou,dganastasiou@gmail.com +September, 2021''')) parser.add_argument('-i', '--input-file', default=argparse.SUPPRESS, From 716aa237f808d961158c76bb72c9cac595901687 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 12:23:26 +0300 Subject: [PATCH 11/20] Update .travis.yml --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index b6a1ef3..f83b204 100755 --- a/.travis.yml +++ b/.travis.yml @@ -5,14 +5,14 @@ sudo: true language: python python: - "2.7" - - "3.4" - - "3.5" - - "3.6" # current default Python on Travis CI - - "3.7" - - "3.8" +# - "3.4" +# - "3.5" +# - "3.6" # current default Python on Travis CI +# - "3.7" +# - "3.8" - "3.9" - - "3.9-dev" # 3.9 development branch - - "nightly" # nightly build +# - "3.9-dev" # 3.9 development branch +# - "nightly" # nightly build matrix: include: - dist: trusty @@ -25,7 +25,7 @@ matrix: - python-numpy - python-scipy before_script: - - export PYTHONPATH=$PYTHONPATH:/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages +# - export PYTHONPATH=$PYTHONPATH:/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages - export PYTHONPATH=$PYTHONPATH:$(pwd) - export PYTHONPATH=$PYTHONPATH:$(pwd)/pystrain From 6d0b220c7cf709a003ac43043a635cf51087af13 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 12:30:54 +0300 Subject: [PATCH 12/20] Update .travis.yml --- .travis.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index f83b204..dbff869 100755 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: python notifications: email: false sudo: true -language: python python: - "2.7" # - "3.4" @@ -19,11 +18,11 @@ matrix: #sudo: required virtualenv: system_site_packages: true - addons: - apt: - packages: - - python-numpy - - python-scipy +# addons: +# apt: +# packages: +# - python-numpy +# - python-scipy before_script: # - export PYTHONPATH=$PYTHONPATH:/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages - export PYTHONPATH=$PYTHONPATH:$(pwd) From 427e2ada0422c725086e88142a949ab704042239 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 12:35:21 +0300 Subject: [PATCH 13/20] Update .travis.yml --- .travis.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index dbff869..5debf50 100755 --- a/.travis.yml +++ b/.travis.yml @@ -12,12 +12,9 @@ python: - "3.9" # - "3.9-dev" # 3.9 development branch # - "nightly" # nightly build -matrix: - include: - - dist: trusty - #sudo: required - virtualenv: - system_site_packages: true + +virtualenv: + system_site_packages: true # addons: # apt: # packages: From 185fd5d2c231390bf281dd5965beff7d79ad63a7 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 12:40:42 +0300 Subject: [PATCH 14/20] Update .travis.yml --- .travis.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5debf50..c65a069 100755 --- a/.travis.yml +++ b/.travis.yml @@ -6,20 +6,25 @@ python: - "2.7" # - "3.4" # - "3.5" -# - "3.6" # current default Python on Travis CI + - "3.6" # current default Python on Travis CI # - "3.7" # - "3.8" - - "3.9" +# - "3.9" # - "3.9-dev" # 3.9 development branch # - "nightly" # nightly build -virtualenv: - system_site_packages: true +matrix: + include: + - dist: trusty + sudo: required + virtualenv: + system_site_packages: true # addons: # apt: # packages: # - python-numpy # - python-scipy + before_script: # - export PYTHONPATH=$PYTHONPATH:/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages - export PYTHONPATH=$PYTHONPATH:$(pwd) From 18d9bb90522b20414884092df2bda34d8aa2d71b Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 12:43:54 +0300 Subject: [PATCH 15/20] Update .travis.yml --- .travis.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index c65a069..e603afa 100755 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,10 @@ notifications: email: false sudo: true python: - - "2.7" +# - "2.7" # - "3.4" # - "3.5" - - "3.6" # current default Python on Travis CI +# - "3.6" # current default Python on Travis CI # - "3.7" # - "3.8" # - "3.9" @@ -15,15 +15,17 @@ python: matrix: include: - - dist: trusty + - python: 2.7 + dist: trusty sudo: required virtualenv: system_site_packages: true -# addons: -# apt: -# packages: -# - python-numpy -# - python-scipy + addons: + apt: + packages: + - python-numpy + - python-scipy + before_script: # - export PYTHONPATH=$PYTHONPATH:/home/travis/virtualenv/python2.7_with_system_site_packages/local/lib/python2.7/site-packages From 9ed1013ef9bbd89c1793d3c96b2f9e5ba1f4420e Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 12:49:40 +0300 Subject: [PATCH 16/20] Update .travis.yml --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e603afa..56c9659 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python notifications: email: false -sudo: true +#sudo: true python: # - "2.7" # - "3.4" @@ -15,9 +15,9 @@ python: matrix: include: - - python: 2.7 + - python: 3.9 dist: trusty - sudo: required + #sudo: required virtualenv: system_site_packages: true addons: From bdeea9b0b75639b5ef822611f9f1d0e32a39b727 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 12:51:34 +0300 Subject: [PATCH 17/20] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 56c9659..d11b56c 100755 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ python: matrix: include: - - python: 3.9 + - python: 3.6 dist: trusty #sudo: required virtualenv: From 0711a11afef87fce2b6229d4723ef838ce59202d Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 13:13:51 +0300 Subject: [PATCH 18/20] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d11b56c..73a15b3 100755 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ python: matrix: include: - - python: 3.6 + - python: 2.7 dist: trusty #sudo: required virtualenv: From a72227f4e6737e02f478cc6c93157bf39a43def4 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 13:18:43 +0300 Subject: [PATCH 19/20] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 301a221..bcabb15 100755 --- a/README.md +++ b/README.md @@ -78,12 +78,12 @@ That's it! The package modules should now be in place and you should be able to The following scenarios have been tested to validate the installation procedure -| OS |Python 2.7 | Python 3.6 | GMT 5.2 | GMT 5.4 -|:----------:|:------------------:|:------------------:|:------------------:|:------------------:| -| Fedora | :white_check_mark: | | :white_check_mark: | | -| Manjaro | | :white_check_mark: | :white_check_mark: | | -| Ubuntu | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| Windows 10 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| OS |Python 2.7 | Python 3.9 | GMT 5.2 | GMT 5.4 | GMT 6.0 +|:----------:|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:| +| Fedora | :white_check_mark: | | :white_check_mark: | |                   | +| Manjaro | | :white_check_mark: | :white_check_mark: | |                   | +| Ubuntu | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Windows 10 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | ## Example From 705557e033090361e9c02ff44e98ec35cbbc6934 Mon Sep 17 00:00:00 2001 From: DemAnasta Date: Sat, 11 Sep 2021 13:21:12 +0300 Subject: [PATCH 20/20] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bcabb15..039fb29 100755 --- a/README.md +++ b/README.md @@ -78,12 +78,12 @@ That's it! The package modules should now be in place and you should be able to The following scenarios have been tested to validate the installation procedure -| OS |Python 2.7 | Python 3.9 | GMT 5.2 | GMT 5.4 | GMT 6.0 -|:----------:|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:| -| Fedora | :white_check_mark: | | :white_check_mark: | |                   | -| Manjaro | | :white_check_mark: | :white_check_mark: | |                   | -| Ubuntu | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| Windows 10 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| OS |Python 2.7 | Python 3.6 | Python 3.9 | GMT 5.2 | GMT 5.4 | GMT 6.0 +|:----------:|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:| +| Fedora | :white_check_mark: | |                   | :white_check_mark: | |                   | +| Manjaro | | :white_check_mark: | :white_check_mark: | :white_check_mark: | | :white_check_mark: | +| Ubuntu | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Windows 10 | :white_check_mark: | :white_check_mark: |                  | :white_check_mark: | :white_check_mark: | :white_check_mark: | ## Example