cloudy
trunk
|
#include "cddefines.h"
#include "save.h"
#include "cddrive.h"
#include "grid.h"
#include "rfield.h"
#include "prt.h"
#include "input.h"
#include "version.h"
#include "service.h"
Go to the source code of this file.
Macros | |
#define | HtoNL(A) |
#define | ByteSwap5(x) ByteSwap((unsigned char *) &x,sizeof(x)) |
#define | LOG2LINEAR 0 |
Functions | |
STATIC void | ByteSwap (unsigned char *b, int n) |
STATIC void | punchFITS_PrimaryHeader (bool lgAddModel, bool lgNormalize) |
STATIC void | punchFITS_ParamHeader (long nintparm, long naddparm) |
STATIC void | punchFITS_ParamData (char **paramNames, long *paramMethods, realnum **paramRange, realnum **paramData, long nintparm, long naddparm, long *numParamValues) |
STATIC void | punchFITS_EnergyHeader (long numEnergies) |
STATIC void | punchFITS_EnergyData (long ipLo, long ipHi) |
STATIC void | punchFITS_SpectraHeader (bool lgAdditiveModel, bool lgNormalize, long nintparm, long naddparm, long totNumModels, long numEnergies) |
STATIC void | punchFITS_SpectraData (realnum **interpParameters, multi_arr< realnum, 3 > &theSpectrum, int option, long totNumModels, long ipLo, long ipHi, long ipNorm, long nintparm, long naddparm) |
STATIC void | punchFITS_GenericHeader () |
STATIC void | punchFITS_GenericData () |
STATIC void | writeCloudyDetails (void) |
STATIC long | addComment (const string &CommentToAdd) |
STATIC long | addKeyword_txt (const char *theKeyword, const void *theValue, const char *theComment, long Str_Or_Log) |
STATIC long | addKeyword_num (const char *theKeyword, long theValue, const char *theComment) |
string | int2string (int val) |
void | saveFITSfile (FILE *ioPUN, int option, realnum Elo, realnum Ehi, realnum Enorm) |
Variables | |
static const int | RECORDSIZE = 2880 |
static const int | LINESIZE = 80 |
static FILE * | ioFITS_OUTPUT |
static long | bytesAdded = 0 |
static long | bitpix = 8 |
static long | pcount = 0 |
static long | gcount = 1 |
static long | maxParamValues = 0 |
const char | ModelUnits [2][17] = {"'dimensionless '", "'photons/cm^2/s'" } |
#define ByteSwap5 | ( | x | ) | ByteSwap((unsigned char *) &x,sizeof(x)) |
Definition at line 40 of file save_fits.cpp.
Referenced by punchFITS_EnergyData(), punchFITS_GenericData(), punchFITS_ParamData(), and punchFITS_SpectraData().
#define HtoNL | ( | A | ) |
Definition at line 27 of file save_fits.cpp.
Referenced by punchFITS_ParamData().
#define LOG2LINEAR 0 |
long addComment | ( | const string & | CommentToAdd | ) |
Definition at line 782 of file save_fits.cpp.
References ASSERT, DEBUG_ENTRY, fprintf(), ioFITS_OUTPUT, and LINESIZE.
Referenced by writeCloudyDetails().
STATIC long addKeyword_num | ( | const char * | theKeyword, |
long | theValue, | ||
const char * | theComment | ||
) |
Definition at line 765 of file save_fits.cpp.
References ASSERT, DEBUG_ENTRY, fprintf(), ioFITS_OUTPUT, and LINESIZE.
Referenced by punchFITS_EnergyHeader(), punchFITS_GenericHeader(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), and punchFITS_SpectraHeader().
STATIC long addKeyword_txt | ( | const char * | theKeyword, |
const void * | theValue, | ||
const char * | theComment, | ||
long | Str_Or_Log | ||
) |
Definition at line 734 of file save_fits.cpp.
References ASSERT, DEBUG_ENTRY, fprintf(), ioFITS_OUTPUT, and LINESIZE.
Referenced by punchFITS_EnergyHeader(), punchFITS_GenericHeader(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), and punchFITS_SpectraHeader().
STATIC void ByteSwap | ( | unsigned char * | b, |
int | n | ||
) |
Definition at line 43 of file save_fits.cpp.
|
inline |
Definition at line 804 of file save_fits.cpp.
References DEBUG_ENTRY.
Referenced by punchFITS_ParamHeader(), and punchFITS_SpectraHeader().
STATIC void punchFITS_EnergyData | ( | long | ipLo, |
long | ipHi | ||
) |
Definition at line 425 of file save_fits.cpp.
References t_mesh::anumax(), t_mesh::anumin(), bytesAdded, ByteSwap5, DEBUG_ENTRY, ioFITS_OUTPUT, RECORDSIZE, and rfield.
Referenced by saveFITSfile().
STATIC void punchFITS_EnergyHeader | ( | long | numEnergies | ) |
Definition at line 382 of file save_fits.cpp.
References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, fprintf(), gcount, ioFITS_OUTPUT, LINESIZE, pcount, and RECORDSIZE.
Referenced by saveFITSfile().
STATIC void punchFITS_GenericData | ( | ) |
Definition at line 645 of file save_fits.cpp.
References t_mesh::anu(), bytesAdded, ByteSwap5, cdSPEC2(), DEBUG_ENTRY, get_ptr(), ioFITS_OUTPUT, t_rfield::nflux, RECORDSIZE, and rfield.
Referenced by saveFITSfile().
STATIC void punchFITS_GenericHeader | ( | ) |
Definition at line 602 of file save_fits.cpp.
References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, fprintf(), gcount, ioFITS_OUTPUT, LINESIZE, t_rfield::nflux, pcount, RECORDSIZE, and rfield.
Referenced by saveFITSfile().
STATIC void punchFITS_ParamData | ( | char ** | paramNames, |
long * | paramMethods, | ||
realnum ** | paramRange, | ||
realnum ** | paramData, | ||
long | nintparm, | ||
long | naddparm, | ||
long * | numParamValues | ||
) |
Definition at line 280 of file save_fits.cpp.
References ASSERT, bytesAdded, ByteSwap5, DEBUG_ENTRY, exp10(), fprintf(), HtoNL, ioFITS_OUTPUT, LIMPAR, maxParamValues, and RECORDSIZE.
Referenced by saveFITSfile().
STATIC void punchFITS_ParamHeader | ( | long | nintparm, |
long | naddparm | ||
) |
Definition at line 210 of file save_fits.cpp.
References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, fprintf(), gcount, int2string(), ioFITS_OUTPUT, LIMPAR, LINESIZE, maxParamValues, pcount, and RECORDSIZE.
Referenced by saveFITSfile().
STATIC void punchFITS_PrimaryHeader | ( | bool | lgAddModel, |
bool | lgNormalize | ||
) |
Definition at line 162 of file save_fits.cpp.
References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, fixit, fprintf(), ioFITS_OUTPUT, LINESIZE, ModelUnits, RECORDSIZE, and writeCloudyDetails().
Referenced by saveFITSfile().
STATIC void punchFITS_SpectraData | ( | realnum ** | interpParameters, |
multi_arr< realnum, 3 > & | theSpectrum, | ||
int | option, | ||
long | totNumModels, | ||
long | ipLo, | ||
long | ipHi, | ||
long | ipNorm, | ||
long | nintparm, | ||
long | naddparm | ||
) |
Definition at line 534 of file save_fits.cpp.
References ASSERT, bytesAdded, ByteSwap5, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioFITS_OUTPUT, ioQQQ, LIMPAR, RECORDSIZE, rfield, and t_mesh::widflx().
Referenced by saveFITSfile().
STATIC void punchFITS_SpectraHeader | ( | bool | lgAdditiveModel, |
bool | lgNormalize, | ||
long | nintparm, | ||
long | naddparm, | ||
long | totNumModels, | ||
long | numEnergies | ||
) |
Definition at line 450 of file save_fits.cpp.
References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, fprintf(), gcount, int2string(), ioFITS_OUTPUT, LIMPAR, LINESIZE, ModelUnits, pcount, and RECORDSIZE.
Referenced by saveFITSfile().
void saveFITSfile | ( | FILE * | io, |
int | option, | ||
realnum | Elo = 0.f , |
||
realnum | Ehi = 0.f , |
||
realnum | Enorm = 0.f |
||
) |
Save spectra to a FITS compatible file.
io | the file we will write to |
option | choose type of spectrum to save |
Elo | if set, lower bound of spectrum to save |
Ehi | if set, upper bound of spectrum to save |
Enorm | if set, normalize spectrum to 1 at this frequency |
Definition at line 86 of file save_fits.cpp.
References t_mesh::anu(), ASSERT, DEBUG_ENTRY, fprintf(), grid, GridRetrieveXSPECData(), t_grid::interpParameters, ioFITS_OUTPUT, t_mesh::ipointC(), t_grid::lgGridDone, MAX2, maxParamValues, t_grid::naddparm, t_rfield::nflux, t_grid::nintparm, t_optimize::nOptimiz, NUM_OUTPUT_TYPES, t_grid::numParamValues, open_data(), optimize, t_grid::paramData, t_grid::paramMethods, t_grid::paramNames, t_grid::paramRange, punchFITS_EnergyData(), punchFITS_EnergyHeader(), punchFITS_GenericData(), punchFITS_GenericHeader(), punchFITS_ParamData(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), punchFITS_SpectraData(), punchFITS_SpectraHeader(), rfield, t_grid::Spectra, t_grid::totNumModels, and wr_block().
Referenced by process_output(), and SaveDo().
STATIC void writeCloudyDetails | ( | void | ) |
Definition at line 672 of file save_fits.cpp.
References addComment(), bytesAdded, t_input::chCardSav, t_input::InclLevel, input, Singleton< t_version >::Inst(), t_prt::lgPrintTime, t_input::nSave, and prt.
Referenced by punchFITS_PrimaryHeader().
|
static |
Definition at line 61 of file save_fits.cpp.
Referenced by punchFITS_EnergyHeader(), punchFITS_GenericHeader(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), and punchFITS_SpectraHeader().
|
static |
Definition at line 60 of file save_fits.cpp.
Referenced by punchFITS_EnergyData(), punchFITS_EnergyHeader(), punchFITS_GenericData(), punchFITS_GenericHeader(), punchFITS_ParamData(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), punchFITS_SpectraData(), punchFITS_SpectraHeader(), and writeCloudyDetails().
|
static |
Definition at line 63 of file save_fits.cpp.
Referenced by punchFITS_EnergyHeader(), punchFITS_GenericHeader(), punchFITS_ParamHeader(), and punchFITS_SpectraHeader().
|
static |
Definition at line 59 of file save_fits.cpp.
Referenced by addComment(), addKeyword_num(), addKeyword_txt(), punchFITS_EnergyData(), punchFITS_EnergyHeader(), punchFITS_GenericData(), punchFITS_GenericHeader(), punchFITS_ParamData(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), punchFITS_SpectraData(), punchFITS_SpectraHeader(), and saveFITSfile().
|
static |
Definition at line 14 of file save_fits.cpp.
Referenced by addComment(), addKeyword_num(), addKeyword_txt(), punchFITS_EnergyHeader(), punchFITS_GenericHeader(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), and punchFITS_SpectraHeader().
|
static |
Definition at line 64 of file save_fits.cpp.
Referenced by punchFITS_ParamData(), punchFITS_ParamHeader(), and saveFITSfile().
const char ModelUnits[2][17] = {"'dimensionless '", "'photons/cm^2/s'" } |
Definition at line 65 of file save_fits.cpp.
Referenced by punchFITS_PrimaryHeader(), and punchFITS_SpectraHeader().
|
static |
Definition at line 62 of file save_fits.cpp.
Referenced by punchFITS_EnergyHeader(), punchFITS_GenericHeader(), punchFITS_ParamHeader(), and punchFITS_SpectraHeader().
|
static |
Definition at line 13 of file save_fits.cpp.
Referenced by punchFITS_EnergyData(), punchFITS_EnergyHeader(), punchFITS_GenericData(), punchFITS_GenericHeader(), punchFITS_ParamData(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), punchFITS_SpectraData(), and punchFITS_SpectraHeader().