Exemple #1
0
 def add_mnclim(self):
     """Add a list with file name dates for Monthly climatologies"""
     datelist = self._retrieve_datestamps(self.a_mc_url_9km)
     self.mc_datedict = {}
     for dstr in datelist[1:]:
         mn, _ = yrday.mndy(int(dstr[:4]), int(dstr[4:7]))
         self.mc_datedict[mn] = dstr
Exemple #2
0
 def add_mnclim(self):
     """Add a list with file name dates for Monthly climatologies"""
     datelist = self._retrieve_datestamps(self.a_mc_url_9km)
     self.mc_datedict = {}
     for dstr in datelist[1:]:
         mn,_ = yrday.mndy(int(dstr[:4]),int(dstr[4:7]))
         self.mc_datedict[mn] = dstr
Exemple #3
0
    def add_filepreflist(self, fldtype="MC"):
        """Add a list with file name dates for Monthly climatologies"""
        if hasattr(self, "%s_fileprefs" % fldtype):
            return

        predict = {}
        if "mc" in fldtype.lower():
            datelist = self._retrieve_datestamps(self.a_mc_url_9km)
            self.mc_datedict = {}
            for dstr in datelist[1:]:
                mn, _ = yrday.mndy(int(dstr[:4]), int(dstr[4:7]))
                self.mc_datedict[mn] = dstr
        elif "mo" in fldtype.lower():
            datelist = self._retrieve_datestamps(self.a_mo_url_9km)
            for dstr in datelist[1:]:
                mn, _ = yrday.mndy(int(dstr[:4]), int(dstr[4:7]))
                yr = int(dstr[:4])
                predict[yr * 100 + mn] = dstr
        setattr(self, "%s_fileprefs" % fldtype, predict)
Exemple #4
0
    def add_filepreflist(self, fldtype="MC"):
        """Add a list with file name dates for Monthly climatologies"""
        if hasattr(self, "%s_fileprefs" % fldtype):
            return

        predict = {}
        if "mc" in fldtype.lower():
            datelist = self._retrieve_datestamps(self.a_mc_url_9km)
            self.mc_datedict = {}
            for dstr in datelist[1:]:
                mn,_ = yrday.mndy(int(dstr[:4]),int(dstr[4:7]))
                self.mc_datedict[mn] = dstr
        elif "mo" in fldtype.lower():
            datelist = self._retrieve_datestamps(self.a_mo_url_9km)
            for dstr in datelist[1:]:
                mn,_ = yrday.mndy(int(dstr[:4]),int(dstr[4:7]))
                yr = int(dstr[:4])
                predict[yr*100 + mn] = dstr
        setattr(self, "%s_fileprefs" % fldtype, predict)
Exemple #5
0
 def add_mnclim(self):
     """Add a list with file name dates for Monthly climatologies"""
     url = "http://%s/%s" % (self.gsfc_host, self.a_mc_url_9km)
     datelist = []
     for line in urllib.urlopen(url):
         if "cgi/getfile" in line:
             datelist.append(re.findall(r'getfile/%s([^E]+).L3m' % self.fp,
                                        line)[0][:14])
     self.mc_datedict = {}
     for dstr in datelist[1:]:
         mn,_ = yrday.mndy(int(dstr[:4]),int(dstr[4:7]))
         self.mc_datedict[mn] = dstr