Skip to content

Instantly share code, notes, and snippets.

@yuasatakayuki
yuasatakayuki / install_heasoft.sh
Last active September 3, 2020 18:49
Heasoft download, build, and install script
#!/bin/bash
cat << EOF
#============================================
# Heasoft download, build, and install script
#
# For the latest version of this script, visit the gist:
# https://gist.github.com/yuasatakayuki/8176d73f7e716f95587b
#
# This script uses the Heasoft mirror hosted at the JAXA/ISAS.
@yuasatakayuki
yuasatakayuki / go_xis_calculate_powerspectrum_for_intervals.sh
Created April 13, 2015 02:30
Suzaku/XIS powerspectrum calculation example (using interval-sliced event files)
# Calculates powerspectra of each interval
binTime=32
nbint=128
nintfm=20
function doProcess(){
if [ `hsStringIndex $outputFile 45` = -1 ]; then
xLabel="lab nx off"
else
@yuasatakayuki
yuasatakayuki / upload_file_to_mediawiki
Created March 7, 2015 13:56
Upload file to MediaWiki using Ruby Mechanize
#!/usr/bin/env ruby
if(ARGV.length<1)then
puts "Provide file to be uploaded."
exit
end
require "mechanize"
#check file
@yuasatakayuki
yuasatakayuki / fog_simpledb_put_get.rb
Last active August 29, 2015 14:13
Ruby Fog::AWS::SimpleDB Example
require "fog"
#Create a Fog AWS SimpleDB instance
sdb = Fog::AWS::SimpleDB.new(
:aws_access_key_id => "YOUR_ACCESS_KEY_ID",
:aws_secret_access_key => "YOUR_SECRET_ACCESS_KEY",
:region => "ap-northeast-1" #meaning "Tokyo"
)
#Create domain
@yuasatakayuki
yuasatakayuki / makeHistogram.C
Created November 7, 2014 17:02
create ROOT histogram from a text file containing entries
void makeHistogram(std::string fileName){
using namespace std;
ifstream ifs(fileName.c_str());
int pi;
TCanvas* c=new TCanvas("c","c",600,600);
TH1D* hist=new TH1D("hist",fileName.c_str(),2048,0,2048);
while(ifs.is_open() && !ifs.eof()){
ifs >> pi;
hist->Fill(pi);
}