https://casaguides.nrao.edu/index.php?title=Imval&feed=atom&action=historyImval - Revision history2024-03-28T18:07:09ZRevision history for this page on the wikiMediaWiki 1.38.6https://casaguides.nrao.edu/index.php?title=Imval&diff=16882&oldid=prevJott: Replaced content with "{{imval}}"2015-05-06T23:30:23Z<p>Replaced content with "{{imval}}"</p>
<a href="https://casaguides.nrao.edu/index.php?title=Imval&diff=16882&oldid=1341">Show changes</a>Jotthttps://casaguides.nrao.edu/index.php?title=Imval&diff=1341&oldid=prevJgallimo at 15:52, 16 February 20102010-02-16T15:52:45Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:52, 16 February 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><pre></ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Help on imval task:</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Help on imval task:</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l138">Line 138:</td>
<td colspan="2" class="diff-lineno">Line 139:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> print "Mask values for 21st channel: </div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> print "Mask values for 21st channel: </div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>", swapped_mask[0]</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>", swapped_mask[0]</div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></pre></ins></div></td></tr>
</table>Jgallimohttps://casaguides.nrao.edu/index.php?title=Imval&diff=1340&oldid=prevJgallimo: Created page with 'Help on imval task: Get the data value(s) and/or mask value in an image. The data point(s) to be retrieved are those found in the specified region, which may be: …'2010-02-16T15:52:15Z<p>Created page with 'Help on imval task: Get the data value(s) and/or mask value in an image. The data point(s) to be retrieved are those found in the specified region, which may be: …'</p>
<p><b>New page</b></p><div>Help on imval task:<br />
<br />
Get the data value(s) and/or mask value in an image.<br />
The data point(s) to be retrieved are those found in the specified<br />
region, which may be:<br />
1. A region file from the viewer (region parameter)<br />
2. A region specified by a set of rectangular<br />
pixel coordinates, the channel ranges and/or the Stokes.<br />
<br />
For directed output, run as <br />
myoutput = imval()<br />
<br />
<br />
Keyword arguments:<br />
imagename -- Name of input image<br />
Default: none; Example: imagename='ngc5921_task.im'<br />
region -- region file or name.<br />
Use the viewer, then region manager to select regions of<br />
the image to process. Similar to box, but graphical<br />
Or the name of a region stored with the image, <br />
use rg.namesintable()<br />
to retrieve the list of names.<br />
Default: none<br />
Example: region='myimage.im.rgn'<br />
region='region1'<br />
box -- A box region on the directional plane<br />
Only pixel values acceptable at this time.<br />
Default: '' (referencepixel values for the Directional coord); <br />
Example: box='10,10,50,50'<br />
box = '10,10,30,30,35,35,50,50' (two boxes)<br />
box = '-1,-1' (all points)<br />
chans -- channel numbers<br />
Range of channel numbers to include in statistics<br />
All spectral windows are included<br />
Default:''= all; Example: chans='3~20'; <br />
chans='-1' (all channels)<br />
stokes -- Stokes parameters to analyze.<br />
Default: none (all); Example: stokes='IQUV'; <br />
stokes='I,Q'<br />
stokes='-1' (all stokes values)<br />
Options: 'I','Q','U','V','RR','RL','LR','LL','XX','YX','XY','YY', ...<br />
<br />
General procedure:<br />
<br />
1. Specify inputs, then<br />
<br />
2. myoutput = imval()<br />
or specify inputs directly in calling sequence to task<br />
myoutput = imsval(imagename='image.im', etc)<br />
<br />
3. myoutput['KEYS'] will contain the result associated with any<br />
of the keys given below<br />
<br />
KEYS CURRENTLY AVAILABLE<br />
blc - absolute PIXEL coordinate of the bottom left corner of <br />
the bounding box surrounding the selected region<br />
trc - the absolute PIXEL coordinate of the top right corner <br />
of the bounding box surrOunding the selected region<br />
axes - List the data stored in each axis of the data block.<br />
unit - unit of the returned data values.<br />
data - data value(s) found in the given region<br />
mask - mask value(s) found in the given region<br />
<br />
NOTE: The data returned is in the same order as it is internally<br />
stored, typically RA, DEC, spectral, stokes. Also both the data<br />
and mask values are returned as Python Numpy arrays, for more<br />
information on how to manipulate them see<br />
http://numpy.scipy.org/#array_interface<br />
<br />
<br />
Additional Examples<br />
# The value and mask value at a single point (5,17,2,Q)<br />
imval( 'myImage', box='5,5,17,17', chans=2, stokes='Q' )<br />
<br />
# Select and report on two box regions<br />
# box 1, bottom-left coord is 2,3 and top-right coord is 14,15<br />
# box 2, bottom-left coord is 30,31 and top-right coord is 42,43<br />
# Note that only the boxes for the <br />
imval( 'myImage', box='2,3,14,15;30,31,42,43' )<br />
<br />
# Select the same two box regions but only channels 4 and 5<br />
imval( 'myImage', box='2,3,14,15;30,31,42,43', chan='4~5' )<br />
<br />
# Select all channels greater the 20 as well as channel 0.<br />
# Then the mean and standard deviation are printed<br />
# Note that the data returned is a Python numpy array which<br />
# has built in operations such as min, max, and means as<br />
# demonstrated here.<br />
results = imval( 'myImage', chans='>20;0' )<br />
imval_data=results['data']<br />
mask=results['mask']<br />
print "Data max: ", imval_data.max(), " mean is ", imval_data.mean()<br />
swapped_data=imval_data.swapaxes(0,2)<br />
swapped_mask=mask.swapaxes(0,2)<br />
KEYS CURRENTLY AVAILABLE<br />
blc - absolute PIXEL coordinate of the bottom left corner of <br />
the bounding box surrounding the selected region<br />
trc - the absolute PIXEL coordinate of the top right corner <br />
of the bounding box surrOunding the selected region<br />
axes - List the data stored in each axis of the data block.<br />
unit - unit of the returned data values.<br />
data - data value(s) found in the given region<br />
mask - mask value(s) found in the given region<br />
<br />
NOTE: The data returned is in the same order as it is internally<br />
stored, typically RA, DEC, spectral, stokes. Also both the data<br />
and mask values are returned as Python Numpy arrays, for more<br />
information on how to manipulate them see<br />
http://numpy.scipy.org/#array_interface<br />
<br />
<br />
Additional Examples<br />
# The value and mask value at a single point (5,17,2,Q)<br />
imval( 'myImage', box='5,5,17,17', chans=2, stokes='Q' )<br />
<br />
# Select and report on two box regions<br />
# box 1, bottom-left coord is 2,3 and top-right coord is 14,15<br />
# box 2, bottom-left coord is 30,31 and top-right coord is 42,43<br />
# Note that only the boxes for the <br />
imval( 'myImage', box='2,3,14,15;30,31,42,43' )<br />
<br />
# Select the same two box regions but only channels 4 and 5<br />
imval( 'myImage', box='2,3,14,15;30,31,42,43', chan='4~5' )<br />
<br />
# Select all channels greater the 20 as well as channel 0.<br />
# Then the mean and standard deviation are printed<br />
# Note that the data returned is a Python numpy array which<br />
# has built in operations such as min, max, and means as<br />
# demonstrated here.<br />
results = imval( 'myImage', chans='>20;0' )<br />
imval_data=results['data']<br />
mask=results['mask']<br />
print "Data max: ", imval_data.max(), " mean is ", imval_data.mean()<br />
swapped_data=imval_data.swapaxes(0,2)<br />
swapped_mask=mask.swapaxes(0,2)<br />
print "Data values for 21st channel: <br />
", swapped_data[0]<br />
print "Mask values for 21st channel: <br />
", swapped_mask[0]</div>Jgallimo