0001 function rad_set_south(lststart, lstspace, lstfinish, fluxLim, filename)
0002
0003
0004
0005
0006
0007
0008
0009
0010 clf
0011 lat=-26;
0012 d2r=pi/180; r2d=180/pi;
0013 ellim=25;
0014
0015
0016 figure(2)
0017 clf
0018 polar(10,91)
0019 hold on
0020 view(-90,90)
0021
0022
0023 if (~exist('lststart'))
0024 lststart=0;
0025 end
0026
0027
0028 if (~exist('lstfinish'))
0029 lstfinish=lststart+12;
0030 end
0031
0032
0033 if (~exist('lstspace'))
0034 lstspace=0.25;
0035 end
0036
0037
0038 [names,flux, ra ,dec]=textread(filename,'%s %f %s %s %*s\n','commentstyle','matlab');
0039
0040
0041 for i=1:size(ra,1)
0042 if ~strcmp( dec{i}(1),'-')
0043 if ~strcmp( dec{i}(1), '+')
0044 dec{i}=['+',dec{i}];
0045 end
0046 end
0047 end
0048
0049 ind = flux>fluxLim;
0050 names = names(ind);
0051 flux = flux(ind);
0052 ra = ra(ind);
0053 dec = dec(ind);
0054
0055
0056
0057 num=length(ra);
0058 disp(sprintf('%1f sources read',num))
0059
0060
0061
0062 [ra,dec]=ast2fracdeg(ra,dec);
0063
0064 lat=lat*d2r;
0065 dec=dec*d2r;
0066
0067 lat
0068 ra
0069 dec
0070
0071
0072 for lstp=lststart:lstspace:lstfinish
0073
0074 if lstp>24
0075 lst=lstp-24;
0076 else
0077 lst=lstp;
0078 end
0079
0080
0081 ha=lst*ones(num,1)-ra/15;
0082 ha=15*ha*d2r;
0083
0084
0085 cat.name=names;
0086 cat.flux=flux;
0087 [cat.az,cat.el]=hdl2ae(ha,dec,lat);
0088 cat.az=cat.az*r2d; cat.el=cat.el*r2d;
0089
0090
0091 ind=cat.el>ellim;
0092 cat=structcut(cat,ind);
0093 ind=cat.flux>fluxLim;
0094 cat=structcut(cat,ind);
0095
0096
0097
0098
0099 if (lst==lststart)
0100 nextsource=1;
0101 obs.az=cat.az(1);
0102 obs.el=cat.el(1);
0103 else
0104
0105
0106 nextsource=neighbor(obs,cat);
0107
0108
0109 obs.az=[obs.az;cat.az(nextsource)];
0110 obs.el=[obs.el;cat.el(nextsource)];
0111 end
0112
0113
0114 disp(sprintf('{%8s, %2.2f, %2.2f},',cat.name{nextsource},lst, cat.flux(nextsource)))
0115 polar(d2r*cat.az(nextsource),90-cat.el(nextsource),'ob')
0116
0117 end
0118
0119 return
0120
0121
0122 function [nextsource]=furthest(obs,cat)
0123
0124
0125
0126
0127
0128
0129 sumsa=zeros(length(cat.az),1);
0130 for k=1:length(obs.az)
0131
0132
0133 ob.az=obs.az(k)*ones(length(cat.az),1);
0134 ob.el=obs.el(k)*ones(length(cat.az),1);
0135 sa=spaceangle(ob.az,ob.el,cat.az,cat.el);
0136 sumsa=sumsa+sa;
0137 end
0138
0139 [mx,nextsource]=max(sumsa);
0140 return
0141
0142 function [nextsource]=neighbor(obs,cat)
0143
0144
0145
0146
0147 nearest=zeros(length(cat.az),1);
0148
0149 for k=1:length(cat.az)
0150
0151
0152 el=cat.el(k)*ones(length(obs.el),1);
0153 az=cat.az(k)*ones(length(obs.az),1);
0154 sa=spaceangle(az,el,obs.az,obs.el);
0155 nearest(k,1)=min(sa);
0156 end
0157
0158
0159 [mx,nextsource]=max(nearest);
0160
0161 return