diff --git a/gridded_glm/libexec/_minute_gridder.py b/gridded_glm/libexec/_minute_gridder.py index a0b9e8b4f279a990ae847ccacbe83333999c7b0c..b79327b3ad9066315ae00eea6ee786a0dd2c4cf8 100644 --- a/gridded_glm/libexec/_minute_gridder.py +++ b/gridded_glm/libexec/_minute_gridder.py @@ -77,7 +77,7 @@ def create_parser(): "(default: print to screen).") parser.add_argument('-o', '--output-dir', metavar='OUTPUT_DIR', default=os.getcwd(), help="output directory (default: use current directory)") - parser.add_argument('--goes-sector', default="full", choices=['full', 'conus', 'meso'], + parser.add_argument('--goes-sector', default="full", choices=['full', 'conus', 'meso', 'meso1', 'meso2'], help="If sector is meso, ctr_lon and ctr_lat \n" "are interpreted as the ctr_x and ctr_y of the fixed grid.\n" "(default: full)") @@ -149,8 +149,10 @@ def get_sector_shortstring(args): return 'F' elif args.goes_sector == 'conus': return 'C' - elif args.goes_sector == 'meso': + elif args.goes_sector == 'meso' or args.goes_sector == 'meso1': return 'M1' + elif args.goes_sector == 'meso2': + return 'M2' else: raise RuntimeError("sector not recognized") @@ -209,7 +211,7 @@ def grid_setup(args, work_dir=os.getcwd()): log.error("Tried to grid file that does not exist: {}".format(f)) exit(1) - if args.goes_sector == "meso" and (args.ctr_lat == None or args.ctr_lon == None): + if "meso" in args.goes_sector and (args.ctr_lat == None or args.ctr_lon == None): log.error("sector 'meso' requires --ctr-lat & --ctr-lon") exit(1) @@ -227,18 +229,23 @@ def grid_setup(args, work_dir=os.getcwd()): goes_position = get_goes_position(args.filenames) + if "meso" in args.goes_sector: + view = "meso" + else: + view = args.goes_sector + resln = get_resolution(args) - view = get_GOESR_grid(position=goes_position, - view=args.goes_sector, + grid = get_GOESR_grid(position=goes_position, + view=view, resolution=resln) - nadir_lon = view['nadir_lon'] - dx = dy = view['resolution'] - nx, ny = view['pixelsEW'], view['pixelsNS'] + nadir_lon = grid['nadir_lon'] + dx = dy = grid['resolution'] + nx, ny = grid['pixelsEW'], grid['pixelsNS'] geofixcs, grs80lla = get_GOESR_coordsys(sat_lon_nadir=nadir_lon) - if 'centerEW' in view: - x_ctr, y_ctr = view['centerEW'], view['centerNS'] - elif args.goes_sector == 'meso': + if 'centerEW' in grid: + x_ctr, y_ctr = grid['centerEW'], grid['centerNS'] + elif view == 'meso': # use ctr_lon, ctr_lat to get the center of the mesoscale FOV x_ctr, y_ctr, z_ctr = geofixcs.fromECEF( *grs80lla.toECEF(args.ctr_lon, args.ctr_lat, 0.0))