View explore_liborigins_object.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#-*- coding: utf-8 -*- | |
""" | |
Invocation: | |
explore_liborigins_object.py file.opj | |
Results in recursive printout of all the nested structure of the object provided by liborigin. | |
Code can be modified and reused for other complex objects. | |
""" |
View wrong_charset_detection.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#-*- coding: utf-8 -*- | |
# Searches for such charset conversion, which would generate a wrong encoded string from a known correct one | |
# Public domain, written by Filip Dominec 2022 | |
# EXAMPLES: | |
#wrong, correct = "╪ konstrukЯnб ¤eчenб", "ě konstrukční řešení" | |
#wrong, correct = "slouÄeninovĂ˝ch", "sloučeninových" |
View convert_rwd8_to_txt.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#-*- coding: utf-8 -*- | |
## Import common moduli | |
import sys | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import struct | |
""" |
View numpy2tkinter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#-*- coding: utf-8 -*- | |
# License: This code is released as public domain. | |
import time | |
import numpy as np | |
import tkinter as tk | |
X_SIZE, Y_SIZE = 200, 200 |
View encoding_detection_for_html.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#-*- coding: utf-8 -*- | |
import chardet, pathlib, sys | |
known_enc = {'Win':'Windows-1250', 'ISO':'ISO-8859-2', '1250':'Windows-1250', 'utf':'utf8' } | |
for fn in sys.argv[1:]: | |
found_enc = chardet.detect(pathlib.Path(fn).read_bytes())['encoding'] | |
if found_enc[:3] in known_enc.keys(): | |
found_enc = known_enc[found_enc[:3]] | |
print(f'{fn:20s} auto-detected encoding {found_enc:14s}', end='') |
View journalList.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Meteor" Forschungsergebnisse = "Meteor" Forschungsergeb. | |
2D Materials = 2D Mater. | |
3D Printing and Additive Manufacturing = 3D Print. Addit. Manuf. | |
AACN Clinical Issues = AACN Clin. Issues | |
AACN Clinical Issues in Critical Care Nursing = AACN Clin. Issues Crit. Care Nurs. | |
AADE Editors Journal = AADE Ed. J. | |
AANA Journal = AANA J. | |
AANNT Journal = AANNT J. | |
AAOHN Journal = AAOHN J. | |
AAPG Bulletin = AAPG Bull. |
View multifit.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#-*- coding: utf-8 -*- | |
""" | |
Batch fitting of multiple spectra - evaluation of spectroscopic response of InGaN/GaN quantum-well sensors to the | |
presence of surface charges induced by gases or liquids. | |
Invocation: | |
./multifit.py <filename>.dat | |
where |
View labbook_xls_filter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#-*- coding: utf-8 -*- | |
""" | |
Parses one or more XLS files, each containing arbitrary number of sheets, and filters all rows for a | |
pattern as determined by filter_lines=... below. Prints matching names. | |
Typical invocation | |
python3 ./xlsfilter.py *201{6,7,8}.{1,2}.xlsx | vi - |
View file_splitter_by_search.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#-*- coding: utf-8 -*- | |
import re, sys | |
with open(sys.argv[1]) as inputf: | |
c = 1 | |
ls = inputf.readlines() | |
fromline = 1 | |
for splitter in sys.argv[2:]: |
View RPSDF.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
#-*- coding: utf-8 -*- | |
## Import common moduli | |
import matplotlib, sys, os, time | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from scipy.constants import c, hbar, pi | |
from scipy.misc import imread |
NewerOlder