Manticore  Version 1.5.3
Physics of Molecular Clouds
Classes | Namespaces | Macros | Functions | Variables
solve.cc File Reference

SED fitting routines. More...

#include <algorithm>
#include <ctime>
#include <thread>
#include <gsl/gsl_randist.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_statistics_double.h>
#include <ceres/ceres.h>
#include <glog/logging.h>
#include "Graybody.h"
#include "PACS.h"
#include "SPIRE.h"
Include dependency graph for solve.cc:

Go to the source code of this file.

Classes

class  manticore::Fcost_gray< NB, NP >
 Ceres solver graybody cost model. More...
 
struct  manticore::GrayData
 Observation fitting data structure. More...
 

Namespaces

 manticore
 Package namespace.
 

Macros

#define bandData1   bandData
 

Functions

std::string manticore::asctime ()
 Current time a la std::asctime(). More...
 
void manticore::calcStats (double stats[], const double x0[], unsigned n)
 Computes median (and arithmetic) statistics on an input vector. More...
 
unsigned manticore::findMedianModel (const double pstats[][6], unsigned nParam, const double *pdata, unsigned nModels, unsigned nCols)
 Finds optimal model from a set of alternatives. More...
 
template<unsigned NP>
void manticore::findParameters (const std::vector< mapDataType > &bandData, const std::vector< mapDataType > &bandError, const mapDataType &tempMap, const mapDataType &chi2Map, const mu::CommandLine &cli, const GrayData &gdata0, unsigned id, unsigned nThreads)
 Finds best-fit model parameters. More...
 
mapDataType manticore::getSingleMap (const mu::CommandLine &cli, const std::vector< long > &ll, const std::vector< long > &ur, const std::vector< long > &st, const std::string &hduName)
 Read a map plane from the --single-temp FITS file. More...
 
double manticore::gridSample (double data, double err, unsigned iBand, unsigned iCycle, unsigned nSamp)
 Sample random data errors on a fixed grid. More...
 
void manticore::makeModelMap (std::vector< mapDataType > &bandData, std::vector< mapDataType > &bandError, const GrayData &gdata, unsigned nParam)
 Replace input observations with theoretical model. More...
 
int manticore::robustFit (ceres::Problem &prob, ceres::Solver::Summary &sum, ceres::Solver::Options &opts, const ceres::CostFunction *cost, double p[], const double dp[], const double pmin[], const double pmax[], unsigned NP, double minCost=0.25, double maxCost=25.0, bool refit=false)
 Non-linear fit with robustness checking. More...
 
std::vector< std::stringmanticore::setInstruments (const std::vector< const Detector * > &band)
 Set unique instrument types. More...
 
void manticore::solve (std::vector< mapDataType > &outMap, std::vector< CCfits::ExtHDU * > &outHDU, CCfits::FITS *outFITS, const std::vector< mapDataType > &bandData, const std::vector< mapDataType > &bandError, const std::vector< CCfits::PHDU * > &bandHDU, const std::vector< long > &axis, const mu::CommandLine &cli, const std::vector< long > &ll, const std::vector< long > &ur, const std::vector< long > &st)
 Performs least-squares fitting of band SEDs. More...
 
double manticore::sysSample (double data, unsigned iBand, unsigned iCycle, const std::vector< std::string > &instr, const std::vector< const Detector * > &bands)
 Sample systematic data errors on a fixed grid. More...
 
int manticore::trialFit (ceres::Problem &prob, ceres::Solver::Summary &sum, ceres::Solver::Options &opts, const ceres::CostFunction *cost, double p[], unsigned NP, const double p0[]=nullptr, const ceres::Solver::Summary *sum0=nullptr)
 Trial fit with rejection check. More...
 

Variables

const double manticore::imu_g = 1.0/mu_g
 Inverse mean molecular weight. More...
 
const double manticore::mu_g = (2.75*m_H)
 Mean molecular weight. More...
 

Detailed Description

SED fitting routines.

If INIT_SAMPLES is defined, the solver will randomize fitter initial guess (instead of flux) with the -G/-R/-S options.

If MEDIAN_FIT is defined, map output for -G/-R/-S runs is replaced with the best-fit median solution. This is the single fit whose parameters came closest to the median parameters values, not the median values themselves (which represent no solution in particular).

Author:  Kevin P. Rauch  <rauch.nosp@m.@ast.nosp@m.ro.um.nosp@m.d.ed.nosp@m.u>

Definition in file solve.cc.

Macro Definition Documentation

◆ bandData1

#define bandData1   bandData