Exemplo n.º 1
0
def harvest_and_save_blindern(from_string, to_string):

    stnr_met_blind = 18700          # Blindern (met)
    from_date = dt.datetime.strptime(from_string, "%Y-%m-%d")
    to_date = dt.datetime.strptime(to_string, "%Y-%m-%d")
    #elems_blind = gws.getElementsFromTimeserieTypeStation(stnr_met_blind, 2, output='csv')

    rr = gws.getMetData(stnr_met_blind, 'RR', from_date, to_date, 0, output='raw list')
    rr = we.millimeter_from_meter(rr)
    rr_test_message = we.test_for_missing_elements(rr, from_date, to_date)

    tam = gws.getMetData(stnr_met_blind, 'TAM', from_date, to_date, 0, output='raw list')
    tam_test_message = we.test_for_missing_elements(tam, from_date, to_date)

    nnm = gws.getMetData(stnr_met_blind, 'NNM', from_date, to_date, 0, output='raw list')
    nnm_test_message = we.test_for_missing_elements(nnm, from_date, to_date)

    file_name = '{2}RR TAM NNM Blindern 18700 {0} to {1}.txt'.format(from_string, to_string, env.data_path)

    WSYS = "github/Ice-modelling/rundataharvester.py"
    OPER = "Ragnar Ekker"
    DCHA = ['RR  [mm/day]          on Blindern 18700 from eklima.met.no',
            'TAM [C]     daily avg on Blindern 18700 from eklima.met.no',
            'NNM [%/100] daily avg on Blindern 18700 from eklima.met.no']

    mfd.write_vardat2(file_name, [rr, tam, nnm], WSYS, OPER, DCHA)

    return
Exemplo n.º 2
0
def harvest_and_save_nordnesfjelet(from_string, to_string):

    stnr = 91500          # Nordnesfjellet (met)
    from_date = dt.datetime.strptime(from_string, "%Y-%m-%d")
    to_date = dt.datetime.strptime(to_string, "%Y-%m-%d")
    #elems_blind = gws.getElementsFromTimeserieTypeStation(stnr, 2, output='csv')

    qli = gws.getMetData(stnr, 'QLI', from_date, to_date, 2, output='raw list')
    qli_test_message = we.test_for_missing_elements(qli, from_date, to_date, time_step=60*60)

    ta = gws.getMetData(stnr, 'ta', from_date, to_date, 2, output='raw list')
    ta_test_message = we.test_for_missing_elements(ta, from_date, to_date, time_step=3600)

    rr_1 = gws.getMetData(stnr, 'rr_1', from_date, to_date, 2, output='raw list')
    rr_1 = we.millimeter_from_meter(rr_1)
    rr_test_message = we.test_for_missing_elements(rr_1, from_date, to_date, time_step=3600)

    file_name = '{2}QLI TA RR Nordnesfjellet 91500 {0} to {1}.txt'.format(from_string, to_string, env.data_path)

    WSYS = "github/Ice-modelling/rundataharvester.py"
    OPER = "Ragnar Ekker"
    DCHA = ['QLI  [Wh/m2] avg pr hr on Nordnesfjellet 91500 from eklima.met.no',
            'TA   [C]     avg pr hr on Nordnesfjellet 91500 from eklima.met.no',
            'RR_1 [mm/hr]           on Nordnesfjellet 91500 from eklima.met.no']

    mfd.write_vardat2(file_name, [qli, ta, rr_1], WSYS, OPER, DCHA)

    return
Exemplo n.º 3
0
 def add_Global_rad(self, Global_rad_inn):
     if Global_rad_inn is None:
         self.Global_rad = None
     else:
         messages = we.test_for_missing_elements(Global_rad_inn, self.from_date, self.to_date)
         self.metadata += messages
         self.Global_rad = Global_rad_inn
Exemplo n.º 4
0
def harvest_and_save_blindern(from_string, to_string):

    stnr_met_blind = 18700  # Blindern (met)
    from_date = dt.datetime.strptime(from_string, "%Y-%m-%d")
    to_date = dt.datetime.strptime(to_string, "%Y-%m-%d")
    #elems_blind = gws.getElementsFromTimeserieTypeStation(stnr_met_blind, 2, output='csv')

    rr = gws.getMetData(stnr_met_blind,
                        'RR',
                        from_date,
                        to_date,
                        0,
                        output='raw list')
    rr = we.millimeter_from_meter(rr)
    rr_test_message = we.test_for_missing_elements(rr, from_date, to_date)

    tam = gws.getMetData(stnr_met_blind,
                         'TAM',
                         from_date,
                         to_date,
                         0,
                         output='raw list')
    tam_test_message = we.test_for_missing_elements(tam, from_date, to_date)

    nnm = gws.getMetData(stnr_met_blind,
                         'NNM',
                         from_date,
                         to_date,
                         0,
                         output='raw list')
    nnm_test_message = we.test_for_missing_elements(nnm, from_date, to_date)

    file_name = '{2}RR TAM NNM Blindern 18700 {0} to {1}.txt'.format(
        from_string, to_string, env.data_path)

    WSYS = "github/Ice-modelling/rundataharvester.py"
    OPER = "Ragnar Ekker"
    DCHA = [
        'RR  [mm/day]          on Blindern 18700 from eklima.met.no',
        'TAM [C]     daily avg on Blindern 18700 from eklima.met.no',
        'NNM [%/100] daily avg on Blindern 18700 from eklima.met.no'
    ]

    mfd.write_vardat2(file_name, [rr, tam, nnm], WSYS, OPER, DCHA)

    return
Exemplo n.º 5
0
def harvest_and_save_nordnesfjelet(from_string, to_string):

    stnr = 91500  # Nordnesfjellet (met)
    from_date = dt.datetime.strptime(from_string, "%Y-%m-%d")
    to_date = dt.datetime.strptime(to_string, "%Y-%m-%d")
    #elems_blind = gws.getElementsFromTimeserieTypeStation(stnr, 2, output='csv')

    qli = gws.getMetData(stnr, 'QLI', from_date, to_date, 2, output='raw list')
    qli_test_message = we.test_for_missing_elements(qli,
                                                    from_date,
                                                    to_date,
                                                    time_step=60 * 60)

    ta = gws.getMetData(stnr, 'ta', from_date, to_date, 2, output='raw list')
    ta_test_message = we.test_for_missing_elements(ta,
                                                   from_date,
                                                   to_date,
                                                   time_step=3600)

    rr_1 = gws.getMetData(stnr,
                          'rr_1',
                          from_date,
                          to_date,
                          2,
                          output='raw list')
    rr_1 = we.millimeter_from_meter(rr_1)
    rr_test_message = we.test_for_missing_elements(rr_1,
                                                   from_date,
                                                   to_date,
                                                   time_step=3600)

    file_name = '{2}QLI TA RR Nordnesfjellet 91500 {0} to {1}.txt'.format(
        from_string, to_string, env.data_path)

    WSYS = "github/Ice-modelling/rundataharvester.py"
    OPER = "Ragnar Ekker"
    DCHA = [
        'QLI  [Wh/m2] avg pr hr on Nordnesfjellet 91500 from eklima.met.no',
        'TA   [C]     avg pr hr on Nordnesfjellet 91500 from eklima.met.no',
        'RR_1 [mm/hr]           on Nordnesfjellet 91500 from eklima.met.no'
    ]

    mfd.write_vardat2(file_name, [qli, ta, rr_1], WSYS, OPER, DCHA)

    return
Exemplo n.º 6
0
 def add_Global_rad(self, Global_rad_inn):
     if Global_rad_inn is None:
         self.Global_rad = None
     else:
         messages = we.test_for_missing_elements(Global_rad_inn,
                                                 self.from_date,
                                                 self.to_date)
         self.metadata += messages
         self.Global_rad = Global_rad_inn
Exemplo n.º 7
0
 def add_Inflow_DOC(self, Inflow_DOC_inn):
     messages = we.test_for_missing_elements(Inflow_DOC_inn, self.from_date,
                                             self.to_date)
     self.metadata += messages
     self.Inflow_DOC = Inflow_DOC_inn
Exemplo n.º 8
0
 def add_Precipitation(self, Precipitation_inn):
     messages = we.test_for_missing_elements(Precipitation_inn,
                                             self.from_date, self.to_date)
     self.metadata += messages
     self.Precipitation = Precipitation_inn
Exemplo n.º 9
0
 def add_Wind_speed(self, Wind_speed_inn):
     messages = we.test_for_missing_elements(Wind_speed_inn, self.from_date,
                                             self.to_date)
     self.metadata += messages
     self.Wind_speed = Wind_speed_inn
Exemplo n.º 10
0
 def add_Air_press(self, Air_press_inn):
     messages = we.test_for_missing_elements(Air_press_inn, self.from_date,
                                             self.to_date)
     self.metadata += messages
     self.Air_press = Air_press_inn
Exemplo n.º 11
0
 def add_Relat_hum(self, Relat_hum_inn):
     messages = we.test_for_missing_elements(Relat_hum_inn, self.from_date,
                                             self.to_date)
     self.metadata += messages
     self.Relat_hum = Relat_hum_inn
Exemplo n.º 12
0
 def add_Cloud_cov(self, Cloud_cov_inn):
     messages = we.test_for_missing_elements(Cloud_cov_inn, self.from_date,
                                             self.to_date)
     self.metadata += messages
     self.Cloud_cov = Cloud_cov_inn
Exemplo n.º 13
0
 def add_Cloud_cov(self, Cloud_cov_inn):
     messages = we.test_for_missing_elements(Cloud_cov_inn, self.from_date, self.to_date)
     self.metadata += messages
     self.Cloud_cov = Cloud_cov_inn
Exemplo n.º 14
0
 def add_Relat_hum(self, Relat_hum_inn):
     messages = we.test_for_missing_elements(Relat_hum_inn, self.from_date, self.to_date)
     self.metadata += messages
     self.Relat_hum = Relat_hum_inn
Exemplo n.º 15
0
 def add_Inflow_DOC(self, Inflow_DOC_inn):
     messages = we.test_for_missing_elements(Inflow_DOC_inn, self.from_date, self.to_date)
     self.metadata += messages
     self.Inflow_DOC = Inflow_DOC_inn
Exemplo n.º 16
0
 def add_Precipitation(self, Precipitation_inn):
     messages = we.test_for_missing_elements(Precipitation_inn, self.from_date, self.to_date)
     self.metadata += messages
     self.Precipitation = Precipitation_inn
Exemplo n.º 17
0
 def add_Wind_speed(self, Wind_speed_inn):
     messages = we.test_for_missing_elements(Wind_speed_inn, self.from_date, self.to_date)
     self.metadata += messages
     self.Wind_speed = Wind_speed_inn
Exemplo n.º 18
0
 def add_Air_press(self, Air_press_inn):
     messages = we.test_for_missing_elements(Air_press_inn, self.from_date, self.to_date)
     self.metadata += messages
     self.Air_press = Air_press_inn