本文整理汇总了C++中View::FullId方法的典型用法代码示例。如果您正苦于以下问题:C++ View::FullId方法的具体用法?C++ View::FullId怎么用?C++ View::FullId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::FullId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Apply
static void Apply( GenericImage<P>& img, const View& view, const FluxCalibrationInstance& instance )
{
FITSKeywordArray inputKeywords;
view.Window().GetKeywords( inputKeywords );
if ( KeywordExists( inputKeywords, "FLXMIN" ) ||
KeywordExists( inputKeywords, "FLXRANGE" ) ||
KeywordExists( inputKeywords, "FLX2DN" ) )
{
throw Error( "Already calibrated image" );
}
if ( img.IsColor() )
throw Error( "Can't calibrate a color image" );
float Wc = instance.p_wavelength.GetValue( inputKeywords );
float Tr = Max( 1.0F, instance.p_transmissivity.GetValue( inputKeywords ) );
float Delta = instance.p_filterWidth.GetValue( inputKeywords );
float Ap = instance.p_aperture.GetValue( inputKeywords ) / 10; // mm -> cm
float Cobs = Max( 0.0F, instance.p_centralObstruction.GetValue( inputKeywords ) ) / 10; // mm -> cm
float ExpT = instance.p_exposureTime.GetValue( inputKeywords );
float AtmE = Max( 0.0F, instance.p_atmosphericExtinction.GetValue( inputKeywords ) );
float G = Max( 1.0F, instance.p_sensorGain.GetValue( inputKeywords ) );
float QEff = Max( 1.0F, instance.p_quantumEfficiency.GetValue( inputKeywords ) );
if ( Wc <= 0 )
throw Error( "Invalid filter wavelength" );
if ( Tr <= 0 || Tr > 1 )
throw Error( "Invalid filter transmissivity" );
if ( Delta <= 0 )
throw Error( "Invalid filter width" );
if ( Ap <= 0 )
throw Error( "Invalid aperture" );
if ( Cobs < 0 || Cobs >= Ap )
throw Error( "Invalid central obstruction area" );
if ( ExpT <= 0 )
throw Error( "Invalid exposure time" );
if ( AtmE < 0 || AtmE >= 1 )
throw Error( "Invalid atmospheric extinction" );
if ( G <= 0 )
throw Error( "Invalid sensor gain" );
if ( QEff <= 0 || QEff > 1 )
throw Error( "Invalid quantum efficiency" );
FITSKeywordArray keywords;
float pedestal = 0;
bool foundPedestal = false;
for ( FITSKeywordArray::const_iterator i = inputKeywords.Begin(); i != inputKeywords.End(); ++i )
if ( i->name == "PEDESTAL" )
{
if ( i->value.TryToFloat( pedestal ) )
foundPedestal = true;
pedestal /= 65535; // 2^16-1 maximum value of a 16bit CCD.
}
else
keywords.Add( *i );
if ( foundPedestal )
Console().NoteLn( "<end><cbr><br>* FluxCalibration: PEDESTAL keyword found: " + view.FullId() );
// double F = Wc * inv_ch * (1 - Tr) * Delta * Ap * Cobs * ExpT * AtmE * G * QEff;
double F = Wc * inv_ch * (1 - AtmE) * Delta * ( Const<double>::pi() / 4 * ( Ap*Ap - Cobs*Cobs ) ) * ExpT * Tr * G * QEff;
size_type N = img.NumberOfPixels();
typename P::sample* f = img.PixelData( 0 );
const typename P::sample* fN = f + N;
double flxMin = DBL_MAX;
double flxMax = 0;
for ( ; f < fN; ++f, ++img.Status() )
{
double I; P::FromSample( I, *f );
I = (I - pedestal)/F;
*f = P::ToSample( I );
if ( I < flxMin )
flxMin = I;
if ( I > flxMax )
flxMax = I;
}
img.Rescale();
keywords.Add( FITSHeaderKeyword( "FLXMIN",
IsoString().Format( "%.8e", flxMin ),
"" ) );
keywords.Add( FITSHeaderKeyword( "FLXRANGE",
IsoString().Format( "%.8e", flxMax - flxMin ),
"FLXRANGE*pixel_value + FLXMIN = erg/cm^2/s/nm" ) );
keywords.Add( FITSHeaderKeyword( "FLX2DN",
IsoString().Format( "%.8e", F*65535 ),
"(FLXRANGE*pixel_value + FLXMIN)*FLX2DN = DN" ) );
//.........这里部分代码省略.........
示例2: AddView
static void AddView( StringList& items, const View& v )
{
String id( v.FullId() );
if ( !items.Contains( id ) )
items.Add( id );
}
示例3: ProcessCommandLine
int LinearFitProcess::ProcessCommandLine( const StringList& argv ) const
{
ArgumentList arguments =
ExtractArguments( argv, ArgumentItemMode::AsViews, ArgumentOption::AllowWildcards );
LinearFitInstance instance( this );
bool launchInterface = false;
int count = 0;
for ( ArgumentList::const_iterator i = arguments.Begin(); i != arguments.End(); ++i )
{
const Argument& arg = *i;
if ( arg.IsNumeric() )
{
if ( arg.Id() == "r0" || arg.Id() == "reject-low" )
{
CHECK_IN_NORM_RANGE;
instance.rejectLow = arg.NumericValue();
}
else if ( arg.Id() == "r1" || arg.Id() == "reject-high" )
{
CHECK_IN_NORM_RANGE;
instance.rejectHigh = arg.NumericValue();
}
else
throw Error( "Unknown numeric argument: " + arg.Token() );
}
else if ( arg.IsString() )
{
if ( arg.Id() == "v" || arg.Id() == "reference-view" )
instance.referenceViewId = arg.StringValue();
else
throw Error( "Unknown string argument: " + arg.Token() );
}
else if ( arg.IsSwitch() )
{
throw Error( "Unknown switch argument: " + arg.Token() );
}
else if ( arg.IsLiteral() )
{
if ( arg.Id() == "-interface" )
launchInterface = true;
else if ( arg.Id() == "-help" )
{
ShowHelp();
return 0;
}
else
throw Error( "Unknown argument: " + arg.Token() );
}
else if ( arg.IsItemList() )
{
++count;
if ( arg.Items().IsEmpty() )
{
Console().WriteLn( "No view(s) found: " + arg.Token() );
throw;
}
for ( StringList::const_iterator j = arg.Items().Begin(); j != arg.Items().End(); ++j )
{
View v = View::ViewById( *j );
if ( v.IsNull() )
throw Error( "No such view: " + *j );
if ( v.FullId() != IsoString( instance.referenceViewId ).Trimmed() )
instance.LaunchOn( v );
else
Console().WarningLn( "<end><cbr>** Skipping reference view: " + v.FullId() );
}
}
}
if ( launchInterface )
instance.LaunchInterface();
else if ( count == 0 )
{
if ( ImageWindow::ActiveWindow().IsNull() )
throw Error( "There is no active image window." );
instance.LaunchOnCurrentView();
}
return 0;
}