# Coefficients determined by the script plot_roach_bandshape.py
# Modify the scaling factor for each channel-each polarization to create a uniform bandshape for the survey mode 
# GD, Feb 11 2011

xscale_factor_1024=[40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960,
40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960,
40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 39126,
37383, 35774, 34285, 32905, 31622, 30429, 29316, 28278, 27306, 26396, 25543, 24741, 23987, 23277, 22607,
21975, 21378, 20813, 20277, 19770, 19289, 18831, 18397, 17983, 17590, 17215, 16857, 16516, 16190, 15878,
15580, 15295, 15022, 14761, 14510, 14269, 14039, 13817, 13604, 13400, 13203, 13014, 12832, 12657, 12488,
12326, 12169, 12018, 11872, 11732, 11596, 11465, 11338, 11216, 11098, 10983, 10873, 10766, 10663, 10563,
10466, 10372, 10281, 10193, 10108, 10025, 9945, 9868, 9793, 9720, 9649, 9580, 9514, 9449, 9386, 9325, 9266,
9209, 9153, 9099, 9046, 8995, 8945, 8897, 8850, 8804, 8760, 8717, 8675, 8634, 8594, 8555, 8518, 8481, 8445,
8411, 8377, 8344, 8312, 8281, 8251, 8221, 8192, 8164, 8137, 8110, 8084, 8059, 8034, 8010, 7986, 7963, 7941,
7919, 7898, 7877, 7856, 7836, 7817, 7798, 7779, 7761, 7744, 7726, 7709, 7693, 7676, 7661, 7645, 7630, 7615,
7600, 7586, 7572, 7558, 7544, 7531, 7518, 7505, 7492, 7480, 7468, 7456, 7444, 7433, 7421, 7410, 7399, 7388,
7377, 7366, 7356, 7346, 7335, 7325, 7315, 7305, 7296, 7286, 7277, 7267, 7258, 7249, 7239, 7230, 7221, 7212,
7203, 7195, 7186, 7177, 7169, 7160, 7152, 7143, 7135, 7126, 7118, 7110, 7102, 7093, 7085, 7077, 7069, 7061,
7053, 7045, 7037, 7029, 7022, 7014, 7006, 6998, 6991, 6983, 6975, 6968, 6960, 6952, 6945, 6937, 6930, 6922,
6915, 6908, 6900, 6893, 6886, 6878, 6871, 6864, 6857, 6850, 6843, 6835, 6828, 6822, 6815, 6808, 6801, 6794,
6787, 6781, 6774, 6767, 6761, 6754, 6748, 6742, 6735, 6729, 6723, 6717, 6711, 6705, 6699, 6693, 6687, 6682,
6676, 6670, 6665, 6659, 6654, 6649, 6644, 6639, 6634, 6629, 6624, 6619, 6615, 6610, 6606, 6601, 6597, 6593,
6589, 6585, 6581, 6577, 6574, 6570, 6567, 6564, 6560, 6557, 6554, 6552, 6549, 6546, 6544, 6542, 6540, 6538,
6536, 6534, 6532, 6531, 6529, 6528, 6527, 6526, 6525, 6525, 6524, 6524, 6524, 6524, 6524, 6524, 6524, 6525,
6525, 6526, 6527, 6529, 6530, 6531, 6533, 6535, 6537, 6539, 6541, 6544, 6547, 6550, 6553, 6556, 6559, 6563,
6567, 6570, 6575, 6579, 6583, 6588, 6593, 6598, 6603, 6609, 6614, 6620, 6626, 6632, 6639, 6645, 6652, 6659,
6666, 6673, 6681, 6689, 6697, 6705, 6713, 6722, 6731, 6740, 6749, 6758, 6768, 6778, 6788, 6798, 6809, 6820,
6830, 6842, 6853, 6865, 6876, 6888, 6901, 6913, 6926, 6939, 6952, 6965, 6979, 6993, 7007, 7021, 7036, 7051,
7066, 7081, 7096, 7112, 7128, 7144, 7160, 7177, 7194, 7211, 7228, 7246, 7264, 7282, 7300, 7319, 7338, 7357,
7376, 7395, 7415, 7435, 7455, 7476, 7497, 7518, 7539, 7560, 7582, 7604, 7626, 7649, 7671, 7694, 7717, 7741,
7764, 7788, 7812, 7837, 7861, 7886, 7911, 7937, 7962, 7988, 8014, 8041, 8067, 8094, 8121, 8148, 8176, 8203,
8231, 8260, 8288, 8317, 8345, 8374, 8404, 8433, 8463, 8493, 8523, 8553, 8584, 8615, 8646, 8677, 8708, 8740,
8772, 8804, 8836, 8868, 8901, 8934, 8967, 9000, 9033, 9066, 9100, 9134, 9168, 9202, 9236, 9270, 9305, 9340,
9374, 9409, 9444, 9480, 9515, 9550, 9586, 9622, 9657, 9693, 9729, 9765, 9801, 9837, 9873, 9910, 9946, 9982,
10019, 10055, 10092, 10128, 10165, 10202, 10238, 10275, 10311, 10348, 10384, 10421, 10457, 10494, 10530,
10567, 10603, 10639, 10676, 10712, 10748, 10784, 10820, 10855, 10891, 10927, 10962, 10997, 11032, 11068,
11102, 11137, 11172, 11206, 11240, 11274, 11308, 11342, 11375, 11409, 11442, 11475, 11507, 11540, 11572,
11604, 11635, 11667, 11698, 11729, 11759, 11790, 11820, 11850, 11879, 11908, 11937, 11966, 11994, 12023,
12050, 12078, 12105, 12132, 12158, 12184, 12210, 12236, 12261, 12286, 12310, 12335, 12358, 12382, 12405,
12428, 12451, 12473, 12495, 12516, 12537, 12558, 12579, 12599, 12619, 12638, 12658, 12677, 12695, 12713,
12731, 12749, 12766, 12783, 12800, 12816, 12832, 12848, 12864, 12879, 12894, 12908, 12923, 12937, 12951,
12964, 12977, 12990, 13003, 13016, 13028, 13040, 13052, 13064, 13075, 13087, 13098, 13108, 13119, 13130,
13140, 13150, 13160, 13170, 13180, 13189, 13199, 13208, 13217, 13226, 13235, 13244, 13253, 13262, 13270,
13279, 13287, 13296, 13304, 13313, 13321, 13329, 13338, 13346, 13354, 13363, 13371, 13379, 13388, 13396,
13404, 13413, 13421, 13430, 13439, 13448, 13456, 13465, 13474, 13483, 13493, 13502, 13512, 13521, 13531,
13541, 13551, 13561, 13571, 13582, 13592, 13603, 13614, 13626, 13637, 13649, 13660, 13672, 13685, 13697,
13710, 13722, 13736, 13749, 13762, 13776, 13790, 13805, 13819, 13834, 13849, 13864, 13880, 13896, 13912,
13928, 13945, 13962, 13979, 13997, 14015, 14033, 14051, 14070, 14089, 14108, 14127, 14147, 14167, 14188,
14208, 14229, 14251, 14272, 14294, 14316, 14339, 14361, 14384, 14408, 14431, 14455, 14479, 14503, 14528,
14553, 14578, 14603, 14629, 14655, 14681, 14708, 14734, 14761, 14788, 14815, 14843, 14871, 14898, 14926,
14955, 14983, 15012, 15040, 15069, 15098, 15127, 15156, 15186, 15215, 15245, 15274, 15304, 15333, 15363,
15393, 15422, 15452, 15482, 15511, 15541, 15570, 15600, 15629, 15658, 15687, 15716, 15745, 15773, 15802,
15830, 15858, 15885, 15913, 15940, 15966, 15993, 16019, 16044, 16070, 16095, 16119, 16143, 16166, 16189,
16212, 16234, 16255, 16276, 16296, 16316, 16335, 16353, 16371, 16388, 16404, 16419, 16434, 16448, 16461,
16474, 16485, 16496, 16506, 16514, 16522, 16530, 16536, 16541, 16545, 16549, 16551, 16552, 16552, 16552,
16550, 16547, 16543, 16538, 16533, 16526, 16517, 16508, 16498, 16487, 16474, 16461, 16446, 16431, 16414,
16396, 16377, 16357, 16336, 16314, 16291, 16267, 16242, 16216, 16188, 16160, 16131, 16101, 16070, 16038,
16005, 15971, 15936, 15901, 15865, 15827, 15789, 15751, 15711, 15671, 15630, 15588, 15546, 15503, 15460,
15415, 15371, 15326, 15280, 15234, 15187, 15140, 15093, 15045, 14997, 14948, 14900, 14851, 14802, 14752,
14703, 14653, 14603, 14554, 14504, 14454, 14404, 14354, 14304, 14254, 14205, 14155, 14106, 14057, 14008,
13959, 13910, 13862, 13814, 13767, 13720, 13673, 13626, 13580, 13535, 13489, 13445, 13401, 13357, 13314,
13271, 13229, 13188, 13147, 13107, 13067, 13028, 12990, 12952, 12915, 12879, 12844, 12809, 12775, 12742,
12709, 12678, 12647, 12617, 12587, 12559, 12531, 12504, 12478, 12453, 12429, 12406, 12383, 12361, 12341,
12321, 12302, 12283, 12266, 12250, 12234, 12219, 12205, 12192, 12180, 12169, 12159, 12149, 12140, 12132,
12125, 12119, 12114, 12109, 12105, 12101, 12099, 12097, 12096, 12095, 12095, 12096, 12097, 12098, 12101,
12103, 12106, 12109, 12113, 12116, 12120, 12124, 12128, 12132, 12136, 12140, 12143, 12146, 12149, 12151,
12152, 12153, 12153, 12152, 12150, 12146, 12142, 12136, 12128, 12119, 12107, 12094, 12079, 12061, 12041,
12019, 11993, 11965, 11934, 11899, 11862, 11820, 11775, 11727, 11674, 11618, 11557, 11492] 


yscale_factor_1024 = [40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960,
40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960,
40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960,
40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960,
40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40960, 40662, 39798, 38975,
38190, 37443, 36729, 36047, 35396, 34774, 34178, 33608, 33063, 32540, 32038, 31558, 31097, 30654, 30229,
29820, 29428, 29051, 28688, 28339, 28003, 27680, 27369, 27069, 26780, 26502, 26234, 25975, 25726, 25485,
25254, 25030, 24814, 24606, 24405, 24211, 24024, 23843, 23669, 23500, 23337, 23180, 23029, 22882, 22741,
22604, 22472, 22345, 22222, 22103, 21989, 21878, 21771, 21668, 21569, 21473, 21380, 21291, 21204, 21121,
21041, 20964, 20890, 20818, 20749, 20682, 20618, 20557, 20497, 20440, 20386, 20333, 20282, 20234, 20187,
20143, 20100, 20059, 20019, 19982, 19946, 19911, 19878, 19847, 19817, 19788, 19761, 19735, 19711, 19687,
19665, 19644, 19624, 19606, 19588, 19571, 19555, 19541, 19527, 19514, 19502, 19490, 19480, 19470, 19461,
19453, 19445, 19438, 19432, 19426, 19421, 19416, 19412, 19408, 19405, 19402, 19400, 19398, 19396, 19395,
19394, 19394, 19393, 19393, 19393, 19394, 19394, 19395, 19396, 19397, 19398, 19400, 19401, 19403, 19404,
19406, 19407, 19409, 19411, 19412, 19414, 19415, 19417, 19418, 19419, 19420, 19421, 19422, 19423, 19423,
19424, 19424, 19424, 19424, 19423, 19423, 19422, 19421, 19420, 19418, 19416, 19414, 19412, 19409, 19406,
19403, 19400, 19396, 19392, 19387, 19383, 19378, 19372, 19366, 19360, 19354, 19347, 19340, 19333, 19325,
19317, 19309, 19300, 19291, 19282, 19272, 19262, 19252, 19241, 19230, 19219, 19207, 19195, 19183, 19171,
19158, 19144, 19131, 19117, 19103, 19088, 19074, 19059, 19044, 19028, 19012, 18996, 18980, 18963, 18946,
18929, 18912, 18894, 18877, 18859, 18840, 18822, 18804, 18785, 18766, 18747, 18727, 18708, 18688, 18668,
18648, 18628, 18608, 18588, 18567, 18547, 18526, 18505, 18485, 18464, 18443, 18421, 18400, 18379, 18358,
18337, 18315, 18294, 18272, 18251, 18230, 18208, 18187, 18165, 18144, 18122, 18101, 18080, 18058, 18037,
18016, 17995, 17974, 17952, 17931, 17911, 17890, 17869, 17848, 17828, 17807, 17787, 17767, 17746, 17726,
17706, 17687, 17667, 17647, 17628, 17609, 17590, 17571, 17552, 17533, 17515, 17496, 17478, 17460, 17442,
17425, 17407, 17390, 17373, 17356, 17339, 17322, 17306, 17290, 17273, 17258, 17242, 17227, 17211, 17196,
17181, 17167, 17152, 17138, 17124, 17110, 17097, 17083, 17070, 17057, 17044, 17032, 17019, 17007, 16995,
16984, 16972, 16961, 16950, 16939, 16928, 16918, 16908, 16898, 16888, 16878, 16869, 16860, 16851, 16842,
16834, 16826, 16817, 16810, 16802, 16795, 16787, 16780, 16773, 16767, 16760, 16754, 16748, 16742, 16737,
16731, 16726, 16721, 16716, 16711, 16707, 16703, 16699, 16695, 16691, 16687, 16684, 16681, 16678, 16675,
16672, 16670, 16667, 16665, 16663, 16661, 16660, 16658, 16657, 16655, 16654, 16653, 16653, 16652, 16651,
16651, 16651, 16651, 16651, 16651, 16651, 16652, 16652, 16653, 16654, 16655, 16656, 16657, 16658, 16660,
16661, 16663, 16664, 16666, 16668, 16670, 16672, 16674, 16677, 16679, 16681, 16684, 16687, 16689, 16692,
16695, 16698, 16701, 16704, 16707, 16710, 16713, 16717, 16720, 16723, 16727, 16730, 16734, 16738, 16741,
16745, 16749, 16753, 16756, 16760, 16764, 16768, 16772, 16776, 16780, 16784, 16789, 16793, 16797, 16801,
16805, 16810, 16814, 16818, 16823, 16827, 16831, 16836, 16840, 16845, 16849, 16854, 16858, 16863, 16867,
16872, 16876, 16881, 16886, 16890, 16895, 16900, 16904, 16909, 16914, 16918, 16923, 16928, 16933, 16938,
16943, 16947, 16952, 16957, 16962, 16967, 16972, 16977, 16982, 16988, 16993, 16998, 17003, 17008, 17014,
17019, 17024, 17030, 17035, 17041, 17047, 17052, 17058, 17064, 17070, 17075, 17081, 17087, 17094, 17100,
17106, 17112, 17119, 17125, 17132, 17139, 17146, 17152, 17159, 17167, 17174, 17181, 17189, 17196, 17204,
17212, 17220, 17228, 17236, 17244, 17253, 17262, 17270, 17279, 17289, 17298, 17307, 17317, 17327, 17337,
17347, 17358, 17368, 17379, 17390, 17402, 17413, 17425, 17437, 17449, 17461, 17474, 17487, 17500, 17513,
17527, 17541, 17555, 17570, 17584, 17599, 17615, 17630, 17646, 17663, 17679, 17696, 17713, 17731, 17749,
17767, 17786, 17805, 17824, 17844, 17864, 17884, 17905, 17926, 17948, 17970, 17992, 18015, 18039, 18062,
18086, 18111, 18136, 18162, 18187, 18214, 18241, 18268, 18296, 18324, 18353, 18382, 18412, 18443, 18473,
18505, 18537, 18569, 18602, 18636, 18670, 18705, 18740, 18776, 18812, 18849, 18887, 18925, 18964, 19004,
19044, 19085, 19126, 19168, 19211, 19254, 19298, 19343, 19389, 19435, 19481, 19529, 19577, 19626, 19676,
19726, 19777, 19829, 19882, 19935, 19989, 20044, 20100, 20156, 20214, 20272, 20330, 20390, 20451, 20512,
20574, 20637, 20701, 20765, 20831, 20897, 20964, 21032, 21101, 21171, 21241, 21313, 21385, 21459, 21533,
21608, 21684, 21761, 21838, 21917, 21997, 22077, 22159, 22241, 22324, 22409, 22494, 22580, 22667, 22755,
22843, 22933, 23024, 23115, 23208, 23301, 23396, 23491, 23587, 23684, 23782, 23881, 23981, 24082, 24183,
24285, 24389, 24493, 24598, 24704, 24810, 24918, 25026, 25135, 25245, 25355, 25467, 25579, 25691, 25805,
25919, 26034, 26149, 26266, 26382, 26499, 26617, 26736, 26855, 26974, 27094, 27214, 27335, 27456, 27577,
27698, 27820, 27943, 28065, 28187, 28310, 28433, 28556, 28678, 28801, 28924, 29046, 29169, 29291, 29413,
29535, 29656, 29777, 29898, 30018, 30137, 30256, 30374, 30492, 30609, 30725, 30840, 30954, 31067, 31180,
31291, 31401, 31510, 31618, 31724, 31829, 31933, 32035, 32136, 32235, 32333, 32429, 32523, 32615, 32706,
32795, 32882, 32966, 33049, 33130, 33209, 33286, 33360, 33433, 33503, 33570, 33636, 33699, 33760, 33819,
33875, 33928, 33979, 34028, 34074, 34118, 34160, 34198, 34235, 34269, 34300, 34329, 34355, 34379, 34400,
34419, 34436, 34450, 34461, 34471, 34478, 34483, 34485, 34485, 34483, 34479, 34473, 34465, 34454, 34442,
34428, 34412, 34394, 34374, 34353, 34330, 34306, 34280, 34252, 34223, 34193, 34162, 34129, 34096, 34061,
34026, 33989, 33952, 33914, 33876, 33837, 33797, 33757, 33717, 33676, 33636, 33595, 33554, 33513, 33472,
33432, 33392, 33352, 33313, 33274, 33236, 33199, 33162, 33126, 33091, 33057, 33024, 32993, 32962, 32933,
32905, 32878, 32853, 32830, 32808, 32788, 32770, 32753, 32739, 32726, 32716, 32707, 32701, 32697, 32695,
32696, 32698, 32704, 32712, 32722, 32735, 32751, 32769, 32791, 32815, 32841, 32871, 32904, 32940, 32978,
33020, 33065, 33113, 33164, 33218, 33275, 33336, 33399, 33466, 33536, 33609, 33686, 33765, 33848, 33934,
34023, 34114, 34209, 34307, 34407, 34510, 34616, 34724, 34834, 34947, 35061, 35178, 35296, 35415, 35536,
35658, 35780, 35903, 36025, 36148, 36269, 36390, 36509, 36626, 36740, 36851, 36959, 37062, 37161, 37254,
37341, 37421, 37493, 37557, 37612, 37656, 37689, 37711, 37720, 37716, 37697, 37662, 37612, 37544, 37459,
37354, 37231, 37087, 36922, 36736, 36528, 36298, 36045, 35769, 35470, 35147, 34802, 34435, 34044, 33632,
33199, 32744, 32270, 31777, 31266, 30739] 
