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
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); | |
} |
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
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 |
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/env ruby | |
if(ARGV.length<1)then | |
puts "Provide file to be uploaded." | |
exit | |
end | |
require "mechanize" | |
#check file |
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
# Calculates powerspectra of each interval | |
binTime=32 | |
nbint=128 | |
nintfm=20 | |
function doProcess(){ | |
if [ `hsStringIndex $outputFile 45` = -1 ]; then | |
xLabel="lab nx off" | |
else |
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
#!/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. |
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
#--------------------------------------------- | |
# CMakeLists.txt for sfitsio | |
#--------------------------------------------- | |
CMAKE_MINIMUM_REQUIRED(VERSION 2.4) | |
SET(CMAKE_C_FLAGS_RELEASE "-Wall -O3") | |
SET(CMAKE_C_FLAGS_DEBUG "-g") | |
SET(CMAKE_BUILD_TYPE Release) |
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
#--------------------------------------------- | |
# CMakeLists.txt for sllib | |
#--------------------------------------------- | |
CMAKE_MINIMUM_REQUIRED(VERSION 2.4) | |
SET(CMAKE_C_FLAGS_RELEASE "-Wall -O3") | |
SET(CMAKE_C_FLAGS_DEBUG "-g") | |
SET(CMAKE_BUILD_TYPE Release) |
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
/* | |
* Before running this program, execute the following initialization command: | |
* > gpio load spi | |
* | |
* Expected result: | |
* > pi@raspberrypi:~$ ./read_mcp3208 | |
* | |
* wiringPiSPISetup status = 3 | |
* wiringPiSPIDataRW status = 3 | |
* data[0]=00 |
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
require "RubyROOT" | |
include Root | |
include RootApp | |
inputFile="histogram_sample.data" | |
outputPDFFile="histogram_sample.pdf" | |
#create an instance of histogram | |
hist=TH1D.create("hist","Histogram",512,0,512) |
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/ruby | |
# This script dumps data contained in a FITS Table HDU into a CSV file using RubyFits. | |
# Usage: | |
# ruby conver_fits_to_csv.rb FITS_FILE | |
# Output: | |
# - Header: FITS_FILE_n_header_HDU_NAME | |
# - Data : FITS_FILE_n_data_HDU_NAME | |
# (n is HDU index) |
OlderNewer