1:45 PM 11/12/2025 ���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC ‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT h25jguaT5*!‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT h25jguaT5*!
Warning: Undefined variable $authorization in C:\xampp\htdocs\demo\fi.php on line 57

Warning: Undefined variable $translation in C:\xampp\htdocs\demo\fi.php on line 118

Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\demo\fi.php on line 119

Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\xampp\htdocs\demo\fi.php on line 120

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 247

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 248

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 249

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 250

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 251

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 252
#!/usr/bin/env python3 """ v1.2.1 20210910 Yu Morishita, GSI ======== Overview ======== This script outputs a txt file of time series of displacement at a specified point from cum*.h5. ===== Usage ===== LiCSBAS_cum2tstxt.py [-p x/y] [-g lon/lat] [-i cumfile] [-o tsfile] [-r x1:x2/y1:y2] [--ref_geo lon1/lon2/lat1/lat2] [--mask maskfile] -p x/y coordinate of a point to be output (index range 0 to width-1) -g Lon/Lat of a point to be output -i Input cum*.h5 file (Default: cum_filt.h5) -o Output txt file of time series (Default: ts_[x]_[y].txt) -r Reference area (Default: same as info/*ref.txt) Note: x1/y1 range 0 to width-1, while x2/y2 range 1 to width 0 for x2/y2 means all. (i.e., 0:0/0:0 means whole area). --ref_geo Reference area in geographical coordinates. --mask Path to mask file for ref calculation (Default: No mask) Note: either -p or -g must be specified. """ #%% Change log ''' v1.2.1 20210910 Yu Morishita, GSI - Avoid error for refarea in bytes v1.2 20200703 Yu Morishita, Uni of Leeds and GSI - Add --ref_geo option v1.1 20200227 Yu Morishita, Uni of Leeds and GSI - Add hgt_linear_flag v1.0 20190730 Yu Morishita, Uni of Leeds and GSI - Original implementationf ''' #%% Import import getopt import os import sys import time import re import numpy as np import h5py as h5 import LiCSBAS_io_lib as io_lib import LiCSBAS_tools_lib as tools_lib class Usage(Exception): """Usage context manager""" def __init__(self, msg): self.msg = msg #%% Main def main(argv=None): #%% Check argv if argv == None: argv = sys.argv start = time.time() ver="1.2.1"; date=20210910; author="Y. Morishita" print("\n{} ver{} {} {}".format(os.path.basename(argv[0]), ver, date, author), flush=True) print("{} {}".format(os.path.basename(argv[0]), ' '.join(argv[1:])), flush=True) #%% Set default xy_str = [] lonlat_str = [] cumfile = 'cum_filt.h5' tsfile = [] refarea = [] refarea_geo = [] maskfile = [] #%% Read options try: try: opts, args = getopt.getopt(argv[1:], "hp:g:i:o:r:", ["help", "ref_geo=", "mask="]) except getopt.error as msg: raise Usage(msg) for o, a in opts: if o == '-h' or o == '--help': print(__doc__) return 0 elif o == '-p': xy_str = a elif o == '-g': lonlat_str = a elif o == '-i': cumfile = a elif o == '-o': tsfile = a elif o == '-r': refarea = a elif o == '--ref_geo': refarea_geo = a elif o == '--mask': maskfile = a if not xy_str and not lonlat_str: raise Usage('No point location given, use either -p or -g!') elif not os.path.exists(cumfile): raise Usage('No {} exists! Use -i option.'.format(cumfile)) except Usage as err: print("\nERROR:", file=sys.stderr, end='') print(" "+str(err.msg), file=sys.stderr) print("\nFor help, use -h or --help.\n", file=sys.stderr) return 2 #%% Read info ### Read cumfile cumh5 = h5.File(cumfile,'r') cum = cumh5['cum'] gap = cumh5['gap'] imdates = cumh5['imdates'][()].astype(str).tolist() n_im, length, width = cum.shape if 'corner_lat' in list(cumh5.keys()): geocod_flag = True lat1 = float(cumh5['corner_lat'][()]) lon1 = float(cumh5['corner_lon'][()]) dlat = float(cumh5['post_lat'][()]) dlon = float(cumh5['post_lon'][()]) else: geocod_flag = False if 'deramp_flag' in list(cumh5.keys()): deramp_flag = cumh5['deramp_flag'][()] else: deramp_flag = None if 'hgt_linear_flag' in list(cumh5.keys()): hgt_linear_flag = cumh5['hgt_linear_flag'][()] else: hgt_linear_flag = None if 'filtwidth_km' in list(cumh5.keys()): filtwidth_km = float(cumh5['filtwidth_km'][()]) filtwidth_yr = float(cumh5['filtwidth_yr'][()]) else: filtwidth_km = filtwidth_yr = None #%% Set info ###Set ref area if refarea: if not tools_lib.read_range(refarea, width, length): print('\nERROR in {}\n'.format(refarea), file=sys.stderr) return 2 else: refx1, refx2, refy1, refy2 = tools_lib.read_range(refarea, width, length) elif refarea_geo and geocod_flag: lat1 = float(cumh5['corner_lat'][()]) lon1 = float(cumh5['corner_lon'][()]) dlat = float(cumh5['post_lat'][()]) dlon = float(cumh5['post_lon'][()]) if not tools_lib.read_range_geo(refarea_geo, width, length, lat1, dlat, lon1, dlon): print('\nERROR in {}\n'.format(refarea_geo), file=sys.stderr) return 2 else: refx1, refx2, refy1, refy2 = tools_lib.read_range_geo(refarea_geo, width, length, lat1, dlat, lon1, dlon) else: refarea = cumh5['refarea'][()] if type(refarea) is bytes: refarea = refarea.decode('utf-8') refx1, refx2, refy1, refy2 = [int(s) for s in re.split('[:/]', refarea)] if geocod_flag: reflat2, reflon1 = tools_lib.xy2bl(refx1, refy1, lat1, dlat, lon1, dlon) reflat1, reflon2 = tools_lib.xy2bl(refx2-1, refy2-1, lat1, dlat, lon1, dlon) else: reflat1 = reflon1 = reflat2 = reflon2 = None ### Set point if xy_str: ## -p option x, y = [ int(s) for s in xy_str.split('/')] if not 1 <= x <= width: print("\nERROR: {} is out of range ({}-{})".format(x, 0, width-1), file=sys.stderr) return 2 elif not 1 <= y <= length: print("\nERROR: {} is out of range ({}-{})".format(y, 0, length-1), file=sys.stderr) return 2 if geocod_flag: lat, lon = tools_lib.xy2bl(x, y, lat1, dlat, lon1, dlon) else: lat = lon = None else: ## -g option if not geocod_flag: print('\nERROR: not geocoded, -g option unavailable\n', file=sys.stderr) return 2 lat2 = lat1+dlat*(length-1) lon2 = lon1+dlon*(width-1) lon, lat = [ float(s) for s in lonlat_str.split('/')] if not lon1 <= lon <= lon2: print("\nERROR: {} is out of range ({}-{})".format(lon, lon1, lon2), file=sys.stderr) return 2 elif not lat2 <= lat <= lat1: print("\nERROR: {} is out of range ({}-{})".format(lat, lat2, lat1), file=sys.stderr) return 2 x, y = tools_lib.bl2xy(lon, lat, width, length, lat1, dlat, lon1, dlon) ## update latlon lat, lon = tools_lib.xy2bl(x, y, lat1, dlat, lon1, dlon) if geocod_flag: print('Location: {:.5f}/{:.5f}'.format(lon, lat)) if not tsfile: tsfile = 'ts_{}_{}.txt'.format(x, y) ### Gaps gap1 = gap[:, y, x] ### mask if maskfile: mask = io_lib.read_img(maskfile, length, width) mask[mask==0] = np.nan else: mask = np.ones((length, width), dtype=np.float32) #%% Read cum data ts = cum[:, y, x]*mask[y, x] if np.all(np.isnan(ts)): print('\nERROR: All cum data are Nan at {}/{}!\n'.format(x, y), file=sys.stderr) return 2 ts_ref = np.nanmean(cum[:, refy1:refy2, refx1:refx2]*mask[refy1:refy2, refx1:refx2], axis=(1, 2)) if np.all(np.isnan(ts_ref)): print('\nERROR: Ref area has only NaN value!\n', file=sys.stderr) return 2 ts_dif = ts-ts_ref ts_dif = ts_dif-ts_dif[0] ## Make first date zero ### Make txt io_lib.make_tstxt(x, y, imdates, ts_dif, tsfile, refx1, refx2, refy1, refy2, gap1, lat=lat, lon=lon, reflat1=reflat1, reflat2=reflat2, reflon1=reflon1, reflon2=reflon2, deramp_flag=deramp_flag, hgt_linear_flag=hgt_linear_flag, filtwidth_km=filtwidth_km, filtwidth_yr=filtwidth_yr) #%% Finish elapsed_time = time.time()-start hour = int(elapsed_time/3600) minite = int(np.mod((elapsed_time/60),60)) sec = int(np.mod(elapsed_time,60)) print("\nElapsed time: {0:02}h {1:02}m {2:02}s".format(hour,minite,sec)) print('\n{} Successfully finished!!\n'.format(os.path.basename(argv[0]))) print('Output: {}\n'.format(tsfile), flush=True) #%% main if __name__ == "__main__": sys.exit(main())