Skip to content
Snippets Groups Projects

Allow the user to specify a --goes--sector of "meso1" or "meso2". "meso" still...

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