- 1週間の勤務を振り分けするスクリプトです
- 3つ(*.pyのファイル)分かれてますが、window_allocate_nurse.pyがメインのスクリプトです
- python: anacondaがよいでしょう。
#%% function | |
load_raw <- function(fname_raw){ | |
samp_time <- 0.05 # ms | |
line_ini <-0;line_end <-0 | |
linesRaw <- readLines(fname_raw) | |
for (ii in seq(1, length(linesRaw))){ | |
if (length(grep(pattern='"1-1"', linesRaw[ii]))>0){ | |
line_ini <- ii | |
} | |
if (length(grep(pattern="Wave End", linesRaw[ii]))>0){ |
from __future__ import absolute_import, division | |
from psychopy import locale_setup, sound, gui, visual, core, data, event, logging, clock | |
from psychopy.constants import (NOT_STARTED, STARTED, PLAYING, PAUSED, | |
STOPPED, FINISHED, PRESSED, RELEASED, FOREVER) | |
import numpy as np # whole numpy lib is available, prepend 'np.' | |
from numpy import (sin, cos, tan, log, log10, pi, average, | |
sqrt, std, deg2rad, rad2deg, linspace, asarray) | |
from numpy.random import random, randint, normal, shuffle | |
import os # handy system and path functions | |
import sys # to get file system encoding |
import mne | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import pandas as pd | |
import os | |
''' | |
EEG | |
21: Th1, 22: lt iliac crest, 23: rt. iliac crest | |
24.25: lt abductor hallucis, 26.27: rt abductor hallucis | |
61: lt.apb, 62: rt.apb |
import mne, os | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
class SurfaceEmg: | |
def __init__(self, path_edf, path_ch_pairs, sec_window=5.0, minute_analysis=3): | |
# load edf | |
self._raw = mne.io.read_raw_edf(path_edf, preload=True) | |
# load channel pairs |
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
This experiment was created using PsychoPy2 Experiment Builder (v1.83.04), 2017_06_14_1638 | |
If you publish work using this script please cite the relevant PsychoPy publications | |
Peirce, JW (2007) PsychoPy - Psychophysics software in Python. Journal of Neuroscience Methods, 162(1-2), 8-13. | |
Peirce, JW (2009) Generating stimuli for neuroscience using PsychoPy. Frontiers in Neuroinformatics, 2:10. doi: 10.3389/neuro.11.010.2008 | |
""" |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from PIL import Image, ImageDraw, ImageFilter, ImageOps, ImageStat | |
import numpy as np | |
import matplotlib.pyplot as plt | |
class ImageProcForVisualExperiment(): | |
def __init__(self, path_img=None): | |
self.path_img = path_img |
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
# import iroiro | |
from __future__ import division # so that 1/3=0.333 instead of 1/3=0 | |
from psychopy import locale_setup, visual, core, data, event, logging, sound, gui, parallel | |
from psychopy.constants import * # things like STARTED, FINISHED | |
import numpy as np # whole numpy lib is available, prepend 'np.' | |
import os # handy system and path functions | |
import sys # to get file system encoding |