def process_and_plot_day(date):
    """ Process and plot fields for only one day. """

    from SurfaceStressDataWriter import SurfaceStressDataWriter
    surface_stress_dataset = SurfaceStressDataWriter(field_type='daily', date=date)

    surface_stress_dataset.compute_daily_surface_stress_field(u_geo_source='CS2')
    surface_stress_dataset.compute_daily_auxillary_fields()

    surface_stress_dataset.write_fields_to_netcdf()
    surface_stress_dataset.plot_diagnostic_fields(plot_type='daily', custom_label='no_custom_label_')
def process_day(date):
    """ Process for only one day. """
    from SurfaceStressDataWriter import SurfaceStressDataWriter

    try:
        surface_stress_dataset = SurfaceStressDataWriter(field_type='daily', date=date)

        surface_stress_dataset.compute_daily_surface_stress_field(u_geo_source='CS2')
        surface_stress_dataset.compute_daily_auxillary_fields()

        surface_stress_dataset.write_fields_to_netcdf()
    except Exception as e:
        logger.error('Failed to process day {}. Returning.'.format(date))
        logger.error('{}'.format(e), exc_info=True)
        return