Usage of findPixel
Return to directory of Todd's CASA extensions
Takes an image and converts a list of pixels to a list of RA,Decs and (optionally) the separation (in arcseconds) from a reference position. See also
findRADec.
Usage
au.findPixel(image, pixelfile='', pixel='', referencePosition=None, precision=2,
outputfile=None, getvalue=False, beam=None, format='sexagesimal'):
Inputs:
- Image should be recognizable to casa (FITS or casa native image or cube).
- pixelfile: expects a text file containing lines in any of these formats:
- sourcename1 '243, 347'\n
- sourcename2 "243, 347"\n
- sourcename3 243, 347\n
- Pixels can be integers or floating point values.
- pixel: this parameter must be a string of the format: 'x,y', (integers or floats), or a list of length 2
- Ignores lines with '#' as the first character, and lines lacking a comma.
- Reference Position should be a tuple: [RA,Dec] each in degrees
- getvalue: if True, then print the pixel value
- beam: if not None, then interpret this as the FHWM beam in arcsec, assume the image is in MJy/sr, and compute the Jy/beam at this pixel
- format: 'sexagesimal', 'radians', or 'degrees'
Returns:
- format = 'sexagesimal':
- if one pixel: a single sexagesimal string: HH:MM:SS.SSS +DD:MM:SS.SS
- if more than one pixel: a list of strings
- format = 'radians' or 'degrees':
- if one pixel: [ra, dec]
- if more than one pixel: a list of [ra,dec] values
See this
example pixelfile.
Examples
CASA <3>: au.findPixel('Juno0.apcal_R1.image.imsmooth',pixel=au.imageCentroid('Juno0.apcal_R1.image.imsmooth',fractionalThreshold=0.1),format='degrees')
Set threshold to 0.002833
Image statistics: mean=0.000026 median=0.000000 max=0.028327 min=0.000000
488.150885 500.625473 08:14:46.277534 +06:19:11.80024
Out[3]: [123.69282306005104, 6.319944510915164]
CASA <2>: au.findPixel('/net/shadowfax/export/data_2/30Dor_ALMA/Line_cubes/30DorBand3.ms.HCOp.image.pbcor.CONV',
/users/thunter/pixelfile',referencePosition=[84.6779,-69.1009] )
Far_east 81 313 05:38:56.41 -69:04:16.809 129.315741
NE_Dark 178 292 05:38:50.98 -69:04:23.123 109.509072
Bright_E 132 250 05:38:53.56 -69:04:35.718 105.086109
Bright_W 145 243 05:38:52.83 -69:04:37.819 101.199849
Center 208 229 05:38:49.30 -69:04:42.025 88.585214
Center_south 207 222 05:38:49.36 -69:04:44.125 86.786799
South_center 215 211 05:38:48.91 -69:04:47.425 82.796170
H2O_maser 256 219 05:38:46.62 -69:04:45.026 80.979839
NE_ofmaser 248 235 05:38:47.06 -69:04:40.226 86.244302
Double_E 281 233 05:38:45.22 -69:04:40.825 83.511075
Double_W 287 237 05:38:44.88 -69:04:39.625 84.428012
North_Pillar 249 168 05:38:47.01 -69:05:00.326 67.013816
Southern 282 146 05:38:45.16 -69:05:06.925 57.837019
Far_west 412 168 05:38:37.88 -69:05:00.311 68.013238
NF_north 242 366 05:38:47.40 -69:04:00.926 124.880434
NF_center 247 356 05:38:47.12 -69:04:03.926 121.642743
NF_south 243 347 05:38:47.34 -69:04:06.626 119.240012
Output file = /users/thunter/pixelfile.radec
--
ToddHunter - 2012-12-04