Skip to content

Instantly share code, notes, and snippets.

View FilipDominec's full-sized avatar
🙂

Filip Dominec FilipDominec

🙂
View GitHub Profile
@FilipDominec
FilipDominec / a44_config.txt
Created November 13, 2024 14:20
Control software for the SEM/CL setup at FZU in the A44 lab - updated for rp2daq
vpos_panchro = 4230
vpos_spectro = 1180
vpos_monochro = 110
calib1_nm = 27.1
calib1_stepper = 0
calib2_nm = 653.3
calib2_stepper = 100000
min_limit_nm = 100
max_limit_nm = 1000
@FilipDominec
FilipDominec / streak_camera_analysis_snippet.py
Last active November 15, 2024 17:55
Streak Camera Analysis python snippet for nihilnovi
SIDEPLOTS = 0.0 # defaults 0.15 of width & height; set to 0 to disable them
FONTSIZE = 20
SIDEPLOTS = 0.15; FONTSIZE = 18 # defaults 0.15 of width & height; set to 0 to disable them
SIDELEGENDS = False # True is useful for small fonts & big plots only
SAVEPLOT = True
SAVEDECAYS, SAVESPECTRA = False, False # for further processing
@FilipDominec
FilipDominec / Horiba_Labspec_Raman_map_analysis.py
Created September 27, 2023 13:37
Visualise 2D maps from the Horiba Evolution confocal Raman microscope/spectrometer
#!/usr/bin/python3
#-*- coding: utf-8 -*-
# Visualise 2D maps from the Horiba Evolution confocal Raman microscope/spectrometer (needs converting .L6M to .TXT)
## Import common moduli
import sys, os, time, collections
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
#from scipy.constants import c, hbar, pi
#!/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.
"""
@FilipDominec
FilipDominec / wrong_charset_detection.py
Created June 28, 2022 15:06
Searches for such charset conversion, which would generate a wrong encoded string from a known correct one
#!/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"
@FilipDominec
FilipDominec / convert_rwd8_to_txt.py
Created February 25, 2022 17:21
Convert binary .RWD8 format from Avaspec spectrometers into a text file and graphical plots
#!/usr/bin/python3
#-*- coding: utf-8 -*-
## Import common moduli
import sys
import matplotlib.pyplot as plt
import numpy as np
import struct
"""
@FilipDominec
FilipDominec / numpy2tkinter.py
Last active January 26, 2023 12:15
Easy plotting from 2D numpy array, supporting colormaps, embossing, (un)zooming etc. Depends on TkInter + numpy only.
#!/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
@FilipDominec
FilipDominec / encoding_detection_for_html.py
Created October 19, 2021 17:35
Helps to fix diacritics mess in legacy websites. Uses the chardet module to detect character encoding; accepts multiple files to print a table
#!/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='')
@FilipDominec
FilipDominec / journalList.txt
Created January 24, 2020 17:42
journalList.txt
"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.
@FilipDominec
FilipDominec / multifit.py
Last active February 28, 2019 15:26
Loads ASCII-exported spectra from Princeton spectrometer, exports "worm plot" of spectral position and intensity of the peak
#!/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