Skip to content

Commit

Permalink
Small correction
Browse files Browse the repository at this point in the history
  • Loading branch information
kebasaa committed Nov 25, 2021
1 parent f85c484 commit 4380bdf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Binary file modified 00_additional_data/PAR_sensors_logbook.xlsx
Binary file not shown.
14 changes: 8 additions & 6 deletions 02_laser.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -716,19 +716,21 @@
" # Mark the chambers, and add chamber 0 for data that needs to be removed\n",
" temp['status'] = ''\n",
" temp['chamber'] = 0 # remove if it remains 0\n",
" temp['chambertiming'] = temp['timestamp'].dt.strftime('%M%S').astype(float)\n",
" for index, row in timing_dt.iterrows():\n",
" temp.loc[((temp['timestamp'].dt.minute >= row['start_min']) & (temp['timestamp'].dt.second >= row['start_sec'])) & \\\n",
" ((temp['timestamp'].dt.minute <= row['end_min']) & (temp['timestamp'].dt.second <= row['end_sec'])), 'status'] = row['type']\n",
" temp.loc[(temp['chambertiming'] >= (row['start_min']*100+row['start_sec'])) & \\\n",
" (temp['chambertiming'] <= (row['end_min']*100+row['end_sec'])), 'status'] = row['type']\n",
" if(row['plot'] == 'irr'):\n",
" temp.loc[((temp['timestamp'].dt.minute >= row['start_min']) & (temp['timestamp'].dt.second >= row['start_sec'])) & \\\n",
" ((temp['timestamp'].dt.minute <= row['end_min']) & (temp['timestamp'].dt.second <= row['end_sec'])), 'chamber'] = 4\n",
" temp.loc[(temp['chambertiming'] >= (row['start_min']*100+row['start_sec'])) & \\\n",
" (temp['chambertiming'] <= (row['end_min']*100+row['end_sec'])), 'chamber'] = 4\n",
" if(row['plot'] == 'con'):\n",
" temp.loc[((temp['timestamp'].dt.minute >= row['start_min']) & (temp['timestamp'].dt.second >= row['start_sec'])) & \\\n",
" ((temp['timestamp'].dt.minute <= row['end_min']) & (temp['timestamp'].dt.second <= row['end_sec'])), 'chamber'] = 16\n",
" temp.loc[(temp['chambertiming'] >= (row['start_min']*100+row['start_sec'])) & \\\n",
" (temp['chambertiming'] <= (row['end_min']*100+row['end_sec'])), 'chamber'] = 16\n",
" # When the measurements were done every 2h (odd and even) (Note Ch4 = irr)\n",
" # i.e., change the chamber assignement for times before the 28th of august 2020, when measurements were every 2h\n",
" if(row['hour_type'] == 'even'): # Or odd, just not NA\n",
" temp.loc[((temp['timestamp'].dt.hour % 2) != 0) & (temp['chamber'] == 16), 'chamber'] = 4\n",
" temp.drop('chambertiming', axis=1, inplace=True)\n",
" \n",
" # Add counter\n",
" temp = create_block_id(temp)\n",
Expand Down

0 comments on commit 4380bdf

Please sign in to comment.