79 auto i = args.
find(var);
83 auto basename = input.filename();
84 while (!basename.extension().empty())
85 basename = basename.stem();
87 auto output_area = boost::filesystem::path(args.
at(
"output-area").as<
std::string>());
88 auto output = output_area / boost::filesystem::path(basename.native() +
"_" + algo +
"_" + default_suffix);
89 output.replace_extension(
"fits");
90 return output.native();
110 po::options_description options;
116 options.add(config_manager.closeRegistration());
117 options.add_options()
118 (
"output", po::value<std::string>(),
"Output image for the background")
119 (
"output-variance", po::value<std::string>(),
"Output image for the variance")
120 (
"output-area", po::value<std::string>()->default_value(boost::filesystem::temp_directory_path().native()),
"Output area")
121 (
"algorithm", po::value<std::string>()->required(),
"Algorithm to use: Simple, ng")
122 (
"cell-size", po::value<std::string>()->default_value(
"64"),
"Cell size for the histogram")
123 (
"smooth-size", po::value<std::string>()->default_value(
"3"),
"Box size for the median filtering")
124 (
"no-write", po::bool_switch(),
"Do not write the image (skip interpolation)")
125 (
"tile-size", po::value<int>()->default_value(512),
"Tile size")
126 (
"tile-memory", po::value<int>()->default_value(2048),
"Tile memory limit");
164 assert (bg_analyzer !=
nullptr);
172 logger.info() <<
"Starting analysis";
174 logger.info() <<
"Weight image " << weight_image->getRepr();
176 logger.info() <<
"No weight image";
178 timer::cpu_timer timer;
179 auto bg_model = bg_analyzer->analyzeBackground(image, weight_image, mask, threshold);
181 if (!args.
at(
"no-write").as<
bool>()) {
182 logger.info() <<
"Writing background";
184 logger.info() <<
"Writing variance map";