<commit_before>#!/usr/bin/env python
# Modules for severe_reforecast.py
# Written by F.Alvarez, 1/2013

"""
 Python module for extracting/calculating data from grib2 files, along
 with some other fun stuff...
     
 CHANGE LOG:
     11/13 - Added 0-1 km SRH, Significant Tornado Parameter (sans LCL), new
             function to collect potential analog dates.
     06/13 - Added 0-3 km storm relative helicity, cleaned up some stuff
     01/13 - Initial version, F.Alvarez

"""

import pygrib as pgb
import numpy as np
from analog.bias_correction import correct_bias

def get_fcst_06shear(date,dir_name,beginning_forecast_hour,ending_forecast_hour\
                        ,maxlat,minlat,maxlon,minlon):
    """

    Used to get U/V wind data from grib files and get the
    vector magnitude vertical shear from a forecast dataset.... that is:

    shear = sqrt((u_level1 - u_level2)**2 +
                      (v_level1 - v_level2)**2)


    In:

    date - a datetime object, specifically the forecast date
    dir_name - top directory of where grib files are found (e.g. /mnt_emc/Reforecast2)
    beginning_forecast_hour - First hour of the forecast (e.g. 12)
    ending_forecast_hour - Last hour of the forecast (e.g. 36)
    maxlat/minlat/maxlon/minlon: corners of domain

    Returns:

    shear06 - A 2-d (lat/lon) NumPy array of the mean 0-6 km shear values over the forecast hour...

    """
    if ending_forecast_hour <= 180:

        #Opening data files...
        <commit_msg>Fixing more imports, etc.<commit_after>#!/usr/bin/env python
# Modules for severe_reforecast.py
# Written by F.Alvarez, 1/2013

"""
 Python module for extracting/calculating data from grib2 files, along
 with some other fun stuff...
     
 CHANGE LOG:
     11/13 - Added 0-1 km SRH, Significant Tornado Parameter (sans LCL), new
             function to collect potential analog dates.
     06/13 - Added 0-3 km storm relative helicity, cleaned up some stuff
     01/13 - Initial version, F.Alvarez

"""

import numpy as np

import pygrib as pgb
from retorcast.analog.bias_correction import correct_bias


def get_fcst_06shear(date,dir_name,beginning_forecast_hour,ending_forecast_hour\
                        ,maxlat,minlat,maxlon,minlon):
    """

    Used to get U/V wind data from grib files and get the
    vector magnitude vertical shear from a forecast dataset.... that is:

    shear = sqrt((u_level1 - u_level2)**2 +
                      (v_level1 - v_level2)**2)


    In:

    date - a datetime object, specifically the forecast date
    dir_name - top directory of where grib files are found (e.g. /mnt_emc/Reforecast2)
    beginning_forecast_hour - First hour of the forecast (e.g. 12)
    ending_forecast_hour - Last hour of the forecast (e.g. 36)
    maxlat/minlat/maxlon/minlon: corners of domain

    Returns:

    shear06 - A 2-d (lat/lon) NumPy array of the mean 0-6 km shear values over the forecast hour...

    """
    if ending_forecast_hour <= 180:

        #Opening data files...
        
{'fraction_non_alphanumeric': 0.08150365934797073, 'fraction_numerical': 0.028609447771124417, 'mean_word_length': 2.685049019607843, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4986933', 'n_tokens_mistral': 1017, 'n_tokens_neox': 919, 'n_words': 329}