Astronomy 미분류

CCD화상크기 계산프로그램

2005/02/22 15:20 / AstroField

CCD천체촬영시 가장 중요한 사항은 현재의 장비가 가지고 있는 CCD의 크기에 가장 적합한 화상의 크기를 결정하는 것입니다.
이는 찍는 대상(행성 또는 딥스카이)에 따라 달라질 수 없기 때문에 촬영전에 작정배율을 감안하여야만 합니다.

이를 좀더 편하게 하기 위해서 PHP로 CCD에서의 화상크기를 결정해주는 프로그램을 만들어 보았습니다. 좀 허접하기는 합니다만 꽤 쓸만합니다. 향후에는 이미지 직접 보여주는 기능도 추가할 계획입니다.

CCD Calc V1.30 사용하기 -> 죄송합니다. 개인 호스팅서비스를 쓰다가 워드프레스홈으로 옮겨버려서 더이상 php 프로그램을 돌릴 수 없게 되었습니다. 대신에 소스를 개방하오니 필요하신 분들은 가져다 쓰셔도 됩니다.

 

<?
/*******************************************
ccdcalc.php
——————————————–
CCD 천체촬영을 위한 시야각 검출프로그램
——————————————–
만든이 : 엄태준 (http://www.speedoftime.net)
2004. 5.12
********************************************/
$pi_value=pi();

switch ($bal_plex) {
case (1) :
$sel_plex0=”selected”;
$sel_plex1=””;
$sel_plex2=””;
$sel_plex3=””;
$sel_plex4=””;
$sel_plex5=””;
$sel_plex6=””;
break;
case (1.5) :
$sel_plex0=””;
$sel_plex1=”selected”;
$sel_plex2=””;
$sel_plex3=””;
$sel_plex4=””;
$sel_plex5=””;
$sel_plex6=””;
break;
case (2) :
$sel_plex0=””;
$sel_plex1=””;
$sel_plex2=”selected”;
$sel_plex3=””;
$sel_plex4=””;
$sel_plex5=””;
$sel_plex6=””;
break;
case (2.5) :
$sel_plex0=””;
$sel_plex1=””;
$sel_plex2=””;
$sel_plex3=”selected”;
$sel_plex4=””;
$sel_plex5=””;
$sel_plex6=””;
break;
case (3) :
$sel_plex0=””;
$sel_plex1=””;
$sel_plex2=””;
$sel_plex3=””;
$sel_plex4=”selected”;
$sel_plex5=””;
$sel_plex6=””;
break;
case (3.5) :
$sel_plex0=””;
$sel_plex1=””;
$sel_plex2=””;
$sel_plex3=””;
$sel_plex4=””;
$sel_plex5=”selected”;
$sel_plex6=””;
break;
case (4) :
$sel_plex0=””;
$sel_plex1=””;
$sel_plex2=””;
$sel_plex3=””;
$sel_plex4=””;
$sel_plex5=””;
$sel_plex6=”selected”;
break;
}

// 합성초점거리
if(!$cplx_len=””){
if($eye_len>0){
$cplx_len = $obj_len * $bal_plex * (($ccd_dist/$eye_len)-1);
}else{
$cplx_len = $obj_len * $bal_plex;
}
}

// TAN 값
if(!$cplx_len==””){
$tan_value = tan($pixel_size/$cplx_len);
}

// ATAN값
if(!$cplx_len==””){
$atan_value = atan($tan_value);
}

// 각도변환
if(!$cplx_len==””){
$dg_value = $atan_value * 180/$pi_value;
}

//초각도변환
if(!$cplx_len==””){
$sec_value = $dg_value * 3600;
}

//픽셀상크기
if(!$cplx_len==””){
$diag_pixel = $obj_sec / $sec_value;
}

//실제크기(mm)
if(!$cplx_len==””){
$diag_mm = $diag_pixel * $pixel_size;
}

//실제크기(um)
if(!$cplx_len==””){
$diag_um = $diag_mm * 1000;
}

echo(”
<html>
<head>
<style>
input,td,p {font-family:Arial}
</style>
<title>CCD Calculator</title>
</head>

<body bgcolor=”white” text=”black” link=”blue” vlink=”purple” alink=”red”>

<table border=”1″ cellpadding=”0″ cellspacing=”0″ width=”550″ bgcolor=”teal”>
<tr><td width=550 align=center height=30><font color=white>CCD Calc – CCD 화상계산기 V1.30</font></td></tr></table><br>
<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”550″ bgcolor=”silver”>
<tr><form name=”ccdcalc” method=”post” action=”$php_self”>
<td width=”550″><table border=”0″ cellpadding=”0″ cellspacing=”1″ width=”550″
style=”font-family:굴림체,sans-serif; font-size:12px;”>
<tr>
<td width=”195″ height=”20″ bgcolor=”teal”><p align=”center”><font face=”Arial” color=”white”>구 &nbsp;&nbsp;분</font></td>
<td width=”150″ bgcolor=”teal”><p align=”center”><font face=”Arial” color=”white”>입력 및 결과</font></td>
<td width=”50″ bgcolor=”teal”><p align=”center”><font face=”Arial” color=”white”>단위</font></td>
<td width=”150″ bgcolor=”teal”><p align=”center”><font face=”Arial” color=”white”>비고</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;망원경의 초점거리</font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”><input type=”text” name=”obj_len” size=”23″ style=”font-size:12px; text-align:right; background-color:rgb(224,224,224); border-width:1px; border-color:silver; border-style:solid;” value=$obj_len ></font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>mm</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;바로우 배수</font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”><select name=”bal_plex” style=”font-size:12px; border-width:1px; border-color:silver; border-style:solid;”>
<option value=”1″ $sel_plex0 >없음</option>
<option value=”1.5″ $sel_plex1 >1.5배</option>
<option value=”2″ $sel_plex2 >2배</option>
<option value=”2.5″ $sel_plex3 >2.5배</option>
<option value=”3″ $sel_plex4 >3배</option>
<option value=”3.5″ $sel_plex5 >3.5배</option>
<option value=”4″ $sel_plex6 >4배</option></select>&nbsp;</font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>배</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;아이피스 초점거리</font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”><input type=”text” name=”eye_len” size=”23″ style=”font-size:12px; text-align:right; background-color:rgb(224,224,224); border-width:1px; border-color:silver; border-style:solid;” value=$eye_len ></font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>mm</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;직초점은 입력없음</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;아이피스-CCD거리</font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”><input type=”text” name=”ccd_dist” size=”23″ style=”font-size:12px; text-align:right; background-color:rgb(224,224,224); border-width:1px; border-color:silver; border-style:solid;” value=$ccd_dist ></font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>mm</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;직초점은 입력없음</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;단위픽셀사이즈</font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”><input type=”text” name=”pixel_size” size=”23″ style=”font-size:12px; text-align:right; background-color:rgb(224,224,224); border-width:1px; border-color:silver; border-style:solid;” value=$pixel_size ></font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>mm</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;픽셀하나의 크기</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;CCD전체화소수(가로)</font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”><input type=”text” name=”ccd_width” size=”23″ style=”font-size:12px; text-align:right; background-color:rgb(224,224,224); border-width:1px; border-color:silver; border-style:solid;” value=$ccd_width ></font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>pixel</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;유효화소기준</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;CCD전체화소수(세로)</font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”><input type=”text” name=”ccd_height” size=”23″ style=”font-size:12px; text-align:right; background-color:rgb(224,224,224); border-width:1px; border-color:silver; border-style:solid;” value=$ccd_height ></font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>pixel</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;유효화소기준</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;촬영대상의 초각</font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”><input type=”text” name=”obj_sec” size=”23″ style=”font-size:12px; text-align:right; background-color:rgb(224,224,224); border-width:1px; border-color:silver; border-style:solid;” value=$obj_sec></font></td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>초각도</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;달:30분 목성:47초</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;합성초점거리</font></td>
<td bgcolor=”white”><p align=center> $cplx_len </td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>mm</font></td>
<td bgcolor=”white”><p>&nbsp;</td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;픽셀당 탄젠트값</font></td>
<td bgcolor=”white”><p align=”center”> $tan_value </td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>radian</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;픽셀당 역탄젠트값</font></td>
<td bgcolor=”white”><p align=”center”> $atan_value </td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>radian</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;Arc Tangent 적용</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;픽셀당 커버각도</font></td>
<td bgcolor=”white”><p align=”center”> $dg_value </td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>도</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;라디안X180/파이 </font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;픽셀당 커버초각</font></td>
<td bgcolor=”white”><p align=”center”> $sec_value </td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>초각도</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;도X3600</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;투영된 상의 크기(픽셀)</font></td>
<td bgcolor=”white”><p align=”center”> $diag_pixel </td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>pixel</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;투영된 상의 크기(mm)</font></td>
<td bgcolor=”white”><p align=”center”> $diag_mm </td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>mm</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;</font></td>
</tr>
<tr>
<td height=”20″ bgcolor=”white”><p><font face=”Arial”>&nbsp;투영된 상의 크기(um)</font></td>
<td bgcolor=”white”><p align=”center”> $diag_um </td>
<td bgcolor=”white”><p align=”center”><font face=”Arial”>um</font></td>
<td bgcolor=”white”><p><font face=”Arial”>&nbsp;</font></td>
</tr>
<tr>
<td height=”20″ colspan=”4″ bgcolor=”white”><p
align=”center”><font face=”Arial”><input type=”submit” value=” 반 영 ” style=”font-family:굴림체; font-size:12px; padding:3px;”></font>&nbsp;</td>
</tr>
</table></td>
</tr></form>
</table>
</body>
</html>
“);

 

Leave a Reply

Your email address will not be published.