本文整理汇总了C++中Array::GetArrayName方法的典型用法代码示例。如果您正苦于以下问题:C++ Array::GetArrayName方法的具体用法?C++ Array::GetArrayName怎么用?C++ Array::GetArrayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Array
的用法示例。
在下文中一共展示了Array::GetArrayName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
}
// And the image file we're going to use for the simulation:
if ((strcmp(argv[i], "-i") == 0) && (i < argc - 1))
{
target.SetImage(string(argv[i + 1]));
target.ParseImageOptions(argv, i + 2, argc);
n_params += 1;
}
// And where we're going to write the output:
if ((strcmp(argv[i], "-o") == 0) && (i < argc - 1))
{
try
{
output_fname = string(argv[i + 1]);
n_params += 1;
}
catch (...)
{
throw std::runtime_error("Invalid Output File Definition");
}
}
//
// After this there are two cases:
//
// ################
// (1) we use an existing OIFITS data file. Really this has everything
// needed to run the simulation, but I don't want to write a module to parse
// the OIFITS array and wavelength tables. So, we'll just require
// that the array and spectral mode be specified too.
if ((strcmp(argv[i], "-d") == 0) && (i < argc - 1))
{
observation_list = Obs_OIFITS::ReadObservation_OIFITS(string(argv[i + 1]));
n_params += 1;
}
// ################
// or (2) we are simulating something from scratch in which case we need
// the array
if ((strcmp(argv[i], "-a") == 0) && (i < argc - 1))
{
array.ImportFile(string(argv[i + 1]), comment_chars);
array.ParseOptions(argv, i, argc);
n_params += 1;
}
// the combiner
if ((strcmp(argv[i], "-c") == 0) && (i < argc - 1))
{
combiner.ImportFile(string(argv[i + 1]), comment_chars);
n_params += 1;
}
// the spectral mode. Note, the combiner must be specified first so we can check that
// the two are indeed to be used with eachother.
if ((strcmp(argv[i], "-m") == 0) && (i < argc - 1))
{
if (combiner.name == "")
{
cout << "The combiner, -c, must be specified before the spectral mode, -m.\n";
exit(0);
}
spec_mode.ImportFile(string(argv[i + 1]), combiner.GetName(), comment_chars);
n_params += 1;
}
// Now for observation_list
if ((strcmp(argv[i], "-obs") == 0) && (i < argc - 1))
{
// First ensure that the array has been defined. If not, quit.
if (array.GetArrayName() == "")
{
cout << "The array, -a, must be specified before the observation list, -obs.\n";
exit(0);
}
// Observations are a little funny. We permit both files and command line options.
// Just pass things off to the observation class so it can decide what to do:
observation_list = Observation::ParseCommandLine(&array, argv, i, argc, comment_chars);
n_params += 1;
}
}
// Check that all parameters were specified
// TODO: Better checking here should be implemented
if (n_params == 7)
run_sim(&target, &array, &combiner, &spec_mode, noisemodel, observation_list, output_fname);
else
cout << "Something is missing on the command line, quitting!" << endl;
// Clean up memory
delete noisemodel;
return 0;
}