<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 lidar subdir has the files
- line.data.mat have "raw" data but includes some filtering and water level extraction
- line.science.mat have processed data
-  Some jpg are also provide
Step1:  Recent matlab files are just hdf5, which we can get from pytables
Step2:  Grab the filtered  water levels on the grid in FRF coordinates
Step3:  data file has nan's where it is  unreliable, find the index for about 105m offshore
<ASSISTANT_TASK:>
Python Code:
%ls lidar
Explanation: lidar subdir has the files
- line.data.mat have "raw" data but includes some filtering and water level extraction
- line.science.mat have processed data
-  Some jpg are also provide
End of explanation
import tables
lineData = tables.openFile(r"lidar/20150927-0000-01.FRFNProp.line.data.mat","r")
#science = tables.openFile(r"lidar/20150927-0000-01.FRFNProp.line.science.mat","r")
Explanation: Recent matlab files are just hdf5, which we can get from pytables
End of explanation
for f in lineData.root:
    for g in f:
        print g
z = lineData.root.lineGriddedFilteredData.waterGridFiltered[:]
x = lineData.root.lineCoredat.downLineX[:]
%matplotlib notebook
from matplotlib  import pyplot as plt
fig = plt.figure()
plt.plot(x,z[:,5000])
Explanation: Grab the filtered  water levels on the grid in FRF coordinates
End of explanation
import numpy as  np
xfinite = x[:]
xfinite[np.isnan(x)] = -1000.0
i105 = np.where(xfinite > 105.0)[0][0]
print i105
fig = plt.figure()
plt.plot(lineData.root.lineCoredat.tGPSVector[:500],z[i105,:500])
Explanation: data file has nan's where it is  unreliable, find the index for about 105m offshore
End of explanation
<END_TASK>