Welcome to iraf.net Tuesday, May 07 2024 @ 04:49 PM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 Data cube co-add problem
   
westmoquette
 03/11/2011 05:43PM (Read 4263 times)  
+----
Newbie

Status: offline


Registered: 03/08/2011
Posts: 3
Here's a really tricky one (I think)...I have two IFU datacubes that I want to co-add together. They were observed on different months, so have different geocentric velocities and differential atmospheric refractions (DAR), and are dithered by 1 integer spaxel.I can correct the wavelength solution to the heliocentric reference frame using dopcor. This means my two cubes now have different CRVAL1 and CDELTs.I can correct for DAR using a routine I have.I now need to sum the two exposures, shifting by 1 integer spaxel and interpolating them to a common dispersion sampling. Imcomb handles the shift but not the spectral interpolation, whereas scomb handles the interpolation but not the shift.Is there any way to shift a 3D cube (an imshift equivalent)?
Is there any way to resample the wavelengths to a common sampling using a reference frame?Any help is very appreciated!Mark

 
Profile Email
 Quote
jturner
 03/11/2011 05:43PM  
+++++
Active Member

Status: offline


Registered: 12/29/2005
Posts: 165
Hi Mark,I'm not sure whether you're aware that the pyfmosaic PyRAF script I sent you previously can already handle such wavelength offsets (provided they are reflected accurately in the WCS)?I gave up on integer dithering since the DAR makes it non-integer anyway, though of course it may still be a convenient dither size to use.I'm not sure whether you're trying to avoid any sub-pixel resampling now that you've already corrected the DAR (assuming you know that your integer dithering is very accurate), but if the script measures very small offsets the weights should pretty much reproduce the original sample values as if you hadn't done any. There may still be edge effects from the underlying interpolation routine though, which could be something you're trying to avoid. Otherwise, it seems better not to assume that your actual offsets are exactly those demanded of the hardware.Failing that, are you sure you can't do the integer offsets you want in 3D with imcombine? I thought that was possible. It sounds like you already have a square grid. But maybe you're saying that you want an integer offset spatially and a non-integer one spectrally? In that case, can you (now that you know the heliocentric correction) wavelength calibrate your spectra such that they will come out on the same WCS, eg. by specifying w1, w2, dw etc. in dispcor?Cheers,James.

 
Profile Email
 Quote
valdes
 03/11/2011 05:43PM  
+++++
Active Member

Status: offline


Registered: 11/11/2005
Posts: 728
I started this before James' post which has some good thoughts too.The core tool in IRAF for working with data cubes was developed initially for use in the gemini package. This tool needs to be extracted as a general core IRAF images package tool but this has not yet happened. So for now the tool that should do what you want is gemini.gemtool.gemcube. This task does both resampling and combining (using a 3D drizzle technique). So what you would do is either create a dummy cube with the desired output sampling (WCS) or use one cube as the WCS reference to which you want other data resampled and combined. The reference WCS and the WCS in all the cubes must include all the corrections (DAR, helio, etc). In other words points with the same (x,y,w) are those which should contribute to the same final data cube.So you may need to install the gemini package and there may be a few configuration issues to solve. Post any problems and we can help you.Yours,
Frank Valdes

 
Profile Email
 Quote
jturner
 03/11/2011 05:43PM  
+++++
Active Member

Status: offline


Registered: 12/29/2005
Posts: 165
Yes, sorry, I should have mentioned that too. If you want a drizzle-like interpolant (which should be fine spatially if you're doing integer offsets), gemcube will be the most flexible option. In the case of mapping 2D->3D you have to hack the WCS around a bit so it knows what to do, but since you already have cubes it might be more straightforward. I have mainly been working with GMOS and haven't really used gemcube for that, as my data were well sampled and my smooth interpolation was doing the job.James.

 
Profile Email
 Quote
westmoquette
 03/11/2011 05:43PM  
+----
Newbie

Status: offline


Registered: 03/08/2011
Posts: 3
I realised over the weekend that the DAR correction script I use has the ability to incorporate known spatial offsets (e.g. dithers) - so that solves that problem. So, I can run dopcor on both input frames to correct the WCS to heliocentric, convert to cube format and correct both frames for DAR, shifting the 2nd by the integer spaxel dither offset. I then convert both back to RSS format and combine using scomb to interpolate both onto the same wavelength grid. Finally I convert back to cube.There's some interesting additional steps needed to mask blank fibres/rows, but it seems to work for now.Thanks for reminding me of pyfmosaic James - I had forgotten about that script. I'll try giving that a go (if I can find where I installed it!) as I'm sure it's way more efficient than what I describe above. Can you remind me - is there any documentation about what format the data and header should be in?Mark

 
Profile Email
 Quote
jturner
 03/11/2011 05:43PM  
+++++
Active Member

Status: offline


Registered: 12/29/2005
Posts: 165
Ah, no, there isn't really any user documentation as we have never released it formally, and you have a good point about the format. I think it currently requires a MEF file with the cube in the SCI extension, but I can tell you how to change that to read simple FITS if you need to. The requirement for the headers is just that the offsets are defined in the FITS standard CRVALn/CRPIXn/CDi_j format. These are normally updated by pyfalign, but if you already know the offsets precisely you can just edit CRVAL1/CRVAL2 to reflect the different world co-ordinates at whatever pixel CRPIX1/CRPIX2 is. Sorry that's not quite trivial after all, but it shouldn't be hard.Cheers,James.

 
Profile Email
 Quote
   
Content generated in: 0.12 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login