Data Reduction with IRAF

How to start IRAF

We use the IRAF package for Astronomical Data Reduction which is installed on a remote linux computer. You need to connect to that server remotely and work on your data. 

Here is how you can connect to this remote server which is called MU [We used to use COSMOS as iraf server in the past, so where ever you see name cosmos, you can replace it with MU now]

However, you need to use VPN to connect to this server. So you need to install the Yorku VPN from this link. 

https://www.yorku.ca/uit/faculty-staff-services/internet-access/secure-remote-access/

install the vpn and configure your secure connection. 

Every time you want to login to this server, you must start your vpn and connect. then you can SSH to the server.  You will get a confirmation on your Due mobile. after you confirm the user, you will be connected to vpn. 

We use SSH which is a secure shell to connect to this remote server. But you need a few more application to do so. 

You need to install PuTTY+Xming (for windows) and XQuratz (for Mac OS) to use SSH. However,  you don't need anything for Linux (all SSH packages are installed by default on linux).

PC users:

1-  install PuTTy and Xming on your computer. 

see the section bellow on how to get the PuTTy and Xming and install it, and configure it. 

2- Start the Xserver by searching for XLaunch and run it. Tthen search for PuTTy and open it. 

3- Within the PuTTy window, enter the Host name (or IP address) as :

mu.sci.yorku.ca

Port should be.      22

 

4- from Category on the left panel,  select “SSH”

5- Under “Auth” select  X11

6- Click select the Enable X11 forwarding

7- from Category on left panel (on the top) select “Session”

8- in right panel, under the box “Saved Session”  type   COSMOS (or any name you like for this server)

9- Click save

Step 3 to 9 is done only the first time. Next time, select COSMOS from the list and click “load”. Then continue with step 10. 

10- Click open

This opens a new Terminal with black background, asking for your login id:

11- in the new black Terminal type  your-yorkid  and hit enter

12- then type your York-password (you wont see anything, just type the password and hit enter)

you are inside the mu server now. 

13- type    hostnamectl    and hit enter 

this will show you the server information. 

14-inside your black terminal Type:  

 ds9&       then hit enter

 [it takes 10 to 50 seconds to open ds9, depending to your internet speed]

15- inside black terminal Type: 

      xgterm&     then hit enter

 

This opens a new Xgterminal. 

16- Inside Xgterminal   type:

          cl     then hit enter

 

This starts the IRAF for you. (If you create an iraf directory then you must change directory to your iraf and continue from step 14). 

———————————

Mac OS users:

1- install XQuartz on your Mac.

https://www.xquartz.org

2- Start the XQuartz (you can find it in your Lunchpad/Other)

3- Open a Terminal. 

4- inside your terminal Type:         

ssh -Y  your-yorkid@mu.sci.yorku.ca            then hit enter

it will ask you for password, then enter your York-password  and hit enter. 

it asks you for some permission, answer YES. 

You are inside the remote server now. 

5- type    hostnamectl    and hit enter 

this will show you the server information.

6-inside your terminal Type:  

ds9&       then hit enter

 [it takes 10 to 50 seconds to open ds9, depending to your internet speed] this is the application to display your images. 

7- inside terminal Type: 

      xgterm&         then hit enter

 

8- Inside Xgterm   type:

          cl          then hit enter

 

This  starts the IRAF for you. (If you create an iraf directory then you must change directory to your iraf and continue from step 6). 

 

Linux users:

Open a terminal

1- Type: 

ssh -Y yorkid@mu.sci.yorku.ca        then hit enter

it asks you for password, then type your York-password and hit enter

You are connected to remote server now.

2-type    hostnamectl    and hit enter 

this will show you the server information. 

3-inside your terminal Type:   

ds9&       then hist enter

 [it takes 10 to 30 seconds to open ds9, depending to your internet speed]

 

4- inside terminal Type: 

      xgterm&

 

5- Inside Xgterm   type:

          cl

 

This starts the IRAF for you. (If you create an iraf directory then you must change directory to your iraf and continue from step 4). 


How to transfer files from windows-PC to COSMOS

% if you have a windows OS then you need to download this application, "winscp" from this lin. 

https://winscp.net/eng/index.php

 % you can also follow this link to learn how to install, connect and transfer file using winscp. 

https://winscp.net/eng/docs/guide_secure

% Your hostname or server is 

mu.sci.yorku.ca

%  watch this video instruction

% anywhere in these videos, when it is refered to cosmos.sci.yorku.ca then replace it with this new server name   mu.sci.yorku.ca

% Please also note that your directory is located in a different address in this new server.

/data/2023SCPHYSF20703AENALECT01/yourID

% what you see in this video is for the old server. replace your old address with the abouve address. 


How to transfer files from Mac-OS to COSMOS

% open a terminal on your local mac-os. 

% within your terminal, locate the folder you wish to transfer to COSMOS (I called it NGC7640 and it has some images)

% type the following command line if you know the local and the destination address. we use "scp" which is an OpenSSH secure file copy. "-r" mean copy the directory (the folder like NGC7640 and everything insdie it). Type the following line in your local terminal. 


scp -r  /localaddress/yourfolder   yorkID@mu.sci.yorku.ca:/data/2023SCPHYSF20703AENALECT01/yourID


% for your case:   localaddress could be something like: 

% /Users/alirezarafiee/Desktop/NGC7640

% your destination address is usually like the above. replace the yourID with your own York ID.  for example   camila  can use the following.   

%    camila03@mu.sci.yorku.ca:/data/2023SCPHYSF20703AENALECT01/camila03/

% anywhere in these videos, when it is refered to cosmos.sci.yorku.ca then replace it with this new server name   mu.sci.yorku.ca


How to remove whitespace in file name

%% linux and IRAF commands don't like whitespace in file names. if you created your filename in Windows and there is whitespace in them then you need to change them. 

Bias 0001.fit          this file name need to be converted to:      Bias_0001.fit

%% if you have only one file to change name, then you can type the following in your linux terminal


mv    'Bias 0001.fit'       Bias_0001.fit

 

%% if you have more than one file to change name then:

%% 1--- if  the command rename is installed on your linux then you can use the following command line in your linux terminal. 


rename 's/\s/_/g' ./*.fit


%% 2--- if the "rename" is not installed then you need to follow this script. 

%% on COSMOS, we don't have "rename" so you need to use this following script. 

% Just copy-paste this line in your terminal (where your files are located) and click enter. 


for f in *; do mv "$f" $(echo $f | tr -d ' '); done


How to correct fits images for Bias

%%% text in red colors are done in linux terminal (black terminal)

%%% test in purple colors are doen is xgterm terminal (in Iraf environment, cl )


%%Creating master Bias using average technique with imcombine command. 


%%combine the bias images using combine=average and reject=crreject.

%% move the the directory which has the bias files. 


%create the list of Bias frames


ls *Bias* > listBias


%combineing them to a master Bias with imcombine in IRAF

type inside your iraf environment (cl)   


epar imcombine   


% this opens the "imcombine" parameters,  change the following parameters:


input            @listBias

output.        aveBias.fits

combine     average

reject           avsigclip


%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


%% in IRAF terminal type:


imcombine


%% this creates the  aveBias.fits  for you. 


%% When using a list of fit files, then you need to use  @  in front of the list name. When using @listBias, Iraf knows to go inside the listBias and use all the fit files listed there. 


%%Backup the bias since we don’t need them. (optional)


mkdir Backup

mv *Bias*.fit  Backup

mv listBias Backup


———

%%Subtracting average Bias from all frames, using imarith

% but first you need to create the list of the new names. 

%create the list of all fits files, D for Dark, F for Flats and L for Lights (galaxy, etc)

% you can do this task for all D, F and L all to gether. 


ls *.fit > listDFL


%create the list of Biasd Corrected fits filename, by adding the  BC-  to the start of each frame   (to be used in imarith). 


sed 's/^/BC_/g' listDFL > listDFL-BC


%we can subtract the master Bias from all frames now (go to Iraf xgterm and type to set the parameters)


epar imarith


%% change the following parameters: 


operand1        @listDFL

op                           -

operand2       aveBias.fits

result              @listDFL-BC


%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


%% in IRAF terminal type


imarith


%% this creates the Bias Corrected fits file with name listed in   listDFL-BC


%% since we use  @ , Iraf takes every fit file inside the listDFL and subtracts the aveBias.fits from it and save it using the name from the same row from the listDFL-BC. 


%% move all original files into a new folder called Bbackup since we don't need them any more. 

% if your original files stars with NGC then this is easy. NGC* means all files starting with NGC. 

%% if you don't have NGC at the start, then you need to move them to backup group by group. 


mv  NGC* Backup

mv aveBias.fits Backup


%%  Alternatively, if move them to backup is too hard, then create a new folder and move all your Bias Corrected fits files to this folder and change directory later and work inside that new folder.  Inside your terminal type: 

mkdir  BC

mv  BC_*.fit  BC


cd BC



How to correct fits images for Dark

%% now we need to make the master dark using imcombine and average method. 


%create the list of all Bias corrected Dark fits file

% move to the directory (folder) that you have the BC_    files. 

% create a list of the Dark fits files. 


ls  BC*Dark*.fit > listDarkBC


%create the master Dark with imcombine in IRAF

% inside you IRAF terminal, opent the imcombine to set the parameters. 


epar imcombine


%% set the parameters as bellow:


input              @listDarkBC

output           aveDarkBC.fits

combine       average

reject             avsigclip


%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


% in IRAF terminal type:


imcombine


%% this creates the aveDarkBC.fits for you. 


%% move the Bias corrected Darks into a Backup since we don't need them


mkdir Backup_DFL-BC

mv BC*Dark*.fit  Backup_DFL-BC

mv listDarkBC   Backup_DFL-BC


%% Now, we need to multiply the aveDarkBC  by the ratio of  (exposure time for each image divided by Dark exposure time) in each filter and save it as new DarkBC for each set of images we have.  Then we can subtract this average Dark from the Flat or Light for each set (for each filter).  You should have your images exposure time (check your log file). 


%% if you don't have your exposure time then you can extract it from the header of your fits file. Inside your IRAF terminal type:

%% remember, you must be in a directory where you have the original data like flats, light and dark since your original files have complete header information. you can go to your backup folder. 


imhead   @listDFL longheader=yes    >    listhead


%% then inside linux terminal type the following.  your listExpo file will have the name of the fit images and their exposure time listed in front of them. 


%make sure you check what is inside the listhead you created. if it is empty then you need to check if the images are in the same folder as your iraf. 


cat listheat


 

grep "EXPTIME"  listhead  > exposuretimes


paste    listDFL   exposuretimes   >  listExpo


%% this extracts the exposure time for every single image and list them in one file. 


%%% if your Dark exposure time is claimed to be zero, then indeed it was 0.12 seconds (that is the minimum exposure time for York CCD). you can use 0.12 seconds as your Dark exposure time, when calculating the following. 


%% because exposure times are different for different filters

%% we need to create different  average Dark Bias Crrected scaled for each image (or a set of image with same exposure time),  one for each filter (or any image set with same exposure time).  if you have only one filter (e.g Red) then you can only follow the Red filter. 

%% We need the filter exposure time for Flats and Lights for different filters. look into your listExpo file for exposure times. 

%% if you have used only one filter then you don't need the second grep. 


%% in linux terminal type:


grep "Flat" listExpo | grep "Red"


% for me, this gives 1 sec for all red flat images


grep "Light" listExpo | grep "Red" 



% for me, this gives 20 sec for all red light images


%% write this information on a paper. you are going to use it. 

%% you need to calculate a scaling factor.   f_R = ( t_Flat / t_Dark ) in red filter


% for me, the Dark exposure time is 10 seconds (your exposure time is perhaps different call it t_Dark). you also have the exposure time from above (t_Flat or t_Light).  I will use this short cuts for names --> (Red filter= R; Visible filter = Green=G; Blue filter = B)


% for my data set: (you don't need the Maximum count). 

%Flats- Exposure times:

%Filter  Exposure.     Ratio                                    Maximum count

Red:      1   sec.           fR = 1/10 =  0.1                   count = 19000

Green:  2.  sec            fG = 2/ 10=  0.2                  count = 19000

Blue :    22 sec           fB = 22/10= 2.2                  count = 19000


%Lights-exposure time

%Fliter   Exposure     Ratio

Red:      20.0 sec        fR= 20/10=2

Green:  30.0 sec        fG= 30/10=3

Blue:     80 sec           fB= 80/10=8


% You will create a master Dark (average Dark) for every Filter and data set (Flats and Lights). 

% We will use this new Dark to correct every set.

%%  use arithmetic to create the new Dark for each. Type this in IRAF terminal


epar imarith


% set the parameters as:


operand1        aveDarkBC.fits

op                           *

operand2             0.1

result                aveDarkBC4RFlat.fits


%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


% type in IRAF terminal 


imarith


%this creates a.  aveDarkBC4RFlat.fits  for you, which is the average Dark you will subtract from Red Flat images. 



% ---- you can ignore the part bellow if you don't have green and blue filter data----

epar imarith

operand1.   aveDark.fits

op                    *

operand2   0.2

result          aveDarkBC4GFlat.fits

epar imarith

operand1.   aveDark.fits

op                    *

operand2   2.2

result          aveDarkBC4BFlat.fits

% ---- you can ignore the part above if you don't have green and blue filter data----



%% now, you create the master Dark that you need to subtract from Red Light images. 

% In IRAF terminal type


epar imarith


% then set the parameters: fR = 2 calculated above


operand1      aveDarkBC.fits

op                        *

operand2           2

result              aveDarkBC4RLight.fits


%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


% In IRAF terminal type:


imarith


%% this will create the    aveDarkBC4RLight.fits. that you need to subtract from all Red Light images. 



% ---- you can ignore the part bellow if you don't have green and blue filter data----

epar imarith

operand1.   aveDark.fits

op                    *

operand2   3

result          aveDarkBC4GLight.fits

%

epar imarith

operand1.   aveDark.fits

op                    *

operand2   8

result          aveDarkBC4BLight.fits

% ---- you can ignore the part above if you don't have green and blue filter data----


%% now we can subtract the    aveDarkBC4RFlat.fits    from all Red Flats. 

% in linux terminal type:


ls  BC*Red*Flat*.fit > listRFlat


%% then create the destination file name in a list


sed 's/BC_/DBC_/g' listRFlat > listRFlat-DBC      


%% R=Red; DBC= DarkBiasCorrected

%% this creates a list of names you need to use to generate the new Dark corrected Flats in Red filter. 


%% you can subtract the master Dark from your Red Flat images 

%% in IRAF terminal type


epar imarith


%% set the parameters:


operand1          @listRFlat

op                            -

operand2         aveDarkBC4RFlat.fits

result                @listRFlat-DBC


%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


%% in IRAF terminal type 


imarith


%% this will create Dark corrected Red Flat images for you. 



%% you also need to create a Dark corrected name for your images. 

% in linux terminal type:


ls  BC*Red*Light*.fit > listRLight


% then create the destination file name in a list. 


sed 's/BC_/DBC_/g' listRLight > listRLight-DBC


%% R=Red; DBC= DarkBiasCorrected

%% this creates a list of names you need to use to generate the new Dark corrected Light in Red filter. 


%% you can subtract the master Dark from your Red Light images 

%% in IRAF terminal type


epar imarith


%% set the parameters:


operand1          @listRLight

op                            -

operand2         aveDarkBC4RLight.fits

result                @listRLight-DBC


%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


%% in IRAF terminal type 


imarith


%% this will create Dark corrected Red Light images for you. 


%% or you can move BC images to your backup folder. 

%% you can create a DBC directory and move all Dark corrected images to that folder.


% in linux terminal type:


mkdir DBC

mv DBC_*  DBC


%% change working directory, both in IRAF terminal and linux terminal


cd DBC


%% you are ready to correct for Flat field now. move to the next section. 

How to correct fits images for Flat

%% Now we need to create a master Flat to normalize our galaxy images. 

%% you have all your Dark corrected Flats and Light in new Directory called DBC

%% change your working directory to DBC

% in linux terminal type

cd DBC

% in IRAF terminal type 

cd DBC


%% You need to normalize the Flat file and combine them to make a master Flat. 

%% you can first combine them and then normalize them.  

% in linux terminal type

ls DBC_*Flat* > listRF

% in IRAF terminal type

epar imcombine

%% set the parameters as:

input              @listRF

output           aveRFlat.fits

combine       average

reject             avsigclip


%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


% in IRAF terminal type:


imcombine


%% this creates the aveRFlat.fits for you. 

----------

%% Now, we need to find the mean value in this master Flat. 

% in IRAF terminal type:

imstat aveRFlat.fits

% this will report something like this. 

              IMAGE      NPIX      MEAN    STDDEV       MIN       MAX

        aveRFlat.fits   1571328    17785.     320.8    14857.    19228.

%% we need the value of the mean which is 17785 from this estimate. 

%% in IRAF terminal type

epar imarith

%% set the parameters as follow

operand1          aveRFlat.fits

op                            /

operand2         17785

result                aveRFlat_Norm.fits


%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


%% in IRAF terminal type 


imarith


%% this will create Normalized master Flat for you. 

% check your Normalized master Flat. in IRAF terminal type:

imstat aveRFlat_Norm.fits

% this will report something like this. 

                IMAGE      NPIX      MEAN    STDDEV       MIN       MAX

   aveRFlat_Norm.fits   1571328        1.   0.01804    0.8353     1.081

% which shows that the mean value is 1.

% you can also display this normalized flat field in ds&. in IRAF terminal type

disp aveRFlat_Norm.fits 1

%% Now you are ready to correct your galaxy images for Flat field.

%% first you need to create the list of Red Light images

%in linux terminal type

ls DBC_*Light*.fit > listRLight

% you also need to create the destination name for Flat corrected Lights. 

sed 's/DBC_/FDBC_/g' listRLight > listRLight-FDBC 

% then in IRAF terminal type

epar imarith

% set the parameters as follow

operand1          @listRLight

op                            /

operand2         aveRFlat_Norm.fits

result                 @listRLight-FDBC


%% after you set the papameters,  hold the shift  and hit   :  (coln) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


%% in IRAF terminal type 


imarith


%% this will Flat filed correction and create Flat corrected Light images, as listed in listRLight-FDBC


%% move all this Flat corrected images to a new folder. 

%in linux terminal type


mkdir FDBC


mv FDBC*.fits  FDBC


% you can change your working directory to FDBC now


cd FDBC


% in IRAF terminal type 

cd DBC


%% now you are ready for the last step. to combine all galaxy images and create your single final galaxy image. move to the next section. 





How to display your flat corrected images to find if they need alignment 

%%  change your working directory to FDBC where you have all your Flat-Dark-Bias corrected galaxy images are located. 

% in both IRAF and linux terminal type

pwd

% to know the where you are.

ls

% to know what you have in this working directory. 

%%% you need to take a look at all your images to make sure they are aligned 

%% since the image names might be ver long, you can change them to something simple. 

% in linux terminal type:

ls FDBC_*.fit > listRL

%% you need to know how long is the name to know how many character you need to cut from each name. 

cat listRL | awk '{print length($0)}' 

%% in my case, I get 44 for all my images. 

%% I need to know how many character I can cut from the name to keep a unique name for each file. The unique part of the name is the last 3 number.  So I will only keep 7 last character. 

% like  0161.fit         that   means  44 - 7 = 37    So, I will cut the first 37 character

%% in linux terminal type

cat listRL | cut -c37- > listRLNew

% check the name. if you don't like the names, then keep more characters. 

% in linux terminal type

cat listRLNew

%%% now, you need to copy the image to new name. You can keep the old files as backup. 


sed 's/^/cp  /g' listRL > part1

paste part1 listRLNew > part2

chmod 755 part2

./part2 

%% you can check if the new files are created. 

ls *.fit

%% you should have the new images. 


%% we need to make sure all images are aligned. You need to display them in ds9 and check them. here is one way to do it. 

%% each time you can open up to 14 images in 14 separate frames in ds9

% in IRAF terminal type. 

disp image1.fit 1

disp image2.fit 2

disp image3.fit 3

...

disp image14.fit 14

%% because you are connecting to COSMOS via a slow internet connection, this might be very slow. 

%% Instead you can only open 3 images. the first one, the last one and one in the middle. 

%% go to your ds9,  look for "frame" bottun. click on frame. then click on "blink"

%% look carefully at one star and a group of star and see if you can notice any shift.

%% if it is hard to notice any shift then use "zoom" buttun and zoom in. then repeat the blink.

%% if the is no shift then you can combine all images. 

%% if there is any shift then you need to aligne the images and then combine them. 


How to create the final galaxy image if you don't need any shift

%% if your images don't need any shifts then you follow these steps. 

%% Now you need to cmbine the flat corrected images of your galaxy. 

% in linux terminal type:

ls FDBC_*.fit > listRL

% in IRAF terminal type

epar imcombine

%% set the parameters as:

input              @listRL

output           aveRLight.fits

combine       average

reject             avsigclip


%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


% in IRAF terminal type:


imcombine


%% this creates the aveRLight.fits for you. You can continue your science from the project manual. This is your best image calibrated and cleaned which you need to work with. 

How to align images of your galaxy then create final galaxy image. 

%% if your images are not aligned then you need align them before you can comboine them. 

%% Follow these steps to align your images. 

% in linux terminal type:

ls FDBC_*.fit > listRL

% display all of your images and find the best image you have (the sharpest and most clear one),  you can use that as your refremce image.  you need to make a doplicate of that by copy that to   ref.fit

% in linux terminal (black terminal) type

cp  best-image-you-have.fit  ref.fit

%% in your IRAF (xgterm) terminal type

disp ref.fit 1

%% now you need to find 3 stars to use as references for your shift.  You need to get the stars x and y coordinates using imexamine. 

%% in your IRAF (xgterm) terminal type

imexamine ref.fit

%% this task creates a connetion between the image ref.fit you already opened in ds9& and your iraf command imexamine. Now you can select 3 stars one by one to find their physical location. 

%% 1- click on your ds9 (to select ds9 as your working window).. (make sure your xgterm is next to your ds9)

%% 2- move your mouse on a bright star ( make sure there is not many stars around it; find a round and lonely star). 

%% 3- while your mouse is on that star, on your IRAF xgterm terminal, click on letter-charachter        a        on your keyboard (lower case) while your mouse is on your star. (make sure your xgterm is next to your ds9)

%%% this gives you the information under your mouse arrow, make sure it in on your star. 

%% then move your mouse on another star and repeat by cliking on    a     key on your keyboard. 

%% then move your mouse on a third star, make sure your create a tirangle shape with your 3 stars. then hit keyboard character     a     again. 

%% the more the number of stars the better will be the shift, but you need at least 3 stars not on a line. 

%% to exit this commond, type q in your xgterm and hit enter

%% collect the physical coordinate and save them in a file, call it   coord.txt

%% for example you can use.    vi    editor. in your linux terminal type

vi coord.txt

%% hit    i    on your keyboard to insert text.

%% copy-paste the x and y coordinates for each star, one by one, from your xgterm to this file. 

%% make sure each pair of coordinates are in one row.


%% after you entered all coordinates,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 

% in linux terminal (black terminal) type to check what you have recorded. 

cat coord.txt


% you get something like this. 3 stars physical coordinates (for safe practice, you are recommended to use 5 or 6 stars, which are bright in all frames)

766.89 666.42

737.68 601.62

869.23 540.17

% you also need to create a list of name for your shifted images. 

% in your linux terminal type

sed 's/^/S/g' listRL > listRLS

% this creates a list of new name to be used by imalign. new images will be create with this names. 

%% now it is time to shift your images. 

%% in your IRAF (xgterm) terminal type

epar imalign

%% set the following parameters

input =               @listRL

reference=        ref.fit

coords=             coord.txt

output=             @listRLS

boxsize=             11

bigsize=              21

%%%% the value of boxsize and bigsize here just estimate for my images. you may need to change these two numbers to find what works for your frames. 

%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


% in IRAF terminal type:


imalign


%% this will create your shifted images based on the 3 stars you selected. 

%% if gives you error, that means either your box is too small or too large and system can not decide which star you are using. You have to adjust the boxsize and bigsize until it is good enough and imalign creates your shifted images. 



%% Now, you can use this new shifted imaged to combine and create your final image

% in linux terminal type (check the working directory if the file exist)

cat listRL

ls S*.fit

% if all S*.fit file exists then you can combine them.  if they don't then you have to go back to imalign and fix the proble.


% in IRAF terminal type

epar imcombine

%% set the parameters as:

input              @listRLS

output           aveRLight.fits

combine       average

reject             avsigclip


%% after you set the papameters,  hold the shift  and hit   :  (colon) at the same time

%% then type   wq     in front of the  :  provided to you then hit enter(return) to close and save the setting. 


% in IRAF terminal type:


imcombine


%% this creates the aveRLight.fits for you. You can continue your science from the project manual. This is your best image calibrated and cleaned which you need to work with. 


How to make an unsharped image

%% please read your project manual. it has the full instruction . 

Installing PuTTy and Xming

Most of us connect to the CTM server via a PC running Windows, essentially making the PC a terminal. The PC interacts with the server through the X-windows system, forwarding the display from the server to the PC. Software must be installed on the PC to make this link work and the best software (so far) for this task is the PuTTy terminal emulator and the Xming X-window client.

PuTTy can be downloaded from http://www.chiark.greenend.org.uk/~sgtatham/putty/
Xming can be downloaded from http://sourceforge.net/project/downloading.php?group_id=156984&filename=Xming-6-9-0-31-setup.exe

Once PuTTy and Xming have been downloaded to the PC, install according to their respective instructions.

Configure PuTTy

Configuring PuTTy

After installing PuTTy, double-click on the PuTTy icon on the desktop and configure as shown:

The most important setting is the X11 Forwarding. Without that set, the X-window system cannot find your PC for display. Save the configuration by typing a name (i.e. COSMOS) in the box under 'Saved Sessions' on the Sessions screen. Press the Save button to save the configuration. Click Open to open the terminal window or Cancel to close PuTTy. 

The next time PuTTy is run, the session named COSMOS will be shown. Select COSMO with the mouse and click Open to launch.


Configure Xming

Configuring Xming

Once Xming is installed, run the application called 'XLaunch' and verify that the settings are as shown:

Save the configuration and close XLaunch