Commits

James Morrison committed 584e85d

wave_stats - waves with periods longer than 30 seconds are replaced with np.nan,
usually related to transmission problem or power cut.

error_check, parse_raw - save changed to_pickle

  • Participants
  • Parent commits beb2ce7

Comments (0)

Files changed (3)

File hebtools/common/wave_stats.py

                                       index = wave_height_timestamps)
         p_to_p_period_df.index = wave_height_timestamps[:-1]
         p_to_p_period_df = p_to_p_period_df/1000000000
+        p_to_p_period_df[p_to_p_period_df>30]=np.nan
         wave_height_df = wave_height_df.join(p_to_p_period_df)
         p_to_p_period_df.to_pickle('p_to_p_period_df')
         logging.info(wave_height_df)

File hebtools/dwr/error_check.py

            std_list = compare_std(raw_plus_std, direction)
         disp_more_than_4_std = std_list[0] + std_list[1] + std_list[2]
         raw_plus_std['>4*std'] = disp_more_than_4_std
-        raw_plus_std.save('raw_plus_std')
+        raw_plus_std.to_pickle('raw_plus_std')
         return raw_plus_std
         
     def compare_factors(main_factor, second_factor, third_factor):
         combined_factors = pd.concat(factors)
         combined_factors.name = 'max_std_factor'
         raw_plus_std = raw_plus_std.join(combined_factors)
-        raw_plus_std.save('raw_plus_std')
+        raw_plus_std.to_pickle('raw_plus_std')
         return raw_plus_std
         
     displacements = detect_error_waves(extrema_df)

File hebtools/dwr/parse_raw.py

             else:
                 files.append( raw_array )
         big_raw_array = pd.concat(files)
-        big_raw_array.save('raw_buoy_displacement_pandas')  
+        big_raw_array.to_pickle('raw_buoy_displacement_pandas')  
         np.save("prob_files",np.array(problem_files_arr))
         logging.info("finish iterate_over_files")
         return big_raw_array