Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • software_public/passoft/sohstationviewer
1 result
Show changes
Commits on Source (48)
Showing
with 90 additions and 56 deletions
...@@ -23,3 +23,12 @@ an Event channel ...@@ -23,3 +23,12 @@ an Event channel
input input
* Improved the ability to calculate the size of a data set * Improved the ability to calculate the size of a data set
* General bug fixes * General bug fixes
2024.2.1.0
--------
* Add reset button to database editors
* Add ability to add new channels to the database from the plot
* Add ability to edit a channel's plotting information from the plot
* Change the size of the main information box
* Bug fixes
package: package:
name: sohviewer name: sohviewer
version: 2024.2.0.0 version: 2024.2.1.0
source: source:
path: ../ path: ../
......
...@@ -51,6 +51,6 @@ setup( ...@@ -51,6 +51,6 @@ setup(
name='sohviewer', name='sohviewer',
packages=find_packages(include=['sohstationviewer*']), packages=find_packages(include=['sohstationviewer*']),
url='https://git.passcal.nmt.edu/software_public/passoft/sohstationviewer', url='https://git.passcal.nmt.edu/software_public/passoft/sohstationviewer',
version='2024.2.0.0', version='2024.2.1.0',
zip_safe=False, zip_safe=False,
) )
import os
from pathlib import Path
from typing import Literal from typing import Literal
# The path to the package's root
ROOT_PATH = Path(os.path.abspath(__file__)).parent.parent
# The current version of SOHStationViewer # The current version of SOHStationViewer
SOFTWARE_VERSION = '2024.2.0.0' SOFTWARE_VERSION = '2024.2.1.0'
# waveform pattern # waveform pattern
WF_1ST = 'A-HLM-V' WF_1ST = 'A-HLM-V'
...@@ -109,7 +114,8 @@ TPS_WIDTH_NORMALIZE = 1 - (TPS_LEFT_NORMALIZE + TPS_RIGHT_NORMALIZE) ...@@ -109,7 +114,8 @@ TPS_WIDTH_NORMALIZE = 1 - (TPS_LEFT_NORMALIZE + TPS_RIGHT_NORMALIZE)
# Order to show plotting items on top of each other. The higher value, the # Order to show plotting items on top of each other. The higher value, the
# the higher priority # the higher priority
Z_ORDER = {'AXIS_SPINES': 0, 'CENTER_LINE': 1, 'LINE': 2, 'GAP': 3, 'DOT': 3} Z_ORDER = {'AXIS_SPINES': 0, 'CENTER_LINE': 1, 'LINE': 2, 'GAP': 3, 'DOT': 3,
'TPS_MARKER': 4}
# Distance from 'Hour' label to timestamp bar # Distance from 'Hour' label to timestamp bar
HOUR_TO_TMBAR_D = 50 HOUR_TO_TMBAR_D = 50
......
...@@ -16,33 +16,6 @@ dbConf = { ...@@ -16,33 +16,6 @@ dbConf = {
'seisRE': re.compile(f'[{WF_1ST}][{WF_2ND}][{WF_3RD}]'), 'seisRE': re.compile(f'[{WF_1ST}][{WF_2ND}][{WF_3RD}]'),
# key is last char of chan # key is last char of chan
'seisLabel': {'1': 'NS', '2': 'EW', 'N': 'NS', 'E': 'EW', 'Z': 'V'}, 'seisLabel': {'1': 'NS', '2': 'EW', 'N': 'NS', 'E': 'EW', 'Z': 'V'},
# +0.2:Y
'multiColorDots': {
'pattern': re.compile('^\+?\-?[0-9]+\.?[0-9]?:[RYGMWC_]'), # noqa: W605,E501
'instruction': (
"Colors include: RYGMCW\n"
"Ex: *:W means everything with white color\n",
"Ex: -1:_|0:R|2.3:Y|+2.3:G means:\n"
" value <= -1 => not plot\n"
" value <= 0 => plot with R color\n"
" value <= 2.3 => plot with Y color\n"
" value > 2.3 => plot with G color")},
'upDownDots': {
'pattern': re.compile("^[01]:[WRYGMC]$"),
'instruction': (
"Colors include: RYGMCW\n"
"Ex: 1:Y|0:R means:\n"
" value == 1 => plot above center line with Y color\n"
" value == 0 => plot under center line with R color")},
'linesDots': {
'pattern': re.compile('^[LD]:[WRYGMC]$'),
'instruction': (
"Colors include: RYGMCW\n"
"Ex: L:G|D:W means\n"
" Lines are plotted with color G\n"
" Dots are plotted with color W\n"
"If D is not defined, dots won't be displayed.\n"
"If L is not defined, lines will be plotted with color G")}
} }
......
...@@ -149,39 +149,38 @@ def get_time_6_4y(time_str: str) -> Tuple[float, int]: ...@@ -149,39 +149,38 @@ def get_time_6_4y(time_str: str) -> Tuple[float, int]:
return utc_time.timestamp, time.year return utc_time.timestamp, time.year
def get_time_4(time_str: str, tracking_year: int, y_added: bool def get_time_4(time_str: str, nearest_prior_epoch: float) -> float:
) -> Tuple[float, int, bool]:
""" """
Get time from 4 parts string. (day of year:hour:minute:second) Get time from 4 parts string (day of year:hour:minute:second). If the day
of year in the time string is smaller than the
Ex: 253:19:41:42 Ex: 253:19:41:42
:param time_str: time string :param time_str: time string
:param tracking_year: year that has been detected :param nearest_prior_epoch: the nearest epoch time detected
:param y_added: flag to tell if year has been plussed 1 or not :return: the epoch time parsed from time_str
:return: """
+ utc_time.timestamp: epoch time nearest_utcdatetime = UTCDateTime(nearest_prior_epoch)
+ time.year: year year = nearest_utcdatetime.year
+ y_added: flag to tell if year has been plussed 1 or not nearest_doy = nearest_utcdatetime.julday
""" time_str_doy = int(time_str[:3])
if not y_added: if nearest_doy > time_str_doy:
# first day => move to next year year += 1
doy = int(time_str.split(':')[0]) time_str = f'{str(year)}:{time_str}'
if doy == 1:
tracking_year += 1
y_added = True
time_str = f'{str(tracking_year)}:{time_str}'
time = datetime.strptime(time_str, "%Y:%j:%H:%M:%S") time = datetime.strptime(time_str, "%Y:%j:%H:%M:%S")
utc_time = UTCDateTime(time) return UTCDateTime(time).timestamp
return utc_time.timestamp, time.year, y_added
def get_val(text: str) -> float: def get_val(text: str) -> float:
""" """
Get the value part of a string with non-number substring following. Get the value part of a string. Examples:
:param text: value string including unit - 6.5V -> 6.5
- <=2.2 -> 2.2
- <2 -> 2.0
- 6m -> 6.0
:param text: value string.
:return: value part including +/-, remove str that follows :return: value part including +/-, remove str that follows
and remove '=' prefix and remove '<' and '=' characters
""" """
text = text.replace('=', '') text = text.replace('=', '').replace('<', '')
re_val = '^\+?\-?[0-9]+\.?[0-9]?' # noqa: W605 re_val = '^\+?\-?[0-9]+\.?[0-9]?' # noqa: W605
return float(re.search(re_val, text).group()) return float(re.search(re_val, text).group())
...@@ -288,6 +287,8 @@ def rt130_find_cf_dass(root_dir: str) -> Dict[str, List[Path]]: ...@@ -288,6 +287,8 @@ def rt130_find_cf_dass(root_dir: str) -> Dict[str, List[Path]]:
root_dir += os.sep root_dir += os.sep
day_dirs = os.listdir(root_dir) day_dirs = os.listdir(root_dir)
for day_dir in day_dirs: for day_dir in day_dirs:
if day_dir.startswith('.'):
continue
if len(day_dir) == 7 and day_dir.isdigit(): if len(day_dir) == 7 and day_dir.isdigit():
# check for directory with format YYYYDOY: 7 digits # check for directory with format YYYYDOY: 7 digits
try: try:
...@@ -301,6 +302,8 @@ def rt130_find_cf_dass(root_dir: str) -> Dict[str, List[Path]]: ...@@ -301,6 +302,8 @@ def rt130_find_cf_dass(root_dir: str) -> Dict[str, List[Path]]:
if das_dir not in das_dict.keys(): if das_dir not in das_dict.keys():
das_dict[das_dir] = [] das_dict[das_dir] = []
das_dict[das_dir].append(das_path) das_dict[das_dir].append(das_path)
else:
return {}
return das_dict return das_dict
...@@ -419,3 +422,43 @@ def get_valid_file_count(list_of_dir: Path) -> int: ...@@ -419,3 +422,43 @@ def get_valid_file_count(list_of_dir: Path) -> int:
total += len([f for f in files total += len([f for f in files
if validate_file(Path(path).joinpath(f), f)]) if validate_file(Path(path).joinpath(f), f)])
return total return total
def _format_time_item(
unit: str, value: Union[int, float], time_list: List[str]):
"""
Append the format string of time item to time_list if not zero
:param unit: a time unit (day/hour/minute/second)
:param value: value of the time item
:param time_list: list of different formatted time item
"""
if value == 0:
return
else:
formatted = f"{value} {unit}"
if value > 1:
formatted += 's'
time_list.append(formatted)
def get_formatted_time_delta(time_delta: float) -> str:
"""
Convert time_delta in seconds into formatted string of
(days, hours, minutes, seconds)
:param time_delta: length of time delta in seconds
:return formatted string of time delta
"""
time_list = []
days = int(time_delta // 86400)
_format_time_item('day', days, time_list)
hours = int((time_delta - days * 86400) // 3600)
_format_time_item('hour', hours, time_list)
minutes = int((time_delta - days * 86400 - hours * 3600) // 60)
_format_time_item('minute', minutes, time_list)
seconds = time_delta - days * 86400 - hours * 3600 - minutes * 60
_format_time_item('second', seconds, time_list)
if not time_list:
return "0.0 seconds"
else:
return " ".join(time_list)
...@@ -25,7 +25,7 @@ def get_chan_plot_info(org_chan_id: str, data_type: str, ...@@ -25,7 +25,7 @@ def get_chan_plot_info(org_chan_id: str, data_type: str,
chan = org_chan_id chan = org_chan_id
chan = convert_actual_channel_to_db_channel_w_question_mark(chan) chan = convert_actual_channel_to_db_channel_w_question_mark(chan)
if org_chan_id.startswith('DS'): if len(org_chan_id) == 3 and org_chan_id.startswith('DS'):
chan = 'SEISMIC' chan = 'SEISMIC'
if dbConf['seisRE'].match(chan): if dbConf['seisRE'].match(chan):
chan = 'SEISMIC' chan = 'SEISMIC'
......
No preview for this file type
...@@ -40,9 +40,12 @@ Highlight the previous found text and the view roll to its position. ...@@ -40,9 +40,12 @@ Highlight the previous found text and the view roll to its position.
+ <img alt="Search Next" src="images/help/search_next.png" width="30" /> **Search Next**: + <img alt="Search Next" src="images/help/search_next.png" width="30" /> **Search Next**:
Highlight the next found text and the view roll to its position. Highlight the next found text and the view roll to its position.
+ <img alt="Search Next" src="images/help/search_results.png" width="30" /> **Navigate to Search Through All Documents**: + <img alt="Search Through All Documents" src="images/help/search_results.png" width="30" /> **Navigate to Search Through All Documents**:
Go to 'Search Through All Documents' result page. Go to 'Search Through All Documents' result page.
+ <img alt="Save Current Help Document" src="images/help/save.png" width="30" /> **Save Current Help Document**:
Open a file dialog in the '~/Documents/' directory, which will prompt user to provide a name for saving the current help document.
<br /> <br />
### Document list ### Document list
......
sohstationviewer/documentation/images/database_tables/channels.png

87.6 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/channels.png

78.4 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/channels.png
sohstationviewer/documentation/images/database_tables/channels.png
sohstationviewer/documentation/images/database_tables/channels.png
sohstationviewer/documentation/images/database_tables/channels.png
  • 2-up
  • Swipe
  • Onion skin
sohstationviewer/documentation/images/database_tables/data_types.png

61.4 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/data_types.png

59.4 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/data_types.png
sohstationviewer/documentation/images/database_tables/data_types.png
sohstationviewer/documentation/images/database_tables/data_types.png
sohstationviewer/documentation/images/database_tables/data_types.png
  • 2-up
  • Swipe
  • Onion skin
sohstationviewer/documentation/images/database_tables/default_channel.png

58.3 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/default_channel.png

82.5 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/default_channel.png
sohstationviewer/documentation/images/database_tables/default_channel.png
sohstationviewer/documentation/images/database_tables/default_channel.png
sohstationviewer/documentation/images/database_tables/default_channel.png
  • 2-up
  • Swipe
  • Onion skin
sohstationviewer/documentation/images/database_tables/parameters.png

107 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/parameters.png

163 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/parameters.png
sohstationviewer/documentation/images/database_tables/parameters.png
sohstationviewer/documentation/images/database_tables/parameters.png
sohstationviewer/documentation/images/database_tables/parameters.png
  • 2-up
  • Swipe
  • Onion skin
sohstationviewer/documentation/images/database_tables/parameters_change_color_mode.jpeg

76.7 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/parameters_change_color_mode.jpeg

74.1 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/parameters_change_color_mode.jpeg
sohstationviewer/documentation/images/database_tables/parameters_change_color_mode.jpeg
sohstationviewer/documentation/images/database_tables/parameters_change_color_mode.jpeg
sohstationviewer/documentation/images/database_tables/parameters_change_color_mode.jpeg
  • 2-up
  • Swipe
  • Onion skin
sohstationviewer/documentation/images/database_tables/plot_types.png

67 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/plot_types.png

64.1 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/database_tables/plot_types.png
sohstationviewer/documentation/images/database_tables/plot_types.png
sohstationviewer/documentation/images/database_tables/plot_types.png
sohstationviewer/documentation/images/database_tables/plot_types.png
  • 2-up
  • Swipe
  • Onion skin
sohstationviewer/documentation/images/gps_dialog/after_click_on_export_directory_button.jpeg

141 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/gps_dialog/after_click_on_export_directory_button.jpeg

93.5 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/gps_dialog/after_click_on_export_directory_button.jpeg
sohstationviewer/documentation/images/gps_dialog/after_click_on_export_directory_button.jpeg
sohstationviewer/documentation/images/gps_dialog/after_click_on_export_directory_button.jpeg
sohstationviewer/documentation/images/gps_dialog/after_click_on_export_directory_button.jpeg
  • 2-up
  • Swipe
  • Onion skin
sohstationviewer/documentation/images/help/save.png

2.49 KiB

sohstationviewer/documentation/images/ruler_and_zooming/tps_zooming.png

47.3 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/ruler_and_zooming/tps_zooming.png

75.1 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/ruler_and_zooming/tps_zooming.png
sohstationviewer/documentation/images/ruler_and_zooming/tps_zooming.png
sohstationviewer/documentation/images/ruler_and_zooming/tps_zooming.png
sohstationviewer/documentation/images/ruler_and_zooming/tps_zooming.png
  • 2-up
  • Swipe
  • Onion skin
sohstationviewer/documentation/images/select_soh/full_row.png

38.1 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/select_soh/full_row.png

34 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/select_soh/full_row.png
sohstationviewer/documentation/images/select_soh/full_row.png
sohstationviewer/documentation/images/select_soh/full_row.png
sohstationviewer/documentation/images/select_soh/full_row.png
  • 2-up
  • Swipe
  • Onion skin
sohstationviewer/documentation/images/select_soh/soh_channel_preferences.png

312 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/select_soh/soh_channel_preferences.png

346 KiB | W: 0px | H: 0px

sohstationviewer/documentation/images/select_soh/soh_channel_preferences.png
sohstationviewer/documentation/images/select_soh/soh_channel_preferences.png
sohstationviewer/documentation/images/select_soh/soh_channel_preferences.png
sohstationviewer/documentation/images/select_soh/soh_channel_preferences.png
  • 2-up
  • Swipe
  • Onion skin