cloudy trunk
Loading...
Searching...
No Matches
save_fits.cpp File Reference
#include "cddefines.h"
#include "cddrive.h"
#include "optimize.h"
#include "grid.h"
#include "save.h"
#include "rfield.h"
#include "prt.h"
#include "input.h"
#include "version.h"
#include "physconst.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)
#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

◆ ByteSwap5

#define ByteSwap5 ( x)
Value:
ByteSwap((unsigned char *) &x,sizeof(x))
STATIC void ByteSwap(unsigned char *b, int n)
Definition save_fits.cpp:44

Definition at line 41 of file save_fits.cpp.

Referenced by punchFITS_EnergyData(), punchFITS_GenericData(), punchFITS_ParamData(), and punchFITS_SpectraData().

◆ HtoNL

#define HtoNL ( A)
Value:
((((A) & 0xff000000) >> 24) | \
(((A) & 0x00ff0000) >> 8) | \
(((A) & 0x0000ff00) << 8) | \
(((A) & 0x000000ff) << 24))

Definition at line 28 of file save_fits.cpp.

Referenced by punchFITS_ParamData().

◆ LINESIZE

◆ LOG2LINEAR

#define LOG2LINEAR   0

◆ RECORDSIZE

Function Documentation

◆ addComment()

long addComment ( const char * CommentToAdd)

Definition at line 842 of file save_fits.cpp.

References ASSERT, DEBUG_ENTRY, ioFITS_OUTPUT, and LINESIZE.

Referenced by writeCloudyDetails().

◆ addKeyword_num()

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

◆ addKeyword_txt()

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

◆ ByteSwap()

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

Definition at line 44 of file save_fits.cpp.

References STATIC.

◆ punchFITS_EnergyData()

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

Definition at line 440 of file save_fits.cpp.

References ASSERT, bytesAdded, ByteSwap5, DEBUG_ENTRY, EVRYD, ioFITS_OUTPUT, RECORDSIZE, rfield, and STATIC.

Referenced by saveFITSfile().

◆ punchFITS_EnergyHeader()

STATIC void punchFITS_EnergyHeader ( long numEnergies)

Definition at line 397 of file save_fits.cpp.

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

Referenced by saveFITSfile().

Here is the call graph for this function:

◆ punchFITS_GenericData()

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

Definition at line 676 of file save_fits.cpp.

References bytesAdded, ByteSwap5, cdSPEC2(), DEBUG_ENTRY, ioFITS_OUTPUT, MALLOC, RECORDSIZE, rfield, and STATIC.

Referenced by saveFITSfile().

Here is the call graph for this function:

◆ punchFITS_GenericHeader()

STATIC void punchFITS_GenericHeader ( long numEnergies)

Definition at line 633 of file save_fits.cpp.

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

Referenced by saveFITSfile().

Here is the call graph for this function:

◆ punchFITS_ParamData()

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

Definition at line 295 of file save_fits.cpp.

References ASSERT, bytesAdded, ByteSwap5, DEBUG_ENTRY, HtoNL, ioFITS_OUTPUT, LIMPAR, maxParamValues, RECORDSIZE, and STATIC.

Referenced by saveFITSfile().

◆ punchFITS_ParamHeader()

STATIC void punchFITS_ParamHeader ( long nintparm,
long naddparm )

Definition at line 222 of file save_fits.cpp.

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

Referenced by saveFITSfile().

Here is the call graph for this function:

◆ punchFITS_PrimaryHeader()

STATIC void punchFITS_PrimaryHeader ( bool lgAddModel)

Definition at line 176 of file save_fits.cpp.

References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, fixit(), ioFITS_OUTPUT, LINESIZE, ModelUnits, RECORDSIZE, STATIC, and writeCloudyDetails().

Referenced by saveFITSfile().

Here is the call graph for this function:

◆ punchFITS_SpectraData()

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

Definition at line 569 of file save_fits.cpp.

References ASSERT, bytesAdded, ByteSwap5, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, ioFITS_OUTPUT, ioQQQ, LIMPAR, RECORDSIZE, and STATIC.

Referenced by saveFITSfile().

◆ punchFITS_SpectraHeader()

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

Definition at line 478 of file save_fits.cpp.

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

Referenced by saveFITSfile().

Here is the call graph for this function:

◆ saveFITSfile()

void saveFITSfile ( FILE * io,
int option )

◆ writeCloudyDetails()

STATIC void writeCloudyDetails ( void )

Definition at line 713 of file save_fits.cpp.

References addComment(), ASSERT, bytesAdded, input, INPUT_LINE_LENGTH, Singleton< t_version >::Inst(), MIN2, prt, and STATIC.

Referenced by punchFITS_PrimaryHeader().

Here is the call graph for this function:

Variable Documentation

◆ bitpix

◆ bytesAdded

◆ gcount

long gcount = 1
static

◆ ioFITS_OUTPUT

◆ maxParamValues

long maxParamValues = 0
static

Definition at line 65 of file save_fits.cpp.

Referenced by punchFITS_ParamData(), punchFITS_ParamHeader(), and saveFITSfile().

◆ ModelUnits

const char ModelUnits[2][17] = {"'dimensionless '", "'photons/cm^2/s'" }

Definition at line 66 of file save_fits.cpp.

Referenced by punchFITS_PrimaryHeader(), and punchFITS_SpectraHeader().

◆ pcount

long pcount = 0
static