#include "cddefines.h"
#include "cddrive.h"
#include "optimize.h"
#include "grid.h"
#include "punch.h"
#include "rfield.h"
#include "prt.h"
#include "input.h"
#include "version.h"
#include "physconst.h"
Go to the source code of this file.
Defines | |
#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, float **paramRange, float **paramData, long nintparm, long naddparm, long *numParamValues) |
static void | punchFITS_EnergyHeader (long numEnergies) |
static void | punchFITS_EnergyData (float *Energies, long numEnergies) |
static void | punchFITS_SpectraHeader (long nintparm, long naddparm, long totNumModels, long numEnergies) |
static void | punchFITS_SpectraData (float **interpParameters, float **theSpectrum, long totNumModels, long numEnergies, long nintparm, long naddparm) |
static void | punchFITS_GenericHeader (long numEnergies) |
static void | punchFITS_GenericData (long numEnergies) |
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 | punchFITSfile (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 |
#define ByteSwap5 | ( | x | ) | ByteSwap((unsigned char *) &x,sizeof(x)) |
Definition at line 41 of file punch_fits.cpp.
Referenced by punchFITS_EnergyData(), punchFITS_GenericData(), punchFITS_ParamData(), and punchFITS_SpectraData().
#define HtoNL | ( | A | ) |
Value:
((((A) & 0xff000000) >> 24) | \ (((A) & 0x00ff0000) >> 8) | \ (((A) & 0x0000ff00) << 8) | \ (((A) & 0x000000ff) << 24))
Definition at line 28 of file punch_fits.cpp.
Referenced by punchFITS_ParamData().
#define LINESIZE 80 |
Definition at line 15 of file punch_fits.cpp.
Referenced by addComment(), addKeyword_num(), addKeyword_txt(), punchFITS_EnergyHeader(), punchFITS_GenericHeader(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), and punchFITS_SpectraHeader().
#define LOG2LINEAR 0 |
#define RECORDSIZE 2880 |
Definition at line 14 of file punch_fits.cpp.
Referenced by punchFITS_EnergyData(), punchFITS_EnergyHeader(), punchFITS_GenericData(), punchFITS_GenericHeader(), punchFITS_ParamData(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), punchFITS_SpectraData(), and punchFITS_SpectraHeader().
long addComment | ( | const char * | CommentToAdd | ) | [static] |
Definition at line 859 of file punch_fits.cpp.
References ASSERT, DEBUG_ENTRY, DEBUG_EXIT, ioFITS_OUTPUT, and LINESIZE.
Referenced by writeCloudyDetails().
static long addKeyword_num | ( | const char * | theKeyword, | |
long | theValue, | |||
const char * | theComment | |||
) | [static] |
Definition at line 840 of file punch_fits.cpp.
References ASSERT, DEBUG_ENTRY, DEBUG_EXIT, 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 | |||
) | [static] |
Definition at line 807 of file punch_fits.cpp.
References ASSERT, DEBUG_ENTRY, DEBUG_EXIT, 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 | |||
) | [static] |
Definition at line 43 of file punch_fits.cpp.
static void punchFITS_EnergyData | ( | float * | Energies, | |
long | numEnergies | |||
) | [static] |
Definition at line 441 of file punch_fits.cpp.
References bytesAdded, ByteSwap5, DEBUG_ENTRY, DEBUG_EXIT, EVRYD, ioFITS_OUTPUT, RECORDSIZE, rfield, and t_rfield::widflx.
Referenced by punchFITSfile().
static void punchFITS_EnergyHeader | ( | long | numEnergies | ) | [static] |
Definition at line 396 of file punch_fits.cpp.
References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, DEBUG_EXIT, gcount, ioFITS_OUTPUT, LINESIZE, pcount, and RECORDSIZE.
Referenced by punchFITSfile().
static void punchFITS_GenericData | ( | long | numEnergies | ) | [static] |
Definition at line 687 of file punch_fits.cpp.
References t_rfield::AnuOrg, bytesAdded, ByteSwap5, cdSPEC2(), DEBUG_ENTRY, DEBUG_EXIT, ioFITS_OUTPUT, MALLOC, RECORDSIZE, and rfield.
Referenced by punchFITSfile().
static void punchFITS_GenericHeader | ( | long | numEnergies | ) | [static] |
Definition at line 642 of file punch_fits.cpp.
References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, DEBUG_EXIT, gcount, ioFITS_OUTPUT, LINESIZE, pcount, and RECORDSIZE.
Referenced by punchFITSfile().
static void punchFITS_ParamData | ( | char ** | paramNames, | |
long * | paramMethods, | |||
float ** | paramRange, | |||
float ** | paramData, | |||
long | nintparm, | |||
long | naddparm, | |||
long * | numParamValues | |||
) | [static] |
Definition at line 283 of file punch_fits.cpp.
References ASSERT, bytesAdded, ByteSwap5, DEBUG_ENTRY, DEBUG_EXIT, HtoNL, ioFITS_OUTPUT, LIMPAR, maxParamValues, and RECORDSIZE.
Referenced by punchFITSfile().
static void punchFITS_ParamHeader | ( | long | nintparm, | |
long | naddparm | |||
) | [static] |
Definition at line 202 of file punch_fits.cpp.
References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, DEBUG_EXIT, gcount, ioFITS_OUTPUT, LIMPAR, LINESIZE, maxParamValues, pcount, and RECORDSIZE.
Referenced by punchFITSfile().
static void punchFITS_PrimaryHeader | ( | bool | lgAddModel | ) | [static] |
Definition at line 156 of file punch_fits.cpp.
References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, DEBUG_EXIT, ioFITS_OUTPUT, LINESIZE, RECORDSIZE, and writeCloudyDetails().
Referenced by punchFITSfile().
static void punchFITS_SpectraData | ( | float ** | interpParameters, | |
float ** | theSpectrum, | |||
long | totNumModels, | |||
long | numEnergies, | |||
long | nintparm, | |||
long | naddparm | |||
) | [static] |
Definition at line 575 of file punch_fits.cpp.
References ASSERT, bytesAdded, ByteSwap5, cdEXIT(), DEBUG_ENTRY, DEBUG_EXIT, ioFITS_OUTPUT, ioQQQ, LIMPAR, and RECORDSIZE.
Referenced by punchFITSfile().
static void punchFITS_SpectraHeader | ( | long | nintparm, | |
long | naddparm, | |||
long | totNumModels, | |||
long | numEnergies | |||
) | [static] |
Definition at line 482 of file punch_fits.cpp.
References addKeyword_num(), addKeyword_txt(), ASSERT, bitpix, bytesAdded, DEBUG_ENTRY, DEBUG_EXIT, gcount, ioFITS_OUTPUT, LIMPAR, LINESIZE, pcount, and RECORDSIZE.
Referenced by punchFITSfile().
void punchFITSfile | ( | FILE * | io, | |
int | option | |||
) |
Punch spectra to a FITS compatible file.
io | ||
option |
Definition at line 94 of file punch_fits.cpp.
References ASSERT, cdEXIT(), DEBUG_ENTRY, DEBUG_EXIT, t_grid::Energies, grid, t_grid::interpParameters, ioFITS_OUTPUT, ioQQQ, t_grid::lgGridDone, MAX2, maxParamValues, t_grid::naddparm, t_rfield::nflux, t_grid::nintparm, NUM_OUTPUT_TYPES, t_grid::numEnergies, t_grid::numParamValues, 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, and t_grid::totNumModels.
Referenced by PunchDo().
static void writeCloudyDetails | ( | void | ) | [static] |
Definition at line 724 of file punch_fits.cpp.
References addComment(), ASSERT, bytesAdded, cdVersion(), t_input::chCardSav, t_version::chInfo, input, INPUT_LINE_LENGTH, t_prt::lgPrintTime, MIN2, t_input::nSave, prt, and version.
Referenced by punchFITS_PrimaryHeader().
long bitpix = 8 [static] |
Definition at line 64 of file punch_fits.cpp.
Referenced by punchFITS_EnergyHeader(), punchFITS_GenericHeader(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), and punchFITS_SpectraHeader().
long bytesAdded = 0 [static] |
Definition at line 63 of file punch_fits.cpp.
Referenced by punchFITS_EnergyData(), punchFITS_EnergyHeader(), punchFITS_GenericData(), punchFITS_GenericHeader(), punchFITS_ParamData(), punchFITS_ParamHeader(), punchFITS_PrimaryHeader(), punchFITS_SpectraData(), punchFITS_SpectraHeader(), and writeCloudyDetails().
long gcount = 1 [static] |
Definition at line 66 of file punch_fits.cpp.
Referenced by punchFITS_EnergyHeader(), punchFITS_GenericHeader(), punchFITS_ParamHeader(), and punchFITS_SpectraHeader().
FILE* ioFITS_OUTPUT [static] |
Definition at line 62 of file punch_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 punchFITSfile().
long maxParamValues = 0 [static] |
Definition at line 67 of file punch_fits.cpp.
Referenced by punchFITS_ParamData(), punchFITS_ParamHeader(), and punchFITSfile().
long pcount = 0 [static] |
Definition at line 65 of file punch_fits.cpp.
Referenced by punchFITS_EnergyHeader(), punchFITS_GenericHeader(), punchFITS_ParamHeader(), and punchFITS_SpectraHeader().