Home > comms > NoiseDiodeOp.m

NoiseDiodeOp

PURPOSE ^

NoiseDiodeOp gives the zenith opacity by calibrating the skydip amplitude

SYNOPSIS ^

function [ ZenithOp ] = NoiseDiodeOp(d)

DESCRIPTION ^

NoiseDiodeOp gives the zenith opacity by calibrating the skydip amplitude
off the noise diode.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ ZenithOp ] = NoiseDiodeOp(d)
0002 %NoiseDiodeOp gives the zenith opacity by calibrating the skydip amplitude
0003 %off the noise diode.
0004 
0005 %d = reduceData_simple(d);
0006 
0007 % locate skydip and noise diode events
0008 
0009 d_dip = framecut(d, bitsearch(d.array.frame.features, 5, 'any'));
0010 d_noise = framecut(d, bitsearch(d.array.frame.features, 10, 'any'));
0011 
0012 % find skydip amplitude and airmass coverage
0013 
0014 y = d_dip.antenna0.receiver.dataF(:,1);
0015 el = d_dip.antenna0.servo.apparent(:,2);
0016 q = length(el);
0017 
0018 time = d_dip.antenna0.receiver.utc - d_dip.antenna0.receiver.utc(1);
0019 time = time.*24;
0020 
0021 yy6 = spline(time, el,time);  % need to pick out only ONE skydip
0022 [maxtab] = peakdet(yy6,0.1,time);
0023 Divider = length(maxtab(:,1));
0024     
0025 
0026 if Divider ~= 0;
0027    NewY = q/Divider;
0028    m = round(NewY);
0029    
0030    y = y(1:m);
0031    time = time(1:m);
0032    airmass = 1./(sind(el(1:m)));
0033    lenA = length(airmass);
0034    airmass = airmass(lenA) - airmass(1); 
0035   
0036 elseif Divider == 0; 
0037        y = y;
0038        time = time;
0039        airmass = 1./(sind(el));
0040        lenA = length(airmass);
0041        airmass = airmass(lenA) - airmass(1); 
0042 end 
0043 
0044 SkyDipAmp = max(y) - min(y);
0045 
0046 % find noise diode amp
0047 
0048 y2 = d_noise.antenna0.receiver.dataF(:,1);
0049 len2 = length(y2);
0050 time2 = d_noise.antenna0.receiver.utc - d_noise.antenna0.receiver.utc(1);
0051 time2 = time2.*24;
0052 
0053 yy7 = spline(time2, y2,time2);  % need to pick out only ONE skydip
0054 [maxtab2] = peakdet(yy7,0.1,time2);
0055 Divider2 = length(maxtab2(:,1));
0056 
0057 if Divider2 ~= 0;
0058    NewY2 = len2/Divider2;
0059    m2 = round(NewY2);
0060    
0061    y2 = y2(1:m2);
0062    time2 = time2(1:m2);
0063    
0064 elseif Divider2 == 0; 
0065        y2 = y2;
0066        time2 = time2;
0067 
0068 end 
0069 
0070 NoiseDiodeAmp = max(y2) - min(y2);
0071 
0072 % work out skydip temp change in K
0073 
0074 deltaT = (SkyDipAmp/NoiseDiodeAmp) * 2.7; % scaled to noie diode temp of 2.7 K
0075 
0076 deltaTairmass = deltaT/airmass;
0077 
0078 ZenithOp = (1/deltaTairmass) / 100; 
0079 
0080 
0081 
0082 end
0083

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