Source
AnnRectBox *box = new AnnRectBox( blcx, blcy, trcx, trcy, im.coordinates(), shape, stokes );
//# Copyright (C) 2000,2001,2003
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This program is free software; you can redistribute it and/or modify it
//# under the terms of the GNU General Public License as published by the Free
//# Software Foundation; either version 2 of the License, or (at your option)
//# any later version.
//#
//# This program is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
//# more details.
//#
//# You should have received a copy of the GNU General Public License along
//# with this program; if not, write to the Free Software Foundation, Inc.,
//# 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
using namespace casa;
int main () {
/*
PagedImage<Float> pim("g35_sma_usb_12co.image");
CoordinateSystem csys1 = pim.coordinates();
IPosition shape1 = pim.shape();
/*
Vector<Double> refVal = csys1.referenceValue();
refVal[0] = 4.94827;
refVal[1] = 0.035055;
Vector<Double> refPix = csys1.referencePixel();
refPix[0] = 40;
refPix[1] = 40;
csys1.setReferencePixel(refPix);
Vector<String> units = csys1.worldAxisUnits();
units[0] = "arcsec";
units[1] = "arcsec";
csys1.setWorldAxisUnits(units);
RegionTextList rlist( "txy.crtf", csys1, shape1 );
Vector<AsciiAnnotationFileLine> aaregions = rlist.getLines( );
for ( unsigned int i=0; i < aaregions.size( ); ++i ) {
if ( aaregions[i].getType( ) != AsciiAnnotationFileLine::ANNOTATION ) continue;
const AnnotationBase* ann = aaregions[i].getAnnotationBase();
cout << " >>>==>> " << ann->getLabel( ) << endl;
cout << " >>>==>> " << ann->getFontSize( ) << endl;
}
return 0;
*/
try {
CoordinateSystem csys = CoordinateUtil::defaultCoords4D();
AnnRegion::unitInit();
LogIO log;
IPosition shape(4, 400,400,1,6000);
Vector<Double> refVal = csys.referenceValue();
refVal[0] = 300;
csys.setReferenceValue(refVal);
{
log << LogIO::NORMAL
<< "mixed world and pixel coordinates throws exception"
<< LogIO::POST;
Bool thrown = true;
Quantity blcx(0.01, "deg");
Quantity blcy(0, "deg");
Quantity trcx(0, "deg");
Quantity trcy(0.01, "pix");