Example #1
0
 def callback(self, button):
     ''' The method that is called when a button is pressed'''
     
     parameter = button.text
     st_number = self.text_st_number.text
     year = self.text_year.text
     
     ncdc_down = NcdcDownloader(st_number, year)
     ncdc_down.ncdc_url_to_sqlite()
     
     ncdc_graph = NcdcGraphics(ncdc_down.table_name, parameter)
     ncdc_graph.ncdc_graphics()
Example #2
0
                          label = 'Precipitation [mm]')
                               
                prcp_lst = [str(round(float(max_value),1)),\
                            str(round(float(prcp_sum),1))]
                
                pyplot.text (10, int(max_value), 
                            'Max & sum precipitation = ' + \
                            ((' & ').join(prcp_lst)) + ' mm',\
                             bbox={"facecolor": "yellow", 
                            "boxstyle": "sawtooth"})
                            
                pyplot.xlabel('DOY') 
                pyplot.ylabel('mm')    
                
                pyplot.title('Precipitation [mm]') 
                pyplot.grid(True)
                pyplot.legend(loc='upper right', prop={'size':10})
                pyplot.show()
                
        except Exception as e:
            
            print ('Graph are not built')
            print (e)
            
if __name__ == '__main__':
    ncdc_down_1 = NcdcDownloader(260590, 2005)     # Class test
    ncdc_down_1.ncdc_url_to_sqlite()
    
    ncdc_graph_1 = NcdcGraphics(ncdc_down_1.table_name, 'Temperature')
    ncdc_graph_1.ncdc_graphics()