syfile = outsuf + thre_str + '_' + dset + '-OLR.synop'

            s = sy.SynopticEvents((), [syfile], COL=False)
            ks = s.events.keys()
            ks.sort()  # all
            refkey = s.mbskeys[0]

            refmbs, refmbt, refch = blb.mbopen(mbsfile)

            # First do the processing that is going to apply to the whole figure
            #   first day of event or all days? i.e. number of events or number of CBs
            #   remove duplicate dates?

            # Get lots of info about event set
            print 'Getting more info about each cloud band...'
            dates, cXs, cYs, degs, chs, keys, daynos, tworecdt = sset.evset_info(
                s, refmbs, refmbt)

            # If wanting first day of event only, subset
            print 'Subset by first day?...'
            if from_event == 'first':
                print 'Selecting first day of event only'
                dates_d, cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
                    sset.sel_firstday(dates, cXs, cYs, degs, chs, keys, daynos, tworecdt)
            else:
                print 'Retaining all days from each event'
                dates_d, cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
                    dates[:], cXs[:], cYs[:], degs[:], chs[:], keys[:], daynos[:], tworecdt[:]

            # If you want to remove duplicate dates, subset
            print 'Removing duplicate dates?'
            if rm_samedates:
                print 'opening metbot files...'
                outsuf = botpath + name + '_'
                if future:
                    outsuf=outsuf+'fut_rcp85_'
                syfile = outsuf + thre_str + '_' + dset + '-OLR.synop'
                s = sy.SynopticEvents((), [syfile], COL=False)
                ks = s.events.keys();
                ks.sort()  # all
                refkey = s.mbskeys[0]

                mbsfile = outsuf + thre_str + '_' + dset + "-olr-0-0.mbs"
                refmbs, refmbt, refch = blb.mbopen(mbsfile)

                # Get lots of info about event set
                print 'Getting more info about each cloud band...'
                dates, cXs, cYs, degs, chs, keys, daynos, tworecdt = sset.evset_info(s,refmbs,refmbt)

                # Loop sample domain
                for o in range(len(sample_dom)):
                    smp_dom = sample_dom[o]
                    print "Running for sample " + smp_dom

                    # Get sample
                    dates_d,cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
                        sset.sample_arche_cbs(sample,smp_dom, dates,cXs, cYs, degs, chs, keys, daynos, tworecdt)

                    # Find indices from var file
                    indices_m1 = []
                    for e in range(len(dates_d)):
                        date = dates_d[e]
Exemple #3
0
                        print 'opening metbot files...'
                        outsuf = botpath + name + '_'
                        if this_c == 'fut':
                            outsuf = outsuf + 'fut_rcp85_'

                        syfile = outsuf + th_thr_str + '_' + dset + '-OLR.synop'
                        s = sy.SynopticEvents((), [syfile], COL=False)
                        ks = s.events.keys()
                        ks.sort()  # all

                        mbsfile = outsuf + th_thr_str + '_' + dset + "-olr-0-0.mbs"
                        refmbs, refmbt, refch = blb.mbopen(mbsfile)

                        # Get lots of info about event set
                        print 'Getting more info about each cloud band...'
                        dates, cXs, cYs, degs, chs, keys, daynos, tworecdt = sset.evset_info(
                            s, refmbs, refmbt)

                        numleft = len(dates)
                        print 'Now with ' + str(numleft) + ' dates'

                        # If wanting first day of event only, subset
                        print 'Subset by first day?...'
                        if from_event == 'first':
                            print 'Selecting first day of event only'
                            dates_d, cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
                                sset.sel_firstday(dates, cXs, cYs, degs, chs, keys, daynos, tworecdt)
                        else:
                            print 'Retaining all days from each event'
                            dates_d, cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
                                dates[:], cXs[:], cYs[:], degs[:], chs[:], keys[:], daynos[:], tworecdt[:]
Exemple #4
0
                        print 'opening metbot files...'
                        outsuf = botpath + name + '_'
                        if this_c == 'fut':
                            outsuf = outsuf + 'fut_rcp85_'

                        syfile = outsuf + th_thr_str + '_' + dset + '-OLR.synop'
                        s = sy.SynopticEvents((), [syfile], COL=False)
                        ks = s.events.keys();
                        ks.sort()  # all

                        mbsfile = outsuf + th_thr_str + '_' + dset + "-olr-0-0.mbs"
                        refmbs, refmbt, refch = blb.mbopen(mbsfile)

                        # Get lots of info about event set
                        print 'Getting more info about each cloud band...'
                        dates, cXs, cYs, degs, chs, keys, daynos, tworecdt = sset.evset_info(s, refmbs, refmbt)

                        numleft = len(dates)
                        print 'Now with ' + str(numleft) + ' dates'

                        # If wanting first day of event only, subset
                        print 'Subset by first day?...'
                        if from_event == 'first':
                            print 'Selecting first day of event only'
                            dates_d, cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
                                sset.sel_firstday(dates, cXs, cYs, degs, chs, keys, daynos, tworecdt)
                        else:
                            print 'Retaining all days from each event'
                            dates_d, cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
                                dates[:], cXs[:], cYs[:], degs[:], chs[:], keys[:], daynos[:], tworecdt[:]
                outsuf = botpath + name + '_'
                if future:
                    outsuf = outsuf + 'fut_rcp85_'

                syfile = outsuf + thre_str + '_' + dset + '-OLR.synop'
                s = sy.SynopticEvents((), [syfile], COL=False)
                ks = s.events.keys()
                ks.sort()  # all
                refkey = s.mbskeys[0]

                mbsfile = outsuf + thre_str + '_' + dset + "-olr-0-0.mbs"
                refmbs, refmbt, refch = blb.mbopen(mbsfile)

                # Get lots of info about event set
                print 'Getting more info about each cloud band...'
                dates, cXs, cYs, degs, chs, keys, daynos, tworecdt = sset.evset_info(
                    s, refmbs, refmbt)

                numleft = len(dates)
                print 'Now with ' + str(numleft) + ' dates'

                # If wanting first day of event only, subset
                print 'Subset by first day?...'
                if from_event == 'first':
                    print 'Selecting first day of event only'
                    dates_d, cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
                        sset.sel_firstday(dates, cXs, cYs, degs, chs, keys, daynos, tworecdt)
                else:
                    print 'Retaining all days from each event'
                    dates_d, cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
                        dates[:], cXs[:], cYs[:], degs[:], chs[:], keys[:], daynos[:], tworecdt[:]
Exemple #6
0
            botpath = botdir + dset + '/' + name + '/'
            outsuf = botpath + name + '_'

            mbsfile = outsuf + thre_str + '_' + dset + "-olr-0-0.mbs"
            syfile = outsuf + thre_str + '_' + dset + '-OLR.synop'

            s = sy.SynopticEvents((), [syfile], COL=False)
            ks = s.events.keys()
            ks.sort()  # all
            refkey = s.mbskeys[0]

            refmbs, refmbt, refch = blb.mbopen(mbsfile)

            # Get lots of info about event set
            print 'Getting more info about each cloud band...'
            dates, cXs, cYs, degs, chs, keys, daynos, tworecdt = sset.evset_info(
                s, refmbs, refmbt)

            # If wanting first day of event only, subset
            print 'Subset by first day?...'
            if from_event == 'first':
                print 'Selecting first day of event only'
                dates_d, cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
                    sset.sel_firstday(dates, cXs, cYs, degs, chs, keys, daynos, tworecdt)
            else:
                print 'Retaining all days from each event'
                dates_d, cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
                    dates[:], cXs[:], cYs[:], degs[:], chs[:], keys[:], daynos[:], tworecdt[:]

            # If you want to remove duplicate dates, subset
            print 'Removing duplicate dates?'
            if rm_samedates: