Skip to content

Instantly share code, notes, and snippets.

@akirayou
akirayou / star.py
Last active October 7, 2023 11:29
星の位置を四角い紙に投影するためのコード
#%%
#データ読み込み
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from scipy.spatial.transform import Rotation as R
#データのもってきかた
#https://heasarc.gsfc.nasa.gov/cgi-bin/W3Browse/w3query.pl?&tablehead=name%3Dheasarc_hipparcos%26description%3DHipparcos+Main+Catalog%26url%3Dhttp%3A%2F%2Fheasarc.gsfc.nasa.gov%2FW3Browse%2Fstar-catalog%2Fhipparcos.html%26archive%3D%26radius%3D1%26mission%3DSTAR%2BCATALOG%26priority%3D3&mission=STAR+CATALOG&Action=More+Options&Action=Parameter+Search&ConeAdd=1
#!/bin/sh
export DEBIAN_FRONTEND=noninteractive
apt update || exit 1
apt -y install libnss-ldapd libpam-ldapd ldap-utils || exit 1
echo '
uid nslcd
gid nslcd
uri ldap://[QNAP(LDAPサーバ)のIPアドレス]/
base dc=some,dc=domain,dc=jp←QNAPの設定からコピー
@akirayou
akirayou / stopwatch5.html
Last active April 8, 2023 03:17
5台でレースする時の経時用ストップウォッチ (div.bt_contの部分のHTMLを追加すれば増やせるけど)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Stopwatch</title>
<style>
:root {
margin: 0;
padding: 0;
@akirayou
akirayou / fisheye.html
Created March 9, 2023 13:10
魚眼カメラをthree.jsでパン・チルトして表示
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="https://unpkg.com/three@0.147.0/build/three.min.js"></script>
<script>
//videoタグにUSBカメラ画像を流し込む
window.addEventListener('DOMContentLoaded', init);
function init_video() {
@akirayou
akirayou / aruco_mark_sheet.py
Created September 11, 2022 06:14
arucoIDで記入欄位置を特定して、マスク合成して切りだすサンプル。  記入用紙IDもArucoで処理。 Arucoマーカーを手書きするやつはerror扱い。
from xml.dom import INDEX_SIZE_ERR
import cv2
import numpy as np
import os
import glob
from cv2 import aruco
W=400
H=400
dir=r"C:\scan"
@akirayou
akirayou / hsv2rgb.ino
Created June 26, 2022 00:34
HSV to RGB
void hsv2rgb(byte h/*0-252*/,byte s/*0-255*/,byte v/*0-255*/, unsigned char *r, unsigned char *g, unsigned char *b){
byte i=h/42;
byte f=h%42;
word tw,p1,p2,p3;
tw=255*42-s*42;
p1=((unsigned long)tw*v+21*255)/42/255;
tw=255*42-s*f;
p2=((unsigned long)tw*v+21*255)/42/255;
tw=255*42-s*(42-f);
@akirayou
akirayou / LivePreview.cs
Last active May 14, 2022 22:04
Unityでthetaのプレビューをテクスチャに貼り付けるテスト。(Quest2で動作確認/thumstickで見る方向回転も追加)   skyboxのmaterialを view_materialに指定する。 マテリアルのshaderはskybox/Panoramicにしておく.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Net;
using System.IO;
using System.Threading.Tasks;
using System.Net.Http;
using System.Text;
using System.Threading;
// NOTE: requires the Encoder library.
// 1) open Tools -> Manage Libraries...
// 2) install "Encoder" by Paul Stoffregen v1.4.1
#include <Encoder.h>
// NOTE: Requires the PS2X_lib installed.
// 1) open Sketch -> Include Library -> Add .ZIP Library
// 2) select "PS2X_lib.zip"
#include <PS2X_lib.h>
@akirayou
akirayou / Chrom_sim.ipynb
Last active May 13, 2023 02:42
波形確認のためのクロマトシミュレーション(段理論)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<html>
<body>
<img id="a"/>
<script>
var img=document.getElementById("a");
img.addEventListener('load',function(){
img.src="http://atomcam.local/cgi-bin/get_jpeg.cgi?"+ Date.now();
//console.log("laod");