Ejemplo n.º 1
0
def load_seviri_nat(indir, in_time, comp_type, timedelt):
    """
    Load a MSG/SEVIRI scene as given by img_time.

    img_time should be the *start* time for the scan, as the ending time
    will be automatically defined from this using timedelt

    The image will be loaded with Satpy, return value is a cartopy object

    Arguments:
        indir - directory holding the SEVIRI data in HRIT format
        img_time - a datetime indicating the scene start time in UTC
        comp_type - the Satpy composite to create (true_color, IR_108, etc)
        timedelt - the scanning time delta (15 min for full disk)
    Returns:
        sat_data - the satellite data object, unresampled
    """
    files = ffar(start_time=in_time,
                 end_time=in_time + timedelta(minutes=timedelt),
                 base_dir=indir,
                 reader='seviri_l1b_native')

    scn = Scene(reader='seviri_l1b_native', filenames=files)
    scn.load([comp_type])

    return scn
Ejemplo n.º 2
0
def load_goes(indir, in_time, comp_type, timedelt):
    '''
    This function will load a GOES/ABI scene as given by img_time
    img_time should be the *start* time for the scan, as the ending time
    will be automatically defined from this using timedelt

    The image will be loaded with Satpy, return value is a cartopy object

    Arguments:
        indir - directory holding the GOES data in netcdf format
        img_time - a datetime indicating the scene start time in UTC
        comp_type - the Satpy composite to create (true_color, C03, etc)
        timedelt - the scanning time delta (10 min for full disk ABI)
    Returns:
        sat_data - the satellite data object, unresampled
    '''

    files = ffar(start_time=in_time,
                 end_time=in_time + timedelta(minutes=timedelt-1),
                 base_dir=indir,
                 reader='abi_l1b')

    scn = Scene(sensor='abi_l1b', filenames=files)
    scn.load([comp_type])

    return scn
Ejemplo n.º 3
0
def load_himawari(indir, in_time, comp_type, timedelt, mode):
    """
    Load a Himawari/AHI scene as given by img_time.

    img_time should be the *start* time for the scan, as the ending time
    will be automatically defined from this using timedelt

    The image will be loaded with Satpy, return value is a cartopy object

    Arguments:
        indir - directory holding the Himawari data in HSD (unzipped) format
        img_time - a datetime indicating the scene start time in UTC
        comp_type - the Satpy composite to create (true_color, B03, etc)
        timedelt - the scanning time delta (10 min for full disk AHI)
        mode - scanning mode (FD = Full disk, MESO = Mesoscale sector)
    Returns:
        sat_data - the satellite data object, unresampled
    """
    if mode == 'MESO':
        tmp_t = in_time
        minu = tmp_t.minute
        minu = minu - (minu % 10)

        tmp_t = tmp_t.replace(minute=minu)
        tmp_t = tmp_t.replace(second=0)
        dt = (in_time - tmp_t).total_seconds() / 60.
        src_str = '*_R30' + str(int(dt/timedelt) + 1) + '*'
        dtstr = tmp_t.strftime("%Y%m%d_%H%M")
        files = glob(indir + '*' + dtstr + src_str + '.DAT')
        files.sort()
    else:
        files = ffar(start_time=in_time,
                     end_time=in_time + timedelta(minutes=timedelt-1),
                     base_dir=indir,
                     reader='ahi_hsd')

    scn = Scene(reader='ahi_hsd', filenames=files)
    scn.load([comp_type], pad_data=False)

    return scn