cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions | Variables
save_fits.cpp File Reference
#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 dependency graph for save_fits.cpp:

Go to the source code of this file.

Macros

#define RECORDSIZE   2880
 
#define LINESIZE   80
 
#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)
 
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 (const vector< realnum > &Energies, long EnergyOffset)
 
STATIC void punchFITS_SpectraHeader (bool lgAdditiveModel, long nintparm, long naddparm, long totNumModels, long numEnergies)
 
STATIC void punchFITS_SpectraData (realnum **interpParameters, multi_arr< realnum, 3 > &theSpectrum, int option, long totNumModels, long numEnergies, long nintparm, long naddparm)
 
STATIC void punchFITS_GenericHeader (long numEnergies)
 
STATIC void punchFITS_GenericData (long numEnergies, long ipLoEnergy, long ipHiEnergy)
 
STATIC void writeCloudyDetails (void)
 
STATIC long addComment (const char *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)
 
void saveFITSfile (FILE *ioPUN, int option)
 

Variables

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'" }
 

Macro Definition Documentation

#define ByteSwap5 (   x)    ByteSwap((unsigned char *) &x,sizeof(x))
#define HtoNL (   A)
Value:
((((A) & 0xff000000) >> 24) | \
(((A) & 0x00ff0000) >> 8) | \
(((A) & 0x0000ff00) << 8) | \
(((A) & 0x000000ff) << 24))

Definition at line 26 of file save_fits.cpp.

Referenced by punchFITS_ParamData().

#define LINESIZE   80
#define LOG2LINEAR   0
#define RECORDSIZE   2880

Function Documentation

long addComment ( const char *  CommentToAdd)

Definition at line 828 of file save_fits.cpp.

References ASSERT, DEBUG_ENTRY, fprintf(), ioFITS_OUTPUT, and LINESIZE.

Referenced by writeCloudyDetails().

Here is the call graph for this function:

STATIC long addKeyword_num ( const char *  theKeyword,
long  theValue,
const char *  theComment 
)

Definition at line 811 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().

Here is the call graph for this function:

STATIC long addKeyword_txt ( const char *  theKeyword,
const void *  theValue,
const char *  theComment,
long  Str_Or_Log 
)

Definition at line 780 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().

Here is the call graph for this function:

STATIC void ByteSwap ( unsigned char *  b,
int  n 
)

Definition at line 42 of file save_fits.cpp.

STATIC void punchFITS_EnergyData ( const vector< realnum > &  Energies,
long  EnergyOffset 
)

Definition at line 434 of file save_fits.cpp.

References t_mesh::anumax(), t_mesh::anumin(), ASSERT, bytesAdded, ByteSwap5, DEBUG_ENTRY, ioFITS_OUTPUT, t_rfield::nflux_with_check, RECORDSIZE, and rfield.

Referenced by saveFITSfile().

Here is the call graph for this function:

STATIC void punchFITS_EnergyHeader ( long  numEnergies)

Definition at line 391 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().

Here is the call graph for this function:

STATIC void punchFITS_GenericData ( long  numEnergies,
long  ipLoEnergy,
long  ipHiEnergy 
)

Definition at line 662 of file save_fits.cpp.

References t_mesh::anu(), bytesAdded, ByteSwap5, cdSPEC2(), DEBUG_ENTRY, ioFITS_OUTPUT, MALLOC, RECORDSIZE, and rfield.

Referenced by saveFITSfile().

Here is the call graph for this function:

STATIC void punchFITS_GenericHeader ( long  numEnergies)

Definition at line 619 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().

Here is the call graph for this function:

STATIC void punchFITS_ParamData ( char **  paramNames,
long *  paramMethods,
realnum **  paramRange,
realnum **  paramData,
long  nintparm,
long  naddparm,
long *  numParamValues 
)

Definition at line 289 of file save_fits.cpp.

References ASSERT, bytesAdded, ByteSwap5, DEBUG_ENTRY, exp10(), fprintf(), HtoNL, ioFITS_OUTPUT, LIMPAR, maxParamValues, and RECORDSIZE.

Referenced by saveFITSfile().

Here is the call graph for this function:

STATIC void punchFITS_ParamHeader ( long  nintparm,
long  naddparm 
)

Definition at line 216 of file save_fits.cpp.

References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, fprintf(), gcount, ioFITS_OUTPUT, LIMPAR, LINESIZE, maxParamValues, pcount, and RECORDSIZE.

Referenced by saveFITSfile().

Here is the call graph for this function:

STATIC void punchFITS_PrimaryHeader ( bool  lgAddModel)

Definition at line 170 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().

Here is the call graph for this function:

STATIC void punchFITS_SpectraData ( realnum **  interpParameters,
multi_arr< realnum, 3 > &  theSpectrum,
int  option,
long  totNumModels,
long  numEnergies,
long  nintparm,
long  naddparm 
)

Definition at line 555 of file save_fits.cpp.

References ASSERT, bytesAdded, ByteSwap5, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioFITS_OUTPUT, ioQQQ, LIMPAR, and RECORDSIZE.

Referenced by saveFITSfile().

Here is the call graph for this function:

STATIC void punchFITS_SpectraHeader ( bool  lgAdditiveModel,
long  nintparm,
long  naddparm,
long  totNumModels,
long  numEnergies 
)

Definition at line 464 of file save_fits.cpp.

References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, fprintf(), gcount, ioFITS_OUTPUT, LIMPAR, LINESIZE, ModelUnits, pcount, and RECORDSIZE.

Referenced by saveFITSfile().

Here is the call graph for this function:

void saveFITSfile ( FILE *  io,
int  option 
)
STATIC void writeCloudyDetails ( void  )

Definition at line 699 of file save_fits.cpp.

References addComment(), ASSERT, bytesAdded, t_input::chCardSav, input, INPUT_LINE_LENGTH, Singleton< t_version >::Inst(), t_prt::lgPrintTime, MIN2, t_input::nSave, and prt.

Referenced by punchFITS_PrimaryHeader().

Here is the call graph for this function:

Variable Documentation

long bitpix = 8
static
long bytesAdded = 0
static
long gcount = 1
static
FILE* ioFITS_OUTPUT
static
long maxParamValues = 0
static

Definition at line 63 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 64 of file save_fits.cpp.

Referenced by punchFITS_PrimaryHeader(), and punchFITS_SpectraHeader().

long pcount = 0
static