当前位置: 首页>>代码示例>>C++>>正文


C++ ParamList::parse方法代码示例

本文整理汇总了C++中ParamList::parse方法的典型用法代码示例。如果您正苦于以下问题:C++ ParamList::parse方法的具体用法?C++ ParamList::parse怎么用?C++ ParamList::parse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ParamList的用法示例。


在下文中一共展示了ParamList::parse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char* argv[]) {

    if (argc != 2) {
        cerr << "Usage: " << argv[0] << " <filename.cfg>" << endl;
        return 0;
    }

	
    ParamList pl; 
    cerr << "Reading configuration...";
    pl.parse(argv[1]);
    cerr << " done." << endl;

	// Get the mean dark count along the third axis.
    BOData<double> darkmean;
    cerr << "Processing Dark frame...";
    string filename;
    pl.getValue("DARK_FILE", filename);
    CCFITSfile fitsfile;
    BOData<double> dat;
    fitsfile.read(filename, dat);
    print(dat);

    getMean(dat, 3, darkmean); 
    filename = "darkmean3.gim";
    write2gim(filename, darkmean, sigfig);
    cerr << " done." << endl;
    
	// Calculate sigma. 
    BOData<double> sigma;
    double preset_sigma;
    unsigned int err = pl.getValue("PRESET_SIGMA", preset_sigma);
    if (err == 0) 
    {
        cerr << "Processing Preset Sigma ...";
        sigma.data = darkmean.data;
        sigma.axes = darkmean.axes;
        string filename = "sigmasigma3.gim";
        write2gim(filename, sigma, sigfig);
        cerr << " done." << endl;
    } 
    else 
    {
        cerr << "Processing Sigma frame...";
        string filename;
        pl.getValue("SIGMA_FILE", filename);
        CCFITSfile fitsfile;
        BOData<double> sigmaData;
        fitsfile.read(filename, sigmaData);
        print(sigmaData);
        getSD(sigmaData, 3, sigma);
        filename = "sigmasigma3.txt";
        write2gim(filename, sigma, sigfig);
        cerr << " done." << endl;
    }
    
    
    // Create FFTW wisdom for use in subsequent processing steps. 
	double freq;
    double del_t;
    double nOfData;
    const char *wisdom_filename = "wisdom.txt"; 
    
    pl.getValue("SAMPLING_INTERVAL", del_t);
    pl.getValue("XCORR_FREQUENCY", freq);
    pl.getValue("NUM_DATA_POINTS", nOfData);
    
    cerr << "Creating FFTW Plan..." << endl;
    plan_fftw(nOfData, wisdom_filename); 
    cerr << "FFTW Plan creation done." << endl; 
    
    return 0;
}
开发者ID:bkandel,项目名称:gen3-fftw-fit-2,代码行数:73,代码来源:gen3-fftw-fit-2-init.cpp


注:本文中的ParamList::parse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。