comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Extracting a sub-cube from a cube
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Extracting a sub-cube from a cube [message #93403] Tue, 05 July 2016 16:13 Go to next message
Miguel is currently offline  Miguel
Messages: 18
Registered: April 2015
Junior Member
Hi,

I have a data cube with longitude, latitude and velocity and I wanted to know if there was a good alternative to the hextract routine but for data cube ?

Moreover, is it possible to use hextract for a velocity-latitude 2-D array (in short, a 2D fits file whose CTYPE1-2 are not longitude and latitude)and update the header ? I manage to extract the area I wanted but the WCS keywords disappear after the extraction.

Thank you

Miguel
Re: Extracting a sub-cube from a cube [message #93404 is a reply to message #93403] Wed, 06 July 2016 07:03 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Tuesday, July 5, 2016 at 7:13:29 PM UTC-4, miguelfigue...@gmail.com wrote:

>
> Moreover, is it possible to use hextract for a velocity-latitude 2-D array (in short, a 2D fits file whose CTYPE1-2 are not longitude and latitude)and update the header ? I manage to extract the area I wanted but the WCS keywords disappear after the extraction.
>

I don't know of any existing routines in the Astronomy library to do this, but it is not hard to do it yourself. The FITS format describes a linear velocity scale with a reference pixel (CRPIX1) and value at the reference pixel (CRVAL1), and increment per pixel (CDELT1). When you extract a subarray you are just shifting the origin so CDELT1 doesn't change. You just need to update CRPIX1 so it accounts for the offset. So if you extract starting at pixel 30, you just need to subtract 30 from CRPIX1 (using sxaddpar for example).
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: secondary Y axis
Next Topic: How to print the mpfitfun output to a file?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:11:41 PDT 2025

Total time taken to generate the page: 0.00582 seconds