Changeset 816 for misc

Show
Ignore:
Timestamp:
08/27/07 20:08:59 (13 months ago)
Author:
mankoff
Message:

Misc logic checks for years with little or no data. Changed all location markers to pins from airplanes due to Google Earth bug (blue airplanes)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • misc/GISTEMP/GISTEMP.pro

    r806 r816  
    9292    s[i].seasons.data[0:n_elements(year)-1,0:3] = [[djf],[mam],[jja],[son]] 
    9393    s[i].annual = ann 
    94     ygd = where( s[i].years ne 0 ) 
    95     y0 = min( s[i].years[ygd] ) 
    96     s[i].years = SHIFT( s[i].years, y0-1880 ) 
    97     s[i].months.data = SHIFT( s[i].months.data, y0-1880 ) 
    98     s[i].seasons.data = SHIFT( s[i].seasons.data, y0-1880 ) 
    99     s[i].annual = SHIFT( s[i].annual, y0-1880 ) 
     94    ygd = where( s[i].years ne 0, count ) 
     95    if count ne 0 then begin 
     96       y0 = min( s[i].years[ygd] ) 
     97       s[i].years = SHIFT( s[i].years, y0-1880 ) 
     98       s[i].months.data = SHIFT( s[i].months.data, y0-1880 ) 
     99       s[i].seasons.data = SHIFT( s[i].seasons.data, y0-1880 ) 
     100       s[i].annual = SHIFT( s[i].annual, y0-1880 ) 
     101    endif 
    100102 
    101103    print, i 
     
    266268load_panoply 
    267269 
    268 if n_elements( where( s.years ne 0 ) ) LE 20 then MESSAGE, "Less than 20 data points at this station", /CONTINUE 
     270nyrs = n_elements(where( s.years ne 0 ) ) 
     271if nyrs le 20 then MESSAGE, "Less than 20 data points at this station", /CONTINUE 
    269272 
    270273dd = s.months.data 
    271274bad = where( dd eq 0 or dd eq 999.90, nbad, complement=gd, ncomplement=ngd ) 
     275if n_elements(gd) le 2 then begin 
     276   MESSAGE, "Error... Not enough data to produce image", /CONTINUE 
     277   return 
     278end 
    272279img = BYTSCL( dd, min=min(dd[gd]), max=max(dd[gd]), top=252 )+1 ; 1 to 253 
    273280img[ bad ] = 254 
     
    561568; Airport or not (use airplane icon) 
    562569printf, lun, '<Icon>' 
    563 printf, lun, ghcn.a eq 'A'?  $ 
    564         '<href>http://maps.google.com/mapfiles/kml/pal2/icon56.png</href>' : $ 
    565         '<href>http://maps.google.com/mapfiles/kml/paddle/wht-blank.png</href>' 
     570;; Airplane icon shows up blue (Google Earth bug?), so only do pins... 
     571;; printf, lun, ghcn.a eq 'A'?  $ 
     572;;         '<href>http://maps.google.com/mapfiles/kml/pal2/icon56.png</href>' : $ 
     573;;         '<href>http://maps.google.com/mapfiles/kml/paddle/wht-blank.png</href>' 
     574printf, lun, '<href>http://maps.google.com/mapfiles/kml/paddle/wht-blank.png</href>' 
    566575printf, lun, '</Icon>' 
    567576 
     
    704713;  
    705714; clean: 
    706 ; giss = LOAD_GISS_STATION_LIST() 
    707 ; ghcn = LOAD_GHCN_STATION_LIST() 
    708 ; data = load_station_data(giss,ghcn) 
    709 ; meta = make_meta_data(giss,ghcn,data) 
     715;; giss = LOAD_GISS_STATION_LIST() 
     716;; ghcn = LOAD_GHCN_STATION_LIST() 
     717;; data = load_station_data(giss,ghcn) 
     718;; meta = make_meta_data(giss,ghcn,data) 
    710719 
    711720; quick: 
     
    717726;for i=0,100 do make_img, data[i] 
    718727for i=0,n_elements(data)-1 do make_img, data[i] 
    719 ;makeKML, giss, ghcn, data, meta 
     728makeKML, giss, ghcn, data, meta 
     729 
     730; $ for v in *.ps; do convert $v $v.png; done 
     731; gzip the KML file 
     732; upload KML_net, images, and if changed, KML and CGI 
    720733 
    721734end