MIT-AI-Accelerator / eie-sevir

Code for working with the SEVIR weather dataset
24 stars 11 forks source link

On SEVIR_Tutorial.ipynb? #1

Open rdangovs opened 4 years ago

rdangovs commented 4 years ago

Hi!

Thanks for the great notebook! I have two 2 questions:

1) In the following snippet:

def lght_to_grid(data):
    """
    Converts SEVIR lightning data stored in Nx5 matrix to an LxLx49 tensor representing
    flash counts per pixel per frame

    Parameters
    ----------
    data  np.array
       SEVIR lightning event (Nx5 matrix)

    Returns
    -------
    np.array 
       LxLx49 tensor containing pixel counts
    """
    FRAME_TIMES = np.arange(-120.0,120.0,5) * 60 # in seconds

len(FRAME_TIMES) is 48. Is it meant to be, say FRAME_TIMES = np.arange(-120.0,125.0,5) * 60, instead?

2) Any reason to choose L=48 in lght_to_grid. Is it OK to make it, say, L=192?

Thank you

markveillette commented 4 years ago
  1. Yup, my mistake. will fix that shortly. There is a similar mistake in the SEVIRSequence generator class, which I will try to fix over the next few days.

  2. The 48 was chosen so that the pixel size of the gird reflects the accuracy of the sensor detecting the lightning. The size of each SEVIR patch is 384 by 384 km, and the lightning mapper has a spatial resolution of approximately 8 km, hence the grid size of 384 / 8 = 48.

I suggest resizing the data to the resolution you desire using something like a binlinear interpolation. If that doesn't work for you, the lght data contains the original lat/lon of the lightning detections, so it can also be mapped to any gird resolution you'd like using the underlying map projection (see one of the later cells in that notebook for how to perform that translation).

rdangovs commented 4 years ago

Great, many thanks!