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 python | |
| # Created 2015, Zack Gainsforth | |
| import sys | |
| if (len(sys.argv) < 2) or (sys.argv[1] in ['-h', '--help', '-?']): | |
| print "Usage is:\nPlotBrukerSpectrum.py filename.txt\nWhere filename.txt is the text output version of the spectrum output by Bruker's Esprit software." | |
| quit() | |
| import matplotlib.pyplot as plt | |
| import numpy as np |
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
| import numpy as np | |
| import re | |
| from StringIO import StringIO | |
| def GetChunkFromTextFile(FileName, StartStr, StopStr, skip_header=0, skip_footer=0, LastHit=True, DataType='array'): | |
| # DataType means we can extract the chunk and then turn it into: | |
| # 1) Numpy table 'numpy' | |
| # 2) return the raw text 'raw' | |
| DataType = DataType.lower() |
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
| 7z a -mx3 -mmt CoupledSubsOctTetB.7z CoupledSubsOctTetB | |
| mx3 is fast compression, but not super fast. | |
| mmt enables multithreading. |
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
| fluoredge: | |
| FluorEdge(height=~1, width=~1, center=~0, offset=avgy) = -height/pi*atan((x-center)/width)+offset | |
| FluorEdge(height=avgy, width=~1, center=~0) = -height/pi*atan((x-center)/width)+(height/2) |
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
| taring files on linux with exclusions. | |
| tar --exclude='CHG*' --exclude='LOCPOT' --exclude='WAVECAR' -cvzf Tr900.IBRION2.tar.gz Tr900.IBRION2/ |
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
| # coding: utf-8 | |
| # In[1]: | |
| # Created 2017, Zack Gainsforth | |
| get_ipython().magic('pylab qt') | |
| import sys, os | |
| import QuickPlot | |
| import matplotlib.pylab as pylab |
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
| def BinArray(S, bin=2): | |
| Sbin = S.reshape((16, int(S.shape[1]/bin), bin, int(S.shape[2]/bin), bin)).sum(axis=4).sum(axis=2) | |
| print('Binned Array Shape = ', Sbin.shape) | |
| imshow(Sbin[Mg_K]) | |
| colorbar() | |
| print('Al-K map mean: ', np.mean(Sbin[Al_K]), ', Al-K map max:', np.max(Sbin[Al_K])) | |
| return Sbin |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| #!/bin/bash | |
| # Load all the chandra data processing tools. | |
| #ciao | |
| # Note this script must already have run ciao | |
| # For each subdirectory, run the sherpa script to extract flux spectra. | |
| for onedir in $(ls -d */); do | |
| cd $onedir | |
| echo $onedir |