Home > example_scripts > getDatpipeline.m

getDatpipeline

PURPOSE ^

This script reads in some scan data and then pixellates the data before

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

This script reads in some scan data and then pixellates the data before
writing to fits files suitable for viewing in skyviewer
It is written to provide an example of a standard data reduction process before producing healpix maps of the input
data.
CJC 1 June 2010

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %This script reads in some scan data and then pixellates the data before
0002 %writing to fits files suitable for viewing in skyviewer
0003 %It is written to provide an example of a standard data reduction process before producing healpix maps of the input
0004 %data.
0005 %CJC 1 June 2010
0006 clear
0007 %%%%%%parameters that can be changed in the script%%%%%%%
0008 nside = 128 %change this to change the Healpix Resolutionm
0009 start_scan=1; %which scan to start from
0010 numscans=42 %number of scans defined below
0011 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0012 
0013 h = gov.fnal.eag.healpix.PixTools;
0014 npix= h.Nside2Npix(nside);
0015 
0016 %list of scans to use- check obslog to get appropriate scan
0017 time1{1}='15-May-2010:18:20:32';time2{1}='15-May-2010:23:38:52' %tauaRegio
0018 time1{2} ='16-May-2010:00:23:17';time2{2}='16-May-2010:02:51:26' %taua region
0019 time1{3}='16-May-2010:05:18:31';time2{3}= '16-May-2010:07:33:26'
0020 time1{4}='16-May-2010:08:18:58';time2{4}='16-May-2010:11:38:28'
0021 time1{5}='16-May-2010:12:17:22';time2{5}='16-May-2010:15:36:44'
0022 time1{6}='16-May-2010:15:59:37';time2{6}='16-May-2010:16:04:22'
0023 time1{7} = '16-May-2010:20:16:19';time2{7}='16-May-2010:23:37:13' %taua region
0024 time1{8}='17-May-2010:00:21:49';time2{8}='17-May-2010:03:19:26'
0025 time1{9}='17-May-2010:04:19:11';time2{9}='17-May-2010:07:17:02'
0026 time1{10}='17-May-2010:08:17:32';time2{10}='17-May-2010:11:15:30'
0027 time1{11}='17-May-2010:12:17:24';time2{11}='17-May-2010:15:15:08'
0028 time1{12} = '18-May-2010:06:21:35';time2{12} = '18-May-2010:08:17:49'
0029 time1{13} ='18-May-2010:09:11:04'; time2{13} = '18-May-2010:12:13:32'
0030 time1{14} = '18-May-2010:13:15:09';time2{14}='18-May-2010:15:55:27'
0031 time1{15} = '18-May-2010:16:09:53';time2{15}='18-May-2010:20:19:02'
0032 time1{16}='18-May-2010:21:12:38';time2{16}='19-May-2010:00:15:08'  
0033 time1{17}='19-May-2010:01:07:42';time2{17}='19-May-2010:04:10:03'    
0034 time1{18}='19-May-2010:05:09:08';time2{18}='19-May-2010:07:27:21'   
0035 time1{19}='19-May-2010:08:12:54';time2{19}='19-May-2010:11:15:16'    
0036 time1{20}='19-May-2010:12:09:27';time2{20}='19-May-2010:15:12:18'      
0037 time1{21} = '20-May-2010:23:30:21'; time2{21} = '21-May-2010:01:20:22'   
0038 time1{22} = '21-May-2010:02:05:52';time2{22} ='21-May-2010:05:10:07'   
0039 time1{23} ='21-May-2010:06:01:41';time2{23}='21-May-2010:09:06:02'   
0040 time1{24}= '21-May-2010:09:59:43';time2{24}='21-May-2010:13:04:00'    
0041 time1{25} = '21-May-2010:13:57:04';time2{25}='21-May-2010:14:02:58'    
0042 time1{26} = '21-May-2010:23:30:42';time2{26}='22-May-2010:00:02:21'    
0043 time1{27}= '22-May-2010:00:54:59';time2{27}='22-May-2010:03:59:11'    
0044 time1{28}='22-May-2010:04:58:15'; time2{28}='22-May-2010:08:02:38'   
0045 time1{29}='22-May-2010:08:55:54';time2{29}='22-May-2010:12:00:11'   
0046 time1{30}='22-May-2010:12:54:16'; time2{30}='22-May-2010:16:58:07'   
0047 time1{31}='22-May-2010:17:59:47'; time2{31}='22-May-2010:21:03:59'   
0048 time1{32}='22-May-2010:21:56:34'; time2{32}='23-May-2010:01:00:49'    
0049 time1{33}='23-May-2010:01:53:37'; time2{33}='23-May-2010:04:57:33'    
0050 time1{34}='23-May-2010:05:55:59'; time2{34}='23-May-2010:09:00:36'    
0051 time1{35}='23-May-2010:09:54:10';time2{35}='23-May-2010:12:58:23'    
0052 time1{36}='23-May-2010:13:51:28'; time2{36}='23-May-2010:13:57:20'   
0053 time1{37}='24-May-2010:03:33:24';time2{37}='24-May-2010:03:33:34'    
0054 time1{38}='24-May-2010:03:33:34'; time2{38}='24-May-2010:03:33:37'    
0055 time1{39}='24-May-2010:04:18:12'; time2{39}='24-May-2010:06:56:59'      
0056 time1{40}='24-May-2010:07:50:02'; time2{40}='24-May-2010:10:54:01'      
0057 time1{41}='24-May-2010:11:48:01';time2{41}='24-May-2010:14:52:40'      
0058 time1{42}='24-May-2010:16:56:34';time2{42}='24-May-2010:16:56:45'      
0059 
0060 
0061 
0062 
0063 i=0;
0064 n=0;
0065 
0066 %establish your home directory
0067 [r, home] = unix('printenv HOME');
0068 if ~strcmp(home(1:5),'/home')
0069   %case where you get tcsh shell error
0070    startpt=find(home=='/');
0071    home=home(startpt(1):end-1);
0072    clear startpt
0073 else
0074    home=home(1:end-1);
0075 end
0076 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0077 
0078 %populate a structure with all the fits file names
0079 i=start_scan
0080 unix(['mkdir ',home,'/cbass_analysis/fits_files/']);
0081 while i<=numscans
0082     fits{i} = ([home,'/cbass_analysis/fits_files/atest',num2str(80+i-1),'-',num2str(nside),'.fits']);
0083    % fits2{i} = ([home,'/cbass_analysis/fits_files/atestcumulative',num2str(80+i-1),'.fits']);
0084     %unix(['rm ',fits{i}]);
0085   %  unix(['rm ',fits2{i}]);
0086     
0087     i=i+1;
0088     
0089 end
0090 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
0091 
0092 %read in the data and then produce the fits files
0093 for i=start_scan:numscans
0094     
0095     try
0096         d=pipe_read(time1{i},time2{i});
0097         disp(['Recording the fits file: ',fits{i}])
0098         disp(['Time Start: ',time1{i},' Time End: ',time2{i}]);
0099         disp(['Total Reduction Run from ',time1{1},' to ',time2{length(time2)}]);
0100         d=pipelined(d,nside)
0101 %        disp(['Now flagging sun and moon...'])   % CD experiment (June 2010)
0102 %        d=flag_sunmoon_data(d,time1{i},0.,10.)   % done here because need date for getting sun/moon positions! (CD)
0103         unix(['rm ',fits{i}]);
0104         cbass_write_image(fits{i},d.antenna0.writeHealpixDat,nside,npix,time1{1},time2{length(time2)});
0105     catch
0106         disp('Error in data')
0107     end
0108     
0109 end
0110     
0111 
0112

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005