Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- settings.stationDef = [
- {name:"ID", type:"String", start:1,stop:11},
- {name:"Latitude",type:"Float",start:13,stop:20 },
- {name:"Longitude",type:"Float",start:22,stop:30 },
- {name:"Elevation",type:"Float",start:32,stop:37},
- {name:"State",type:"String",start:39,stop:40},
- {name:"Name",type:"String",start:42,stop:71},
- {name:"GSNFlag",type:"String",start:73,stop:75},
- {name:"HCNFlag",type:"String",start:77,stop:79},
- {name:"WMOID",type:"String",start:81,stop:85},
- {name:"Country", type:"String", start:1,stop:2}
- ];
- settings.weatherDefsSimple = [
- {name:"ID", type:"String", start:1,stop:11},
- {name:"Country", type:"String", start:1,stop:2},
- {name:"year",type:"Integer",start:12,stop:15 },
- {name:"month",type:"Integer",start:16,stop:17 },
- {name:"element",type:"String",start:18,stop:21 },
- {name:"V01",type:"Integer",start:22,stop:26},
- {name:"M01",type:"String" ,start:27,stop:27},
- {name:"Q01",type:"String" ,start:28,stop:28},
- {name:"S01",type:"String" ,start:29,stop:29},
- {name:"V02",type:"Integer",start:30,stop:34},
- {name:"M02",type:"String" ,start:35,stop:35},
- {name:"Q02",type:"String" ,start:36,stop:36},
- {name:"S02",type:"String" ,start:37,stop:37},
- {name:"V03",type:"Integer",start:38,stop:42},
- {name:"M03",type:"String" ,start:43,stop:43},
- {name:"Q03",type:"String" ,start:44,stop:44},
- {name:"S03",type:"String" ,start:45,stop:45},
- {name:"V04",type:"Integer",start:46,stop:50},
- {name:"M04",type:"String" ,start:51,stop:51},
- {name:"Q04",type:"String" ,start:52,stop:52},
- {name:"S04",type:"String" ,start:53,stop:53},
- {name:"V05",type:"Integer",start:54,stop:58},
- {name:"M05",type:"String" ,start:59,stop:59},
- {name:"Q05",type:"String" ,start:60,stop:60},
- {name:"S05",type:"String" ,start:61,stop:61},
- {name:"V06",type:"Integer",start:62,stop:66},
- {name:"M06",type:"String" ,start:67,stop:67},
- {name:"Q06",type:"String" ,start:68,stop:68},
- {name:"S06",type:"String" ,start:69,stop:69},
- {name:"V07",type:"Integer",start:70,stop:74},
- {name:"M07",type:"String" ,start:75,stop:75},
- {name:"Q07",type:"String" ,start:76,stop:76},
- {name:"S07",type:"String" ,start:77,stop:77},
- {name:"V08",type:"Integer",start:78,stop:82},
- {name:"M08",type:"String" ,start:83,stop:83},
- {name:"Q08",type:"String" ,start:84,stop:84},
- {name:"S08",type:"String" ,start:85,stop:85},
- {name:"V09",type:"Integer",start:86,stop:90},
- {name:"M09",type:"String" ,start:91,stop:91},
- {name:"Q09",type:"String" ,start:92,stop:92},
- {name:"S09",type:"String" ,start:93,stop:93},
- {name:"V10",type:"Integer",start:94,stop:98},
- {name:"M10",type:"String" ,start:99,stop:99},
- {name:"Q10",type:"String" ,start:100,stop:100},
- {name:"S10",type:"String" ,start:101,stop:101},
- {name:"V11",type:"Integer",start:102,stop:106},
- {name:"M11",type:"String" ,start:107,stop:107},
- {name:"Q11",type:"String" ,start:108,stop:108},
- {name:"S11",type:"String" ,start:109,stop:109},
- {name:"V12",type:"Integer",start:110,stop:114},
- {name:"M12",type:"String" ,start:115,stop:115},
- {name:"Q12",type:"String" ,start:116,stop:116},
- {name:"S12",type:"String" ,start:117,stop:117},
- {name:"V13",type:"Integer",start:118,stop:122},
- {name:"M13",type:"String" ,start:123,stop:123},
- {name:"Q13",type:"String" ,start:124,stop:124},
- {name:"S13",type:"String" ,start:125,stop:125},
- {name:"V14",type:"Integer",start:126,stop:130},
- {name:"M14",type:"String" ,start:131,stop:131},
- {name:"Q14",type:"String" ,start:132,stop:132},
- {name:"S14",type:"String" ,start:133,stop:133},
- {name:"V15",type:"Integer",start:134,stop:138},
- {name:"M15",type:"String" ,start:139,stop:139},
- {name:"Q15",type:"String" ,start:140,stop:140},
- {name:"S15",type:"String" ,start:141,stop:141},
- {name:"V16",type:"Integer",start:142,stop:146},
- {name:"M16",type:"String" ,start:147,stop:147},
- {name:"Q16",type:"String" ,start:148,stop:148},
- {name:"S16",type:"String" ,start:149,stop:149},
- {name:"V17",type:"Integer",start:150,stop:154},
- {name:"M17",type:"String" ,start:155,stop:155},
- {name:"Q17",type:"String" ,start:156,stop:156},
- {name:"S17",type:"String" ,start:157,stop:157},
- {name:"V18",type:"Integer",start:158,stop:162},
- {name:"M18",type:"String" ,start:163,stop:163},
- {name:"Q18",type:"String" ,start:164,stop:164},
- {name:"S18",type:"String" ,start:165,stop:165},
- {name:"V19",type:"Integer",start:166,stop:170},
- {name:"M19",type:"String" ,start:171,stop:171},
- {name:"Q19",type:"String" ,start:172,stop:172},
- {name:"S19",type:"String" ,start:173,stop:173},
- {name:"V20",type:"Integer",start:174,stop:178},
- {name:"M20",type:"String" ,start:179,stop:179},
- {name:"Q20",type:"String" ,start:180,stop:180},
- {name:"S20",type:"String" ,start:181,stop:181},
- {name:"V21",type:"Integer",start:182,stop:186},
- {name:"M21",type:"String" ,start:187,stop:187},
- {name:"Q21",type:"String" ,start:188,stop:188},
- {name:"S21",type:"String" ,start:189,stop:189},
- {name:"V22",type:"Integer",start:190,stop:194},
- {name:"M22",type:"String" ,start:195,stop:195},
- {name:"Q22",type:"String" ,start:196,stop:196},
- {name:"S22",type:"String" ,start:197,stop:197},
- {name:"V23",type:"Integer",start:198,stop:202},
- {name:"M23",type:"String" ,start:203,stop:203},
- {name:"Q23",type:"String" ,start:204,stop:204},
- {name:"S23",type:"String" ,start:205,stop:205},
- {name:"V24",type:"Integer",start:206,stop:210},
- {name:"M24",type:"String" ,start:211,stop:211},
- {name:"Q24",type:"String" ,start:212,stop:212},
- {name:"S24",type:"String" ,start:213,stop:213},
- {name:"V25",type:"Integer",start:214,stop:218},
- {name:"M25",type:"String" ,start:219,stop:219},
- {name:"Q25",type:"String" ,start:220,stop:220},
- {name:"S25",type:"String" ,start:221,stop:221},
- {name:"V26",type:"Integer",start:222,stop:226},
- {name:"M26",type:"String" ,start:227,stop:227},
- {name:"Q26",type:"String" ,start:228,stop:228},
- {name:"S26",type:"String" ,start:229,stop:229},
- {name:"V27",type:"Integer",start:230,stop:234},
- {name:"M27",type:"String" ,start:235,stop:235},
- {name:"Q27",type:"String" ,start:236,stop:236},
- {name:"S27",type:"String" ,start:237,stop:237},
- {name:"V28",type:"Integer",start:238,stop:242},
- {name:"M28",type:"String" ,start:243,stop:243},
- {name:"Q28",type:"String" ,start:244,stop:244},
- {name:"S28",type:"String" ,start:245,stop:245},
- {name:"V29",type:"Integer",start:246,stop:250},
- {name:"M29",type:"String" ,start:251,stop:251},
- {name:"Q29",type:"String" ,start:252,stop:252},
- {name:"S29",type:"String" ,start:253,stop:253},
- {name:"V30",type:"Integer",start:254,stop:258},
- {name:"M30",type:"String" ,start:259,stop:259},
- {name:"Q30",type:"String" ,start:260,stop:260},
- {name:"S30",type:"String" ,start:261,stop:261},
- {name:"V31",type:"Integer",start:262,stop:266},
- {name:"M31",type:"String" ,start:267,stop:267},
- {name:"Q31",type:"String" ,start:268,stop:268},
- {name:"S31",type:"String" ,start:269,stop:269}
- ];
- settings.weatherDefs =
- [ [ { "name" : "day", "type" : "fixed", "value" : 1 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 22, "stop" : 26 }, { "name" : "M", "type" : "String", "start" : 27, "stop" : 27 }, { "name" : "Q", "type" : "String", "start" : 28, "stop" : 28 }, { "name" : "S", "type" : "String", "start" : 29, "stop" : 29 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 2 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 30, "stop" : 34 }, { "name" : "M", "type" : "String", "start" : 35, "stop" : 35 }, { "name" : "Q", "type" : "String", "start" : 36, "stop" : 36 }, { "name" : "S", "type" : "String", "start" : 37, "stop" : 37 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 3 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 38, "stop" : 42 }, { "name" : "M", "type" : "String", "start" : 43, "stop" : 43 }, { "name" : "Q", "type" : "String", "start" : 44, "stop" : 44 }, { "name" : "S", "type" : "String", "start" : 45, "stop" : 45 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 4 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 46, "stop" : 50 }, { "name" : "M", "type" : "String", "start" : 51, "stop" : 51 }, { "name" : "Q", "type" : "String", "start" : 52, "stop" : 52 }, { "name" : "S", "type" : "String", "start" : 53, "stop" : 53 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 5 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 54, "stop" : 58 }, { "name" : "M", "type" : "String", "start" : 59, "stop" : 59 }, { "name" : "Q", "type" : "String", "start" : 60, "stop" : 60 }, { "name" : "S", "type" : "String", "start" : 61, "stop" : 61 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 6 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 62, "stop" : 66 }, { "name" : "M", "type" : "String", "start" : 67, "stop" : 67 }, { "name" : "Q", "type" : "String", "start" : 68, "stop" : 68 }, { "name" : "S", "type" : "String", "start" : 69, "stop" : 69 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 7 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 70, "stop" : 74 }, { "name" : "M", "type" : "String", "start" : 75, "stop" : 75 }, { "name" : "Q", "type" : "String", "start" : 76, "stop" : 76 }, { "name" : "S", "type" : "String", "start" : 77, "stop" : 77 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 8 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 78, "stop" : 82 }, { "name" : "M", "type" : "String", "start" : 83, "stop" : 83 }, { "name" : "Q", "type" : "String", "start" : 84, "stop" : 84 }, { "name" : "S", "type" : "String", "start" : 85, "stop" : 85 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 9 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 86, "stop" : 90 }, { "name" : "M", "type" : "String", "start" : 91, "stop" : 91 }, { "name" : "Q", "type" : "String", "start" : 92, "stop" : 92 }, { "name" : "S", "type" : "String", "start" : 93, "stop" : 93 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 10 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 94, "stop" : 98 }, { "name" : "M", "type" : "String", "start" : 99, "stop" : 99 }, { "name" : "Q", "type" : "String", "start" : 100, "stop" : 100 }, { "name" : "S", "type" : "String", "start" : 101, "stop" : 101 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 11 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 102, "stop" : 106 }, { "name" : "M", "type" : "String", "start" : 107, "stop" : 107 }, { "name" : "Q", "type" : "String", "start" : 108, "stop" : 108 }, { "name" : "S", "type" : "String", "start" : 109, "stop" : 109 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 12 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 110, "stop" : 114 }, { "name" : "M", "type" : "String", "start" : 115, "stop" : 115 }, { "name" : "Q", "type" : "String", "start" : 116, "stop" : 116 }, { "name" : "S", "type" : "String", "start" : 117, "stop" : 117 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 13 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 118, "stop" : 122 }, { "name" : "M", "type" : "String", "start" : 123, "stop" : 123 }, { "name" : "Q", "type" : "String", "start" : 124, "stop" : 124 }, { "name" : "S", "type" : "String", "start" : 125, "stop" : 125 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 14 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 126, "stop" : 130 }, { "name" : "M", "type" : "String", "start" : 131, "stop" : 131 }, { "name" : "Q", "type" : "String", "start" : 132, "stop" : 132 }, { "name" : "S", "type" : "String", "start" : 133, "stop" : 133 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 15 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 134, "stop" : 138 }, { "name" : "M", "type" : "String", "start" : 139, "stop" : 139 }, { "name" : "Q", "type" : "String", "start" : 140, "stop" : 140 }, { "name" : "S", "type" : "String", "start" : 141, "stop" : 141 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 16 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 142, "stop" : 146 }, { "name" : "M", "type" : "String", "start" : 147, "stop" : 147 }, { "name" : "Q", "type" : "String", "start" : 148, "stop" : 148 }, { "name" : "S", "type" : "String", "start" : 149, "stop" : 149 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 17 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 150, "stop" : 154 }, { "name" : "M", "type" : "String", "start" : 155, "stop" : 155 }, { "name" : "Q", "type" : "String", "start" : 156, "stop" : 156 }, { "name" : "S", "type" : "String", "start" : 157, "stop" : 157 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 18 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 158, "stop" : 162 }, { "name" : "M", "type" : "String", "start" : 163, "stop" : 163 }, { "name" : "Q", "type" : "String", "start" : 164, "stop" : 164 }, { "name" : "S", "type" : "String", "start" : 165, "stop" : 165 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 19 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 166, "stop" : 170 }, { "name" : "M", "type" : "String", "start" : 171, "stop" : 171 }, { "name" : "Q", "type" : "String", "start" : 172, "stop" : 172 }, { "name" : "S", "type" : "String", "start" : 173, "stop" : 173 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 20 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 174, "stop" : 178 }, { "name" : "M", "type" : "String", "start" : 179, "stop" : 179 }, { "name" : "Q", "type" : "String", "start" : 180, "stop" : 180 }, { "name" : "S", "type" : "String", "start" : 181, "stop" : 181 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 21 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 182, "stop" : 186 }, { "name" : "M", "type" : "String", "start" : 187, "stop" : 187 }, { "name" : "Q", "type" : "String", "start" : 188, "stop" : 188 }, { "name" : "S", "type" : "String", "start" : 189, "stop" : 189 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 22 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 190, "stop" : 194 }, { "name" : "M", "type" : "String", "start" : 195, "stop" : 195 }, { "name" : "Q", "type" : "String", "start" : 196, "stop" : 196 }, { "name" : "S", "type" : "String", "start" : 197, "stop" : 197 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 23 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 198, "stop" : 202 }, { "name" : "M", "type" : "String", "start" : 203, "stop" : 203 }, { "name" : "Q", "type" : "String", "start" : 204, "stop" : 204 }, { "name" : "S", "type" : "String", "start" : 205, "stop" : 205 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 24 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 206, "stop" : 210 }, { "name" : "M", "type" : "String", "start" : 211, "stop" : 211 }, { "name" : "Q", "type" : "String", "start" : 212, "stop" : 212 }, { "name" : "S", "type" : "String", "start" : 213, "stop" : 213 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 25 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 214, "stop" : 218 }, { "name" : "M", "type" : "String", "start" : 219, "stop" : 219 }, { "name" : "Q", "type" : "String", "start" : 220, "stop" : 220 }, { "name" : "S", "type" : "String", "start" : 221, "stop" : 221 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 26 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 222, "stop" : 226 }, { "name" : "M", "type" : "String", "start" : 227, "stop" : 227 }, { "name" : "Q", "type" : "String", "start" : 228, "stop" : 228 }, { "name" : "S", "type" : "String", "start" : 229, "stop" : 229 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 27 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 230, "stop" : 234 }, { "name" : "M", "type" : "String", "start" : 235, "stop" : 235 }, { "name" : "Q", "type" : "String", "start" : 236, "stop" : 236 }, { "name" : "S", "type" : "String", "start" : 237, "stop" : 237 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 28 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 238, "stop" : 242 }, { "name" : "M", "type" : "String", "start" : 243, "stop" : 243 }, { "name" : "Q", "type" : "String", "start" : 244, "stop" : 244 }, { "name" : "S", "type" : "String", "start" : 245, "stop" : 245 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 29 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 246, "stop" : 250 }, { "name" : "M", "type" : "String", "start" : 251, "stop" : 251 }, { "name" : "Q", "type" : "String", "start" : 252, "stop" : 252 }, { "name" : "S", "type" : "String", "start" : 253, "stop" : 253 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 30 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 254, "stop" : 258 }, { "name" : "M", "type" : "String", "start" : 259, "stop" : 259 }, { "name" : "Q", "type" : "String", "start" : 260, "stop" : 260 }, { "name" : "S", "type" : "String", "start" : 261, "stop" : 261 } ],
- [ { "name" : "day", "type" : "fixed", "value" : 31 }, { "name" : "ID", "type" : "String", "start" : 1, "stop" : 11 }, { "name" : "Country", "type" : "String", "start" : 1, "stop" : 2 }, { "name" : "year", "type" : "Integer", "start" : 12, "stop" : 15 }, { "name" : "month", "type" : "Integer", "start" : 16, "stop" : 17 }, { "name" : "element", "type" : "String", "start" : 18, "stop" : 21 }, { "name" : "Value", "type" : "Integer", "start" : 262, "stop" : 266 }, { "name" : "M", "type" : "String", "start" : 267, "stop" : 267 }, { "name" : "Q", "type" : "String", "start" : 268, "stop" : 268 }, { "name" : "S", "type" : "String", "start" : 269, "stop" : 269 } ]
- ]
- function split(line, definition){
- var result = new Object();
- for (key in definition){
- var column = definition[key];
- if (column.type=="fixed"){
- result[column.name] = column.value;
- } else {
- var s = line.substring(column.start-1,column.stop);
- if (column.type=="Float"){
- result[column.name] = parseFloat(s);
- } else if (column.type=="Integer"){
- result[column.name] = parseInt(s);
- } else {
- result[column.name] = s.trim();
- }
- }
- }
- return result;
- }
- function split(line, definitions){
- var allResults = new Array();
- for (var i in definitions){
- var definition = definitions[i];
- var result = new Object();
- for (key in definition){
- var column = definition[key];
- if (column.type=="fixed"){
- result[column.name] = column.value;
- } else {
- var s = line.substring(column.start-1,column.stop);
- if (column.type=="Float"){
- result[column.name] = parseFloat(s);
- } else if (column.type=="Integer"){
- result[column.name] = parseInt(s);
- } else {
- result[column.name] = s.trim();
- }
- }
- }
- allResults.push(result);
- }
- return allResults;
- }
- function readFile(name,collection,definition){
- var data = cat(name);
- var all = new Array();
- var lines = data.split("\n");
- for(i=1;i<lines.length;i++){
- var result = split(lines[i],definition);
- all=all.concat(result);
- }
- collection.insert(all);
- return all.length;
- }
- var tel=0;
- db.stations.find({Country:"UK"}).forEach(function(entry){
- tel++;
- var file = "projects/mongo/weather/ghcnd_all/ghcnd_all/"+entry.ID+".dly";
- var count = readFile(file,db.weather,definitions);
- print(new Date()+" "+tel+" "+entry.ID+" "+count);
- })
- db.weather.aggregate(
- {$match:{"year":1994,element:"TMIN"}},
- {$group:{_id:"$month",
- Temp:{$avg:"$Value"}
- }}
- )
- db.weather.aggregate(
- {$match:{"Country":"BE","year":{$gt:1994},month:2, element:"TMIN"}},
- {$group:{_id: {year:"$year",month:"$month"},
- Temp:{$avg:"$Value"}
- }},
- {$sort:{_id:1}}
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement