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

Home » Public Forums » archive » Re: change pixel scale
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
Re: change pixel scale [message #80321] Mon, 28 May 2012 09:17
spasoklampanas is currently offline  spasoklampanas
Messages: 8
Registered: May 2012
Junior Member
On May 27, 6:03 pm, Russell Ryan <rr...@stsci.edu> wrote:
> On May 26, 7:46 am, spasoklampa...@yahoo.com wrote:
>
>>         Hi
>
>>     I have some fits files (astronomy images) that have a different
>> pixel scale. How is it possible to bring them on the same pixel scale?
>> The given routine of degrade is not suitable, since it degrades the
>> image resolution by a factor of two, which is not my case.
>
>>       Thanks a lot.
>
> So...
>
> There are several ways to skin this cat, and they depend on how
> careful you want to be.  Before we get into those ways, you need to
> answer a few things about your images...
>
> (1) Do they both have WCS in the headers that you trust?
> (2) Are they astrometrically aligned already, and you just want to re-
> pixelate?
>
> If the answer to (1) is "no," then we need to fix that first.
> Hopefully, you know *roughly* where your field is and can just grab a
> bunch of stars either from the DSS or SDSS to get the precise WCS
> mapped out.  If not, then you need to go outside of IDL get the job
> done.
>
> Then you can use hastrom.pro (in the IDL astro library) to register
> the two images.  This does only a bilinear (I think?) interpolation
> --- which may not be good enough for you.  If you have a weight map
> (or error image), then you need to process that as well --- but
> remember you'll need to work with variances!!
>
> If you don't like bilinear, then the only way I know how to do this is
> to go outside of IDL and use SCAMP and SWarp to get the job done.
>
> Good luck!
> Russell

Just to sound even more stupid now I got this error message:

% HASTROM: ERROR - No overlap found between original and reference
images
% HASTROM: Be sure you have the right headers and the right equinoxes
% Compiled module: WRITEFITS.


The Galactic coordinates of the cloud are the same. On ds9 I put
the cursor at the centre of the cloud and on both cases the galactic
latitude and longitude are the same. What is my mistake though?
Re: change pixel scale [message #80331 is a reply to message #80321] Sun, 27 May 2012 08:03 Go to previous message
Russell Ryan is currently offline  Russell Ryan
Messages: 122
Registered: May 2012
Senior Member
On May 26, 7:46 am, spasoklampa...@yahoo.com wrote:
>         Hi
>
>     I have some fits files (astronomy images) that have a different
> pixel scale. How is it possible to bring them on the same pixel scale?
> The given routine of degrade is not suitable, since it degrades the
> image resolution by a factor of two, which is not my case.
>
>       Thanks a lot.

So...

There are several ways to skin this cat, and they depend on how
careful you want to be. Before we get into those ways, you need to
answer a few things about your images...

(1) Do they both have WCS in the headers that you trust?
(2) Are they astrometrically aligned already, and you just want to re-
pixelate?

If the answer to (1) is "no," then we need to fix that first.
Hopefully, you know *roughly* where your field is and can just grab a
bunch of stars either from the DSS or SDSS to get the precise WCS
mapped out. If not, then you need to go outside of IDL get the job
done.

Then you can use hastrom.pro (in the IDL astro library) to register
the two images. This does only a bilinear (I think?) interpolation
--- which may not be good enough for you. If you have a weight map
(or error image), then you need to process that as well --- but
remember you'll need to work with variances!!

If you don't like bilinear, then the only way I know how to do this is
to go outside of IDL and use SCAMP and SWarp to get the job done.

Good luck!
Russell
Re: change pixel scale [message #80334 is a reply to message #80331] Sat, 26 May 2012 08:56 Go to previous message
spasoklampanas is currently offline  spasoklampanas
Messages: 8
Registered: May 2012
Junior Member
On May 26, 6:28 pm, wlandsman <wlands...@gmail.com> wrote:
> How do you know that it "didn't do the job"?    How are you determining the pixel scale?
>
>
>
>
>
>
>
> On Saturday, May 26, 2012 10:34:42 AM UTC-4, spasokl...@yahoo.com wrote:
>> On May 26, 5:01 pm, wlandsman <wlands...@gmail.com> wrote:
>>> On Saturday, May 26, 2012 7:46:20 AM UTC-4, spasokl...@yahoo.com wrote:
>>>> Hi
>
>>>>     I have some fits files (astronomy images) that have a different
>>>> pixel scale. How is it possible to bring them on the same pixel scale?
>>>> The given routine of degrade is not suitable, since it degrades the
>>>> image resolution by a factor of two, which is not my case.
>
>>>>       Thanks a lot.
>
>>> Try hastrom.pro
>
>>> http://idlastro.gsfc.nasa.gov/ftp/pro/astrom/hastrom.pro
>
>>  I have tried this script using the following:
>> fits_read, 'L1780_IR.fits', image_Ha,hdr
>> fits_read, 'L1780_Av.fits', image_Av,hdr2
>> HASTROM, image_Av, hdr2, image_Av_6, newhdr, hdr
>> writefits,'Av_6_2mass.fits',image_Av_6,newhdr
>> end
>
>>    But it didn't do the job. Is there any other way to use the script?
>> I mean another calling sequence?
>>    Thanx a lot

The cloud in the output image seems that it disappeared.No idea
why. Could that be due to the difference of the input arrays? The
dimensions are:

IMAGE_AV FLOAT = Array[2133, 1602]
IMAGE_AV_6 FLOAT = Array[250, 250]
IMAGE_HA FLOAT = Array[250, 250]

Once again, thanks a lot for your tips.
Re: change pixel scale [message #80335 is a reply to message #80334] Sat, 26 May 2012 08:28 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
How do you know that it "didn't do the job"? How are you determining the pixel scale?

On Saturday, May 26, 2012 10:34:42 AM UTC-4, spasokl...@yahoo.com wrote:
> On May 26, 5:01 pm, wlandsman <wlands...@gmail.com> wrote:
>> On Saturday, May 26, 2012 7:46:20 AM UTC-4, spasokl...@yahoo.com wrote:
>>> Hi
>>
>>>     I have some fits files (astronomy images) that have a different
>>> pixel scale. How is it possible to bring them on the same pixel scale?
>>> The given routine of degrade is not suitable, since it degrades the
>>> image resolution by a factor of two, which is not my case.
>>
>>>       Thanks a lot.
>>
>> Try hastrom.pro
>>
>> http://idlastro.gsfc.nasa.gov/ftp/pro/astrom/hastrom.pro
>
> I have tried this script using the following:
>
> fits_read, 'L1780_IR.fits', image_Ha,hdr
> fits_read, 'L1780_Av.fits', image_Av,hdr2
>
>
> HASTROM, image_Av, hdr2, image_Av_6, newhdr, hdr
>
> writefits,'Av_6_2mass.fits',image_Av_6,newhdr
>
> end
>
>
> But it didn't do the job. Is there any other way to use the script?
> I mean another calling sequence?
> Thanx a lot
Re: change pixel scale [message #80336 is a reply to message #80335] Sat, 26 May 2012 07:34 Go to previous message
spasoklampanas is currently offline  spasoklampanas
Messages: 8
Registered: May 2012
Junior Member
On May 26, 5:01 pm, wlandsman <wlands...@gmail.com> wrote:
> On Saturday, May 26, 2012 7:46:20 AM UTC-4, spasokl...@yahoo.com wrote:
>> Hi
>
>>     I have some fits files (astronomy images) that have a different
>> pixel scale. How is it possible to bring them on the same pixel scale?
>> The given routine of degrade is not suitable, since it degrades the
>> image resolution by a factor of two, which is not my case.
>
>>       Thanks a lot.
>
> Try hastrom.pro
>
> http://idlastro.gsfc.nasa.gov/ftp/pro/astrom/hastrom.pro

I have tried this script using the following:

fits_read, 'L1780_IR.fits', image_Ha,hdr
fits_read, 'L1780_Av.fits', image_Av,hdr2


HASTROM, image_Av, hdr2, image_Av_6, newhdr, hdr

writefits,'Av_6_2mass.fits',image_Av_6,newhdr

end


But it didn't do the job. Is there any other way to use the script?
I mean another calling sequence?
Thanx a lot
Re: change pixel scale [message #80337 is a reply to message #80336] Sat, 26 May 2012 07:01 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Saturday, May 26, 2012 7:46:20 AM UTC-4, spasokl...@yahoo.com wrote:
> Hi
>
> I have some fits files (astronomy images) that have a different
> pixel scale. How is it possible to bring them on the same pixel scale?
> The given routine of degrade is not suitable, since it degrades the
> image resolution by a factor of two, which is not my case.
>
>
> Thanks a lot.

Try hastrom.pro

http://idlastro.gsfc.nasa.gov/ftp/pro/astrom/hastrom.pro
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: help with mathematics
Next Topic: save a map in a pdf or eps file

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

Current Time: Wed Oct 08 11:35:09 PDT 2025

Total time taken to generate the page: 0.00642 seconds