#!/usr/bin/perl ######################################################################## # otfaste.pl -- a perl script to estimate OTF obs parameters for ASTE # usage: type "perl otfaste.pl" # 2006-11-15 for multi-ON/OFF observations # 2007-10-22 WHSF support # 2007-10-22 tdump=0.2 for WHSF # 2014-06-27 WHSF updated # 2015-02-20 updated for CfP 2015 # sawada @ NRO ######################################################################## $tapp = 4.; $ttran = 2.; $ttranoff = 5.; $fcal = 16./15.; $eta = 4.3; $etaq = 0.88; $tdump = 0.1; printf("### OTF sensitivity estimation for ASTE ###\n"); # /* BACKEND TYPE */ printf("backend type (1:MAC, 2:WHSF): "); chomp($betype = ); # /* MAPPING AREA */ printf("length of mapping area (along the scans) l1 [arcsec]: "); chomp($len1 = ); printf("length of mapping area (perp. to the scans) l2 [arcsec]: "); chomp($len2 = ); # /* TIME FOR SCAN */ printf("time for scan tscan [s]: "); chomp($tscan = ); # /* SEQUENCE PATTERN */ printf("number of ONs per OFF Nscan(SEQ): "); chomp($nscanseq = ); # /* SEPARATION BETWEEN SCANS */ printf("separation between scans (delta)l [arcsec]: "); chomp($deltal = ); # /* MAP GRID */ printf("map grid d [arcsec]: "); chomp($dgrid = ); # /* SYSTEM NOISE TEMPERATURE */ printf("system noise temperature Tsys [K]: "); chomp($tsys = ); # /* RESOLUTION BANDWIDTH */ printf("resolution bandwidth B [kHz]: "); chomp($bandw = ); # printf("----------------------------------------------------------------\n"); # /* END OF INPUT */ if ($betype == 2) { $etaq = 0.60; $tdump = 0.2; } $vscan = $len1/$tscan; $nrow = $len2/$deltal + 1; $tontot = $tscan*$nrow; $toh = 2.*$ttranoff/$nscanseq + $tapp + ($nscanseq-1)/$nscanseq*$ttran; $toff = sqrt(($tscan+$toh)*$eta*$nrow*$tscan*$deltal*$dgrid/$len1/$len2 * $nscanseq*$nscanseq*$dgrid/(($nscanseq-1)*$deltal+$dgrid)); $toff = int($toff+0.5); $tobstot = $nrow*($tscan+$toff/$nscanseq+$toh) * $fcal; $tcellon = $eta*$tontot*$dgrid*$dgrid/$len1/$len2; $tcelloff = $toff*(($nscanseq-1)*$deltal+$dgrid)/($nscanseq*$deltal); $dta = $tsys/$etaq/sqrt(1000.0*$bandw)*sqrt(1./$tcellon+1./$tcelloff); # printf("----------------------------------------------------------------\n"); printf("--- Summary of parameters of your observation ---\n"); if( $betype== 1){ printf("Backend type : MAC\n"); } else{ printf("Backend type : WHSF\n"); } printf("Length of mapping area (along the scans) l1 [arcsec]: %.2f\n", $len1); printf("Length of mapping area (perp. to the scans) l2 [arcsec]: %.2f\n", $len2); printf("Time for scan tscan [s]: %.2f\n", $tscan); printf("Number of ONs per OFF Nscan(SEQ): %d\n", $nscanseq); printf("Separation between scans (delta)l [arcsec]: %.2f\n", $deltal); printf("Map grid d [arcsec]: %.2f\n", $dgrid); printf("System noise temperature Tsys [K]: %.2f\n", $tsys); printf("Resolution bandwidth B [kHz]: %.3f\n", $bandw); printf("Scan speed (%0.1f\" per %0.1fs sample) [\"/sec]: %.1f\n", $vscan*$tdump,$tdump,$vscan); printf("Effective integrtion time of ON [sec]: %0.2f\n",$tcellon); printf("Effective integrtion time of OFF [sec]: %0.2f\n",$tcelloff); printf("Overhead time per one scan [sec]: %0.1f\n", $toh); printf("Total on-souce time [min]: %.1f\n",$tontot/60.); printf("Total time per one map [min]: %.1f\n", $tobstot/60.); printf("Observing efficiency eta(ON/OBS) : %.2f\n", $tontot/$tobstot); printf("Optimal OFF-point integration time [sec]: %0.1f -> %d\n", $toff, $toff); printf("Rms noise temperature of one map [K]: %.3f\n", $dta); if ( $ARGV[0] eq "tex"){ printf("--- example for technical justification ---\n"); printf("\\begin{table}[tbh]\n"); printf("\\begin{center}\n"); printf("\\caption[]{\\em{Here we show results of OTF sensitivity estimation.}}\n"); printf("\\begin{tabular}{cc}\n"); printf("\\hline \\ \bnoalign {\\smallskip}\n"); printf("Parameters & Values \\\\\n"); printf("\\hline \\ \bnoalign {\\smallskip}\n"); if( $betype== 1){ printf("Spectrometer & MAC \\\\\n"); } else{ printf("Spectrometer & WHSF \\\\\n"); } printf("Mapping area & %.2f x %.2f \\\\\n", $len1, $len2); printf("Time of scan & %.2f [sec] \\\\\n", $tscan); printf("Non per OFF & %d \\\\\n", $nscanseq); printf("Separation/Grid & %.2f/%.2f [arcsec] \\\\\n", $deltal, $dgrid); printf("Tsys & %.2f [K] \\\\\n", $tsys); printf("Resolution bandwidth & %.3f [kHz]\\\\\n", $bandw); printf("Total time & %.1f [min] \\\\\n", $tobstot/60.); printf("Rms noise & %.3f [K] \\\\\n", $dta); printf("\\hline \\noalign {\\smallskip}\n"); printf("\\end{tabular}\n"); printf("\\end{center}\n"); printf("\\end{table}\n"); printf("\n") }