Skip to content

Commit

Permalink
updated README and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
santiagohenao committed Aug 1, 2019
1 parent 920ae22 commit fc5b11a
Show file tree
Hide file tree
Showing 3 changed files with 1,025 additions and 104 deletions.
10 changes: 7 additions & 3 deletions Main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ while n > 0
global n = n - 1
end

# read data from workers output
data=[read_float_table("$i.dat") for i in workers()]


Expand All @@ -107,21 +108,24 @@ periods=vcat([i[3,:] for i in data]...)
ephemerides=vcat([i[4,:] for i in data]...)
qualities=vcat([i[5,:] for i in data]...)

# remove workers output
for i in workers()
rm("$i.dat")
end


# sort data by star_id
sorted_data=sortslices(hcat(star_numbers,exec_times,periods,ephemerides,qualities);dims=1,by = x -> x[1])

# write sorted data
file=open("results.dat",append=true)

for i in 1:length(sorted_data[:,1])
write(file,join(sorted_data[i,:]," ")*"\n")
end

println("CPU time: ",r5(sum(exec_times)))
println("elapsed: ",r5(time()-start))
# Comparison between CPU and elapsed time
println("CPU:\t",r5(sum(exec_times)))
println("elapsed:\t",r5(time()-start))



Expand Down
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,26 @@

Non Uniform Discrete Fourier Transform applied to OGLE-III Type 1 Cepheid photometry database.

### Data References
## Usage

* Udalski, Szymański, Soszyński and Poleski, 2008, _The Optical Gravitational Lensing Experiment. Final Reductions of the OGLE-III Data_, [Acta Astron., 58, 69](http://acta.astrouw.edu.pl/Vol58/n2/a_58_2_1.html).
(linux)

`$ export JULIA_NUM_THREADS=$(nprocs)`

`$julia -p auto Main.jl n`

where n is the desired number of stars

## Results

* Soszyński et al., 2008a, _The Optical Gravitational Lensing Experiment. The OGLE-III Catalog of Variable Stars. I. Classical Cepheids in the Large Magellanic Cloud_, [Acta Astron., 58, 163](http://acta.astrouw.edu.pl/Vol58/n3/a_58_3_2.html)
Output file `results.dat`. 5 columns: star id, execution time, period, ephemeris and period quality factor (a.k.a. |F(T)|^2 on period T). Can be loaded on Julia with `read_float_table` from `FileOperations.jl`.

### Benckmark

With `n=1000` on Intel Core i3 legacy generation, Windows, quad core, Julia v1.1, CPU time was 805.928s and elapsed (calculation and output) time was 214.733s giving 375.3% of time improvement.

## Data References

* Udalski, Szymański, Soszyński and Poleski, 2008, _The Optical Gravitational Lensing Experiment. Final Reductions of the OGLE-III Data_, [Acta Astron., 58, 69](http://acta.astrouw.edu.pl/Vol58/n2/a_58_2_1.html).

* Soszyński et al., 2008a, _The Optical Gravitational Lensing Experiment. The OGLE-III Catalog of Variable Stars. I. Classical Cepheids in the Large Magellanic Cloud_, [Acta Astron., 58, 163](http://acta.astrouw.edu.pl/Vol58/n3/a_58_3_2.html)
Loading

0 comments on commit fc5b11a

Please sign in to comment.