[Casa-framework] 'pix' unit (was ia.moments)

Raymond Rusk Raymond.Rusk at nrc-cnrc.gc.ca
Tue Dec 5 14:21:07 EST 2006


Hi David,

The issue came up in the first place because I failed to include

 	UnitMap::putUser("pix",UnitVal(1.0), "pixel units");

in the ia.moments() implementation.  I fixed that and checked it into the 
svn repository so it should no longer be a problem.  No one has gotten 
back to me about moments() so I am taking that as a good sign.

I am finding plenty of other problems in image as I am just now beginning 
to test it.  There will be some significant updates to the implementation 
in a couple of days.

Raymond

On Tue, 5 Dec 2006, David King wrote:

> Just a tiny additional note on "pix" units, (which I am stumbling through at
> the moment):
>
> As Wim indicates, "pix" isn't a valid unit string until you define it to be.
>  A one-shot (and static) routine WCBox::unitInit() is WCBox's way of
> accomplishing that, so that "pix" Units can be used subsequently in such
> regions (or anywhere else); it is called in all the WCBox constructors.
> (WCPoly has a similar routine.  I believe the WCRegion classes most actively
> support "pix" and essentially define its semantics).
>
> Unfortunately, defining "pix" in the WCBox constructors is not quite soon
> enough, if you want to pass "pix" Quanta _to_ those constructors;
> furthermore, unitInit() is private.  As a workaround:
>
>   WCBox dummy;
>
> ...will do the trick.  But I think making unitInit() public is slightly
> cleaner, and could do no conceivable harm.  Any opinion, Ger (or others)?
>
> dk
>
>
>>> Lindsey Davis wrote:
>>> I am trying to use the moments task on an image whose shape is
>>>
>>> [256L, 256L, 1L, 31L]
>>>
>>> I tried both
>>>
>>> rtn = ia.moments([0],3)
>>> rtn = ia.moments([0],4)
>>>
>>> because I am not sure how degenerate axes are handled but
>>> both give the following error
>>>
>>> ed Nov 29 22:46:54 2006    SEVERE image::moments:
>>> Exception Reported: Unit::check Illegal unit string 'pix'
>
>
> Wim.Brouw at csiro.au wrote:
>
>> During the images production Neil wanted to be able to let the user
>> specify things like 'pix' 'piel' 'beam' etc.
>> The quanta can handle that (like it does in the case of FITS where
>> things lik Km KM JY sec SEC etc are used) by having a user unit 'map'
>> that can be filled at will. (pix e.g. is equanled to the countable non
>> dimensional unit '_').
>> In the original design this user map was a global static map; i.e. there
>> should be persistence soemwhere).
>
> _______________________________________________
> Casa-framework mailing list
> Casa-framework at donar.cv.nrao.edu
> http://listmgr.cv.nrao.edu/mailman/listinfo/casa-framework
>

-- 
Dr. Raymond Rusk                                        Dr. Raymond Rusk
ALMA Software Engineer                           Ingenieur Logiciel ALMA
National Research Council Canada   Conseil national de recherches Canada
Herzberg Institute of Astrophysics   L'Institut Herzberg d'Astrophysique
DRAO, P.O. Box 248                                    OFRA, B.P. Box 248
Penticton, BC V2A 6J9           |\^/|         Penticton, (C.-B.) V2A 6J9
Government of Canada         _|\|   |/|_          Gouvernement du Canada
Tel: (250)490-4347           >         <              Tel: (250)490-4347
Fax: (250)493-7767            >_./|\._<               Fax: (250)493-7767
Raymond.Rusk at nrc-cnrc.gc.ca                  Raymond.Rusk at nrc-cnrc.gc.ca


More information about the Casa-framework mailing list