./
pp_cmfread.pro
Routines
top source pp_cmfread
result = pp_cmfread( [file])
Reads an OBSFLUX-type file generated by cmfgen and parses its content to extract each variable in it.
Also works for obs_fin, even though it has less variables in it.
More precisely, the format assumed is a text file where:
Scalars occupy one line, with their name followed by : followed by their value.
Arrays occupy one line for the name, followed by however many lines with however many numbers in each with the numbers in each line separated by blanks (space or tab).
An array ends when a name (of the next variable) or the end of the file is reached.
Blank lines anywhere are ignored.
Return value
The results are packed in a structure, see the end of the function for definition of members.
Parameters
- file in optional default=OBSFLUX
String with the name of the file to read.
Examples
To read everything from the file 'OBSFLUX':
obs=pp_cmfread('OBSFLUX')
print,obs.nscal
; 6
for i=0,obs.nscal-1 do print,obs.scal[i]
;{ Total Line luminosity 0.0000000}
;{ Total Dielectronic and Implicit Recombination Luminosity 0.0000000}
;{ Total Mechanical Luminosity 1531.0000}
;{ Total Shock Luminosity 0.0000000}
;{ X-ray Luminosity (> 0.1 keV) 0.0000000}
;{ X-ray Luminosity (> 1 keV) 0.0000000}
Author information
- Author:
Paulo Penteado (pp.penteado@gmail.com), Aug/2009
Statistics
Lines: | 52 lines |
Cyclomatic complexity: | 12 |
Modified cyclomatic complexity: | 12 |
File attributes
Modification date: | Wed Jun 29 22:15:28 2016 |
Lines: | 52 |
Docformat: | rst rst |