Attachment 'NIKA2_Time_Estimator.py'

Download

   1 #!/usr/bin/env python
   2 ##############################################################################################
   3 ### Created by: P. Garcia                                                                  ###
   4 ### Last update: A. Ritacco                                                                ###
   5 ### Title: NIKA2_Time_Estimator.py                                                         ###
   6 ### Purpose: Calculation of the total integration time for observing proposals             ###
   7 ### Creation Date: 2016.JULY.28                                                            ###
   8 ### Date of last revision: 2017.JAN.29                                                     ###
   9 ### Revision history:                                                                      ###
  10 ###   - 2016.JULY.29: comments from C. Kramer & A. Sievers implemented                     ###
  11 ###   - 2016.AUG.03 : changed formula to N. Billot expression                              ###
  12 ###   - 2017.JAN.29 : - fpix set to 0.75 (commisi. results)                                ###
  13 ###                   - NEFD0 @ 2 mm set to 15 mJy/sqrt(hz) (commisi. results)             ###
  14 ###                   - overhead set as used defined parameter between 1.5 - 2.0           ###
  15 ###   - 2017.JULY.28: - According to the NIKA2 technical paper submitted on July, 3rd 2017 ###
  16 ###                   - fpix @1mm, 2mm set to 0.84 and 0.90, respectively                  ###
  17 ###                   - NEFD0 @1mm, 2mm set to 20 and 6 mJy/sqrt(hz), respectively         ###
  18 ###                   - FWHM set to 11.2 @1mm and 17.7 @2mm                                ###
  19 ##############################################################################################
  20 
  21 import numpy as np, sys
  22 import math
  23 import sys
  24 import os
  25 os.system("rm -f *.py~")
  26 
  27 #version = 'v 2017.JAN.29'
  28 version = 'v 2017.JULY.28'
  29 
  30 
  31 class bcolors:
  32     HEADER = '\033[95m'
  33     OKBLUE = '\033[94m'
  34     OKGREEN = '\033[92m'
  35     WARNING = '\033[93m'
  36     FAIL = '\033[91m'
  37     ENDC = '\033[0m'
  38     BOLD = '\033[1m'
  39     UNDERLINE = '\033[4m'
  40 
  41 print ''
  42 print bcolors.UNDERLINE + bcolors.HEADER + bcolors.BOLD + 'Time-estimator-NIKA2 '+version+' '+bcolors.ENDC
  43 print ''
  44 print bcolors.HEADER + bcolors.BOLD + ' See the "Guidelines for observing time estimates with the NIKA2 continuum camera' + bcolors.ENDC
  45 print bcolors.HEADER + bcolors.BOLD + ' at the IRAM-30m Telescope" for details on used parameters and calculations.\n' + bcolors.ENDC
  46 
  47 ################################
  48 ##### CONVERSION FACTORS #######
  49 ################################
  50 
  51 ##########  K_cmb ############
  52 def b_v_cmb(freq,tcmb):
  53     h    = 6.626070040*10**(-34) # (J.s) Planck constant
  54     k    = 1.38064852*10**(-23)  # (J/K) Boltzmann constant
  55     c    = 299792458             # (m/s^2) light speed
  56     freq = freq*10**9            # Hz    
  57     bv = 1.0/(((2*h*freq**3)/((c**2)*(np.e**((h*freq)/(k*tcmb)) - 1)))*(np.e**((h*freq)/(k*tcmb))/(np.e**((h*freq)/(k*tcmb)) - 1))*(h*freq/(k*tcmb**2))) / 10**20
  58     return bv
  59 
  60 ##########  Ysz ##############
  61 def y_sz(freq,tcmb):
  62     h    = 6.626070040*10**(-34) # (J.s) Planck constant
  63     k    = 1.38064852*10**(-23)  # (J/K) Boltzmann constant
  64     c    = 299792458             # (m/s^2) light speed
  65     freq = freq*10**9            # Hz    
  66     Ysz  = 1.0
  67     bv   = 1.0/(((2*h*freq**3)/((c**2)*(np.e**((h*freq)/(k*tcmb)) - 1)))*(np.e**((h*freq)/(k*tcmb))/(np.e**((h*freq)/(k*tcmb)) - 1))*(h*freq/(k*tcmb**2)))
  68     bv   = 1.0/bv
  69     y_sz = (bv*tcmb)*(((h*freq/(k*tcmb))*((np.e**((h*freq)/(k*tcmb)) + 1)/(np.e**((h*freq)/(k*tcmb)) -1))) -4)*Ysz /10**(-20)
  70     y_sz = 1.0/y_sz
  71     return y_sz
  72 
  73 #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  74 #%%%%%%%%%%%%%%%%%%%%% FIXED GENERAL PARAMETERS %%%%%%%%%%%%%%%%%%%%%%  
  75 #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  76 
  77 ################################################
  78 ##### BEAM SIZES AND CONVERSION TO RADIANS #####
  79 ################################################
  80 res_band1_spec        = 11.2  #From NIKA2 1st paper #MEMO # 12.0  # [arcsec]
  81 res_band2_spec        = 17.7  #From NIKA2 1st paper #MEMO # 20.0  # [arcsec]
  82 teta_band1_spec       = res_band1_spec*math.pi/180.0/3600.0 # in sr units 
  83 teta_band2_spec       = res_band2_spec*math.pi/180.0/3600.0 # in sr units 
  84 area_teta_band1_spec  = ((teta_band1_spec/2.0)**2)*math.pi  # in sr units 
  85 area_teta_band2_spec  = ((teta_band2_spec/2.0)**2)*math.pi  # in sr units 
  86 ############################
  87 ##### OTHER PARAMETERS #####
  88 ############################
  89 #fpix_spec             = 0.75
  90 fpix_spec_1mm         = 0.84
  91 fpix_spec_2mm         = 0.90
  92 bv_1                  = 0.075   # band1, do not change
  93 cv_1                  = 0.001   # band1, do not change
  94 bv_2                  = 0.025   # band2, do not change
  95 cv_2                  = 0.001   # band2, do not change
  96 tiempo                = 1.0     # [hours]
  97 FoV                   = 6.5     # [arcmin] diameter
  98 FoVArea               = ((FoV/2.0)**2)*math.pi # [arcmin^2]
  99 narrays1              = 2
 100 narrays2              = 1
 101 verbose_flag          = 0
 102 #foverhead             = 2.0 # value fixed for all proposals in 2016
 103 ##########################################
 104 ##### NEFDo VALUES FROM OBSERVATIONS #####
 105 ##########################################
 106 NEFD_band1_spec       = 20 #From NIKA2 1st paper #30 #MEMO 
 107 NEFD_band2_spec       = 6  #From NIKA2 1st pape #15 #comissioning results 2016 
 108 #######################################
 109 ##### SAMPLING ANGULAR VELOCITIES #####
 110 #######################################
 111 sampl_vel_fast = 48.0    # [arcsec/second] 
 112 sampl_vel_mid  = 24.0    # [arcsec/second] 
 113 sampl_vel_slow = 12.0    # [arcsec/second] 
 114 sampl_rate     = 23.84   # [hz]
 115 sampl_rate_pol = 2*23.84 # [hz]
 116 slewing_loss   = 1.0     # to account for slewing of single OTF line
 117 ##########################################
 118 ##########################################
 119 ##########################################
 120 
 121 rango = len(sys.argv)
 122 for i in range(rango):
 123 
 124     if sys.argv[i] == ("--help") or rango == 1:
 125 
 126         print ' USAGE:\n'
 127         print '   python NIKA2_Time_Estimator.py --help '
 128         print '   python NIKA2_Time_Estimator.py --band 1 --rms 2.00 --pwv 2 --elevation 40 --Xsize  2 --Ysize  2 --filter 1.0 --overhead 1.5'
 129         print '   python NIKA2_Time_Estimator.py --band 2 --rms 1.00 --pwv 4 --elevation 50 --Xsize 15 --Ysize 15 --filter 2.0 --overhead 2.0 --verbose '
 130         print '\n'
 131         print ' OPTIONS:\n'
 132         print '          help =>  This help.'
 133         print '          band =>  Set 1 or 2 for the 1 mm or the 2 mm bands, respectively.'
 134         print '           rms =>  Wanted flux density per beam. Any value above the confusion limit in [mJy/beam].'
 135         print '           pwv =>  Precipitable water vapor in [mm].'
 136         print '     elevation =>  Values from 15 to < 83 [deg].'
 137         print '   Xsize Ysize =>  Map lengths. Xsize and Ysize are in [arcmin]. Minimum map size is 2x2 [arcmin^2] for homogeneous RMS noise distribution.'
 138         print '        filter =>  Factor for post-processing noise filtering. Values from 1.0 (point-like source) to 2.0 (extended bright emission).'
 139         print '      overhead =>  Factor for telescope overheads between 1.5 and 2.0 (slewing, pointing, focusing, calibration), i.e. all telescope time which is not spend integrating on-source.'
 140         print '       verbose =>  Set to get list of parameters used in the calculations, RMS noise unit conversion, and allowed OTF scan speeds.\n'
 141         sys.exit()
 142 
 143     if sys.argv[i] == ("--band"):
 144         band  = int(sys.argv[i+1]) 
 145         if band == 1:
 146             narrays = narrays1
 147             mili    = 1.2
 148         if band == 2:
 149             narrays = narrays2
 150             mili    = 2.0
 151         if band < 1 or band > 2:
 152             print '    %%%%%%%%%%%%%%%%%%%%%%%'
 153             print bcolors.BOLD +  bcolors.FAIL +'    Band %2i is not defined.' % (band) + bcolors.ENDC
 154             print '    %%%%%%%%%%%%%%%%%%%%%%%'
 155             print ''
 156             sys.exit()
 157 
 158     if sys.argv[i] == ("--rms"):
 159         rms = float(sys.argv[i+1])
 160 
 161     if sys.argv[i] == ("--pwv"):
 162         pwv = float(sys.argv[i+1])
 163 
 164     if sys.argv[i] == ("--elevation"):
 165         elevation = float(sys.argv[i+1])
 166         if elevation < 15 or elevation > 83:
 167             print '    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 168             print bcolors.BOLD +  bcolors.FAIL +'    Elevation %3i [degrees] is outside the telescope`s limits: 15 - 83 [degrees].' % (elevation) + bcolors.ENDC
 169             print '    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 170             print ''
 171             sys.exit()
 172 
 173     if sys.argv[i] == ("--Xsize"):
 174         dx = float(sys.argv[i+1])
 175 
 176     if sys.argv[i] == ("--Ysize"):
 177         dy = float(sys.argv[i+1])
 178 
 179     if sys.argv[i] == ("--filter"):
 180         filtering = float(sys.argv[i+1])
 181         if filtering < 1 or filtering > 2:
 182             print '    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 183             print bcolors.BOLD +  bcolors.FAIL +'    Filter value %2.1f is outside the standard limits: 1.0 - 2.0' % (filtering) + bcolors.ENDC
 184             print '    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 185             print ''
 186             sys.exit()
 187 
 188     if sys.argv[i] == ("--overhead"):
 189         foverhead = float(sys.argv[i+1])
 190         if foverhead < 1.5 or foverhead > 2:
 191             print '    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 192             print bcolors.BOLD +  bcolors.FAIL +'    Overhead value %2.1f is outside the standard limits: 1.5 - 2.0' % (foverhead) + bcolors.ENDC
 193             print '    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 194             print ''
 195             sys.exit()
 196 
 197     if sys.argv[i] == ("--verbose"):
 198         verbose_flag = 1
 199 
 200 area_obs        = dx*dy
 201 
 202 if area_obs < 4.0:
 203     print '    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 204     print bcolors.BOLD +  bcolors.FAIL +'    Introduced map size is %3.1f [arcmin^2]. Minimum value is 4.0 [arcmin^2]' % (area_obs) + bcolors.ENDC
 205     print '    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 206     print ''
 207     sys.exit()
 208 
 209 ###############################################################################################
 210 ### SIGMA ESTIMATION CALCULATION, EFFECTIVE NEFD FROM PWV GIVEN VALUES AND UNITS CONVERSION ###
 211 ###############################################################################################
 212         
 213 if band == 1: 
 214     tau = bv_1*pwv + cv_1
 215     NEFD_spec_eff      = NEFD_band1_spec*(np.e**(tau/np.sin(elevation*math.pi/180.)))
 216     rms_point_MJy_spec = rms/area_teta_band1_spec/10**9
 217     rms_point_cmb_spec = rms_point_MJy_spec*b_v_cmb(260,2.726)*10**6
 218     rms_point_ys_spec  = rms_point_MJy_spec*y_sz(260,2.726)*10**6
 219     rms_point_ys_spec  = np.abs(rms_point_ys_spec)
 220     #########################################
 221     ### ratio of areas with fraction of valid pixel in the 2mm band ###       
 222     #########################################
 223     factor_area_spec   = (1+(area_obs/(FoVArea*fpix_spec_1mm))) # from N. Billot Doc.
 224     ##########################################################
 225     ### Integration Time calculations for given conditions ###
 226     ##########################################################
 227     t_spec     = ((NEFD_spec_eff*filtering/rms)**2)*factor_area_spec*(foverhead)/3600.0 #hours
 228     s_map_spec = ((dx*dy)/(((NEFD_spec_eff*filtering)**2)*foverhead))*3600.0            # arcmin^2 / hour^-1/ mJy^-2 
 229 if band == 2:
 230     tau = bv_2*pwv + cv_2
 231     NEFD_spec_eff      = NEFD_band2_spec*(np.e**(tau/np.sin(elevation*math.pi/180.)))
 232     rms_point_MJy_spec = rms/area_teta_band2_spec/10**9
 233     rms_point_cmb_spec = rms_point_MJy_spec*b_v_cmb(150,2.726)*10**6   
 234     rms_point_ys_spec  = rms_point_MJy_spec*y_sz(150,2.726)*10**6     
 235     rms_point_ys_spec  = np.abs(rms_point_ys_spec)
 236     #########################################
 237     ### ratio of areas with fraction of valid pixel in the 2mm band ###       
 238     #########################################
 239     factor_area_spec   = (1+(area_obs/(FoVArea*fpix_spec_2mm))) # from N. Billot Doc.
 240     ##########################################################
 241     ### Integration Time calculations for given conditions ###
 242     ##########################################################
 243     t_spec     = ((NEFD_spec_eff*filtering/rms)**2)*factor_area_spec*(foverhead)/3600.0 #hours
 244     s_map_spec = ((dx*dy)/(((NEFD_spec_eff*filtering)**2)*foverhead))*3600.0            # arcmin^2 / hour^-1/ mJy^-2 
 245 
 246 #########################################
 247 #### TIME PER OTF LINE TO REACH TOTAL ###
 248 #########################################
 249 
 250 T_SLOW = slewing_loss*((dx*60.0)/sampl_vel_slow)/60.0  # [minutes] 
 251 T_MID  = slewing_loss*((dx*60.0)/sampl_vel_mid)/60.0   # [minutes] 
 252 T_FAST = slewing_loss*((dx*60.0)/sampl_vel_fast)/60.0  # [minutes] 
 253 
 254 if verbose_flag == 1:
 255 
 256     print ''
 257     print '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 258     print '%%%%%%%%%% General Parameters Used for the Calculations %%%%%%%%%%%'
 259     print '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 260     print ''
 261     print '------------------------------------------------------------------------'
 262     print '|      Parameters      |    Band 1 (1.2 mm)    |    Band 2 (2.0 mm)    |'
 263     print '------------------------------------------------------------------------'
 264     print '|      opacity         |  %6.3fxpwv + %6.3f  |  %6.3fxpwv + %6.3f  |' % (bv_1,cv_1,bv_2,cv_2)
 265     print '------------------------------------------------------------------------'
 266     print '| HPBW [arcsec]        |       %6.1f          |       %6.1f          |' % (res_band1_spec,res_band2_spec)
 267     print '------------------------------------------------------------------------'
 268     print '| NEFDo [mJy.s^0.5]    |       %6.1f          |       %6.1f          |' % (NEFD_band1_spec,NEFD_band2_spec) 
 269     print '------------------------------------------------------------------------'
 270     print '| fpix                 |       %6.2f          |       %6.2f          |' % (fpix_spec_1mm, fpix_spec_2mm)
 271     print '------------------------------------------------------------------------'
 272     if band  == 1:
 273         print '| rms [mJy/beam]       |       %6.2f          |                       |' % (rms)
 274     if band  == 2:
 275         print '| rms [mJy/beam]       |                       |       %6.2f          |' % (rms)
 276     print '------------------------------------------------------------------------'
 277     print '| FoV [arcmin]         |                   %6.1f                      |' % (FoV) 
 278     print '------------------------------------------------------------------------'
 279     print '| h-filtering          |                   %6.2f                      |' % (filtering) 
 280     print '------------------------------------------------------------------------'
 281     print '| h-overhead           |                   %6.2f                      |' % (foverhead) 
 282     print '------------------------------------------------------------------------'
 283     print '| OTF slow [arcsec/s]  |                    %4i                       |' % (sampl_vel_slow)
 284     print '------------------------------------------------------------------------'
 285     print '| OTF mid  [arcsec/s]  |                    %4i                       |' % (sampl_vel_mid)
 286     print '------------------------------------------------------------------------'
 287     print '| OTF fast [arcsec/s]  |                    %4i                       |' % (sampl_vel_fast)
 288     print '------------------------------------------------------------------------'
 289     print '| Dump [hz]            |                   %6.2f                      |' % (sampl_rate)
 290     print '------------------------------------------------------------------------'
 291     print '| Dump POL [hz]        |                   %6.2f                      |' % (sampl_rate_pol)
 292     print '------------------------------------------------------------------------'
 293     print ''
 294 
 295     print '     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 296     print '     %%%%%%%%%%%%%%%%%   Units Conversion   %%%%%%%%%%%%%%%%%'
 297     print '     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
 298     print ''    
 299     print '     --------------------------------------------------------'
 300     print '     |         (User Defined)             |    Band %1i       |' % (band)
 301     print '     --------------------------------------------------------'
 302     print '     |rms [mJy/beam]                      |  %8.2f       |' % (rms) 
 303     print '     --------------------------------------------------------'
 304     print '     |rms point-like source [MJy/sr]      |     %6.2f      |'  % (rms_point_MJy_spec) 
 305     print '     |rms point-like source [K_CMB]x10^-6 |     %5i       |'  % (rms_point_cmb_spec) 
 306     print '     |*rms point.like source [Ysz]x10^-6  |     %5i       |'  % (rms_point_ys_spec) 
 307     print '     --------------------------------------------------------'
 308     print '     |* for Ysz = 1.0                                       |'
 309     print '     --------------------------------------------------------'
 310     print ''
 311 
 312 
 313 #############################
 314 #### TABLE FINAL RESULTS ####
 315 #############################
 316         
 317 print '     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'    
 318 print '     %%%%%%%%%%%%%%%%%%%%%%   Results  %%%%%%%%%%%%%%%%%%%%%%'    
 319 print '     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'    
 320 print ''    
 321 print '     for: El = %2i (deg), PWV = %1i (mm), tau = %4.2f, rms = %6.2f'  %  (elevation,pwv,tau,rms) 
 322 print '     Area = %4.1f (arcmin^2), Filter = %4.1f, Overhead = %4.1f'  %  (area_obs,filtering,foverhead) 
 323 print '  ---------------------------------------------------------------'
 324 print '  |    (User Defined)      |                          |         |'
 325 print '  ---------------------------------------------------------------'
 326 print '  | Band                   |                          |    %1i    |'  % (band) 
 327 print '  ---------------------------------------------------------------'
 328 if band  == 1:
 329     print '  | Total Integration Time at 1mm |         [hours]          | %6.1f  |'  % (t_spec)
 330     print '  ---------------------------------------------------------------'
 331     print '  | Mapping speed          | [arcmin^-2/hour/mJy^-2 ] | %6.1f  |'  % (s_map_spec) 
 332 if band  == 2:
 333     print '  | Total Integration Time at 2mm |         [hours]          | %6.1f  |'  % (t_spec)
 334     print '  ---------------------------------------------------------------'
 335     print '  | Mapping speed          | [arcmin^-2/hour/mJy^-2 ] | %6.1f  |'  % (s_map_spec) 
 336 print '  ---------------------------------------------------------------'
 337 print ' '
 338 
 339 if verbose_flag == 1:
 340 
 341     print bcolors.WARNING + '  WARNING1: For proposed maps taking longer than 40 minutes, the total' 
 342     print bcolors.WARNING + '  integration time should be split into several maps.\n' + bcolors.ENDC
 343     print ' '
 344     print bcolors.WARNING + '  WARNING2: Note that the confusion noise is not included in this Time' 
 345     print bcolors.WARNING + '  Estimator and it should be discussed in the proposal whether appro-'
 346     print bcolors.WARNING + '  priate. The RMS noise does not decrease indefinitely with integra- '
 347     print bcolors.WARNING + '  tion time but stops at the confusion limit caused by unresolved sour-'
 348     print bcolors.WARNING + '  ces within the beam. The exact threshold at which the RMS noise    '
 349     print bcolors.WARNING + '  reaches the confusion limit will vary with wavelength, beam size,  '
 350     print bcolors.WARNING + '  and the type of astronomical source (Galactic or Extra-Galactic). For' 
 351     print bcolors.WARNING + '  instance, for the GOODS-N field (part of the Deep Field GT Proposal),' 
 352     print bcolors.WARNING + '  a preliminary 1 sigma confusion limit around ~ 0.090 mJy and ~ 0.056' 
 353     print bcolors.WARNING + '  mJy at 1.2 mm and 2.0 mm, respectively, has been estimated (A. Beelen,'
 354     print bcolors.WARNING + '  private communication).\n' + bcolors.ENDC
 355 
 356     print ' '
 357     print '             Time per OTF line for allowed scanning speeds   '
 358     print '        -----------------------------------------------------'
 359     print '        |          | OTF Scan Velocity  | TIME PER OTF LINE |'
 360     print '        -----------------------------------------------------'
 361     print '        |          |     [arcsec/s]     |    [minutes]      |'
 362     print '        -----------------------------------------------------'
 363     print '        | OTF-SLOW |       %6.1f       |     %6.2f        |' % (sampl_vel_slow,T_SLOW)
 364     print '        | OTF-MID  |       %6.1f       |     %6.2f        |' % (sampl_vel_mid,T_MID)
 365     print '        | OTF-FAST |       %6.1f       |     %6.2f        |' % (sampl_vel_fast,T_FAST)
 366     print '        -----------------------------------------------------'
 367     print ' '
 368 
 369 ###############################
 370 #### CONVERSION TO MINUTES ####
 371 ###############################
 372 
 373 if t_spec >= 1.:
 374    time_str_spec=str(round(t_spec,1))+' hours'
 375 
 376 if t_spec < 1. and t_spec >= 1./60.:
 377    time_str_spec=str(round(t_spec*60,1))+' minutes'
 378 
 379 if t_spec < 1./60. and t_spec >= 0.1/3600.:
 380    time_str_spec=str(int(t_spec*3600))+' seconds'
 381 
 382 if t_spec < 0.1/3600.:
 383    time_str_spec='0.1 (seconds)'
 384 
 385 slew_overhe = str(int((slewing_loss-1.0)*100.0))
 386 
 387 ##############################
 388 #### OUTPUT FINAL RESULTS ####
 389 ##############################
 390     
 391 print bcolors.HEADER + '**********************************************'
 392 print '***  Total Integration Time => ' + time_str_spec + ' ***'
 393 print '**********************************************\n'    
 394 print ''
 395 
 396 print bcolors.HEADER +  bcolors.UNDERLINE + 'Please include the following text into your proposal:\n' + bcolors.ENDC
 397 
 398 print 'According to the specifications of the NIKA2 instrument, the total observing time using the NIKA2 '+str(band)+' mm band to map a region of '+str(round(area_obs,1))+' [arcmin^2] to reach an rms of '+str(rms)+' [mJy/beam], assuming '+str(pwv)+' [mm] pwv, '+str(elevation)+' [deg] elevation, Filter = '+str(filtering)+', Overhead = '+str(foverhead)+', was estimated to be *'+time_str_spec+'*, using the time estimator '+version+'.\n'

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2017-07-28 12:35:36, 21.8 KB) [[attachment:NIKA2_Time_Estimator.py]]
  • [get | view] (2017-07-28 12:39:29, 21.8 KB) [[attachment:NIKA2_Time_Estimator1.py]]
  • [get | view] (2017-09-28 09:12:07, 22.1 KB) [[attachment:NIKA2_Time_Estimator2.py]]
  • [get | view] (2017-09-28 15:02:49, 22.1 KB) [[attachment:NIKA2_Time_Estimator3.py]]
  • [get | view] (2018-01-20 15:02:28, 22.3 KB) [[attachment:NIKA2_Time_Estimator4.py]]
  • [get | view] (2017-07-28 11:54:53, 276.4 KB) [[attachment:NIKA2_Time_Estimator_Guideline.pdf]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.