Test+Problem+Utility+grid2power

=Test Problem Utility grid2power.f90 and supporting IDL procedures= Pages: Workshop, Overview, CADAC, Data Access, Work Area Setup, Path Setup, Utilities, Grid Data, SPH Data, Running, Reporting, LOG

g2p.x (grid2power.f90)
This procedure computes a number of different power spectra from a single snapshot:
 * Power spectrum of density
 * Power spectrum of log density
 * Power spectrum of velocity, U
 * Spectrum of kinetic energy, rho U^2
 * Power spectrum of rho^(1/3) U, or any other density weighted power spectrum
 * Power spectrum of magnetic field, B

Syntax (make sure to setup the UNIX path correctly!): code g2p.x data/hd500a/snapshot-00009.g2p code where an example of the input file (default **g2p.in**) could be code &in infile='data/hd500a/snapshot-0009.dat'   ; raw data, with corresponding .dim file outfile='data/hd500a/snapshot-0009.pow'  ; output text file, may be used as input to plot_power.pro compensate=2. ; compensate the spectrum with k^2 do_average=t                             ; use average power times k-shell volume (for smoother spectrum) / code The results are written as a text file, with interspersed namelists for parameters. The IDL procedure **read_power.pro** reads the file into an IDL structure, **plot_power.pro** plots all power spectra in a single window, while **ps_power.pro** produces a full page PostScript figure with the power spectra. Examples: code IDL> plot_power,'data/hd500a/snapshot-0009.pow' IDL> ps_power,'data/hd500a/snapshot-0009.pow' code Now print or convert the file **data/hd500a/snapshot-0009.ps**. Alternatively, read the data and do your own plotting or other analysis: code IDL> s=read_power('data/hd500a/snapshot-0009.pow') IDL> help,s,/structure code The structure names should be self-explanatory, but for example: code IDL> plot_oo,s.k,s.power[*,0],title=s.case[0] code ... plots the power spectrum of density, while ... code IDL> plot_oo,s.k,total(s.power[*,2:8:3])/3.*s.k^2.0 code ... plots the compensated power spectrum of all three velocity components.