本文整理汇总了C++中GFits::filename方法的典型用法代码示例。如果您正苦于以下问题:C++ GFits::filename方法的具体用法?C++ GFits::filename怎么用?C++ GFits::filename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFits
的用法示例。
在下文中一共展示了GFits::filename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
/***********************************************************************//**
* @brief Read spectrum from FITS file
*
* @param[in] fits FITS file.
* @param[in] extno Extension number of spectrum.
*
* @exception GMWLException::file_open_error
* No table found in file.
*
* Read the spectrum from a FITS table found in the specified extension.
* In no extension number if specified (or if extno=0) then the spectrum
* is loaded from the first table extension that is found in the file.
***************************************************************************/
void GMWLSpectrum::read(const GFits& fits, const int& extno)
{
// Clear object
clear();
// Initialise extension number
int extension = extno;
// If the extension number is 0 then load first FITS table in file.
if (extension == 0) {
for (int i = 0; i < fits.size(); ++i) {
if (fits.at(i)->exttype() == GFitsHDU::HT_ASCII_TABLE ||
fits.at(i)->exttype() == GFitsHDU::HT_BIN_TABLE) {
extension = i;
break;
}
}
}
// If we found no table then throw an exception
if (extension == 0) {
throw GMWLException::file_open_error(G_READ, fits.filename().url(),
"No table found in file.");
}
// Get table pointer
const GFitsTable& table = *fits.table(extension);
// Read spectrum from table
read_fits(table);
// Return
return;
}