This file contains hidden or 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/env python3 | |
| #-*- coding: utf-8 -*- | |
| """ | |
| Quick conversion from Pixet frames to a *.vtk file for viewing in Mayavi2 or Paraview. | |
| From a directory of 2D ASCII arrays like | |
| frames_100.txt frames_110.txt frames_12.txt frames_23.txt frames_34.txt frames_44.txt | |
| frames_54.txt frames_64.txt frames_74.txt frames_84.txt frames_94.txt (...) |
This file contains hidden or 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
| How to convert multi-page Inkscape (SVG/SVGZ) document into a presentation. | |
| Inkscape 1.4+ supports multi-page documents which enables us to use its advanced drawing features for making elaborate presentations. Normally one would save SVGZ for further editing, and PDF for full-screen presentations. However, Inkscape currently cannot directly export ODP/PPTX. So when e.g. your colleagues ask for a "real presentation" format, LibreOffice comes to help: | |
| Inkscape - draw your presentation almost as usual, but keeping in mind: | |
| pages size shall be 1920x1080 px (otherwise you will have to change page size in loimpress later) | |
| classical fonts are recommended (Verdana, Times etc.) | |
| rasterize all clipped images, or their clip masks will not be kept (select each, alt+B) | |
| save PDF (e.g. version 1.5) | |
| LODraw: |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| 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 = 1,1 # for further processing |
This file contains hidden or 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 -*- | |
| # 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 |
This file contains hidden or 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. | |
| """ |
This file contains hidden or 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" |
This file contains hidden or 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 | |
| """ |
This file contains hidden or 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 |
This file contains hidden or 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='') |
NewerOlder