diff --git a/trollsched/shapefiles_from_schedule.py b/trollsched/shapefiles_from_schedule.py index 3a66893..9613afc 100644 --- a/trollsched/shapefiles_from_schedule.py +++ b/trollsched/shapefiles_from_schedule.py @@ -48,12 +48,14 @@ def get_shapely_polygon_from_lonlat(lons, lats): geodata = np.vstack((lons, lats)).T return Polygon(np.rad2deg(geodata)) + def create_shapefile_filename(satellite_pass_obj): """From a trollsched.satpass instance create the shapefile filename.""" satname = satellite_pass_obj.satellite.name.replace(" ", "-") prefix = f"{satellite_pass_obj.instrument}_{satname}" return f"{prefix}_{satellite_pass_obj.risetime:%Y%m%d%H%M}_{satellite_pass_obj.falltime:%Y%m%d%H%M}_outline.shp" + def create_shapefile_from_pass(sat_pass, output_filepath): """From a satellite overpass (instrument scanning outline) create a shapefile and save.""" sat_poly = get_shapely_polygon_from_lonlat(sat_pass.boundary.contour_poly.lon, @@ -102,7 +104,6 @@ def shapefiles_from_schedule_xml_requests(filename, satellites, tle_file, output create_shapefile_from_pass(overpass, output_filepath) - def parse_args(args): """Parse command line arguments.""" parser = argparse.ArgumentParser()