예제 #1
0
# run the pipeline
#gbtpipeline --clobber -u tmb --window 2 -m "70:81,84:86" -f 0,1,3,4,5,6 -i /home/scratch/vsokolov/AGBT15B_313_03.raw.vegas

# The default gains should be 1's
# the gains derived from GAS on semester 15B are below, and they provide a good intrabeam calibration
# however, there could be a small global correction to get the amplitude calibration right.
#
Gains = '1,1,1,1,1,1,1,1,1,1,1,1,1,1'
GAS_Gains='0.883,0.858,0.885,0.847,0.847,0.855,0.746,0.731,0.986,0.768,0.647,0.522,0.894,1.109'

window=['0','1','2','3','4','5','6']
window=['0'] # Only NHc(1,1) to test the system
Region='cloudA'

for thisWindow in window:
	GAS_gridregion.doPipeline(SessionNumber=3, StartScan=70, EndScan=81, Source='EG28.67', 
		Gains=Gains, Region=Region, Window=str(thisWindow), overwrite=True)

	GAS_gridregion.doPipeline(SessionNumber=3, StartScan=84, EndScan=86, Source='EG28.67', 
		Gains=Gains, Region=Region, Window=str(thisWindow), overwrite=True)

# I had to run this manually :S
#mv *window0*.fits cloudA_NH3_11/.

data_dir='/lustre/pipeline/scratch/jpineda/Vlas/GBT-15B-313/'
startChannel = 1024 + 668 # default 1024
endChannel = 1024 + 1452  # default 3072
file_extension='_test'
GAS_gridregion.griddata( rootdir=data_dir, region=Region, 
        dirname=Region+'_NH3_11', 
        startChannel = startChannel, endChannel = endChannel, 
        file_extension=file_extension)
예제 #2
0
def map_cloud(cloud, do_sdfits=False, do_calibration=False, do_imaging=True, keys=keys):
	source  = keys[cloud]['source' ] 
	region  = keys[cloud]['region' ] 
	windows = keys[cloud]['windows'] 
	nblocks = keys[cloud]['nblocks']
	scans   = keys[cloud]['scans'  ] 
	gains   = keys[cloud]['gains'  ] 
	beam    = keys[cloud]['beam'   ] 

	# TODO: make --windows (or better yet, --lines) an cmd argument
	# pulls all unique values from a dictionary of {'ifnum':'lineName', ...} form:
	lines = [] 
	_ = [(WindowDict[ifn],lines.append(WindowDict[ifn])) 
		for ifn in WindowDict if WindowDict[ifn] not in lines]
	# NOTE: "lines" list controls the imaging loop, 
	#	while "windows" list controls calibration!
	# TODO: resolve lines/windows ambiguity!

	# Convert VEGAS raw data to sdfits
	if do_sdfits:
		import subprocess
		assert type(scans) is list # better safe than sorry
		unique_sessions = set([s['session'] for s in scans])
		for session in unique_sessions:
			# all scan blocks within one session are 
			# parsed in a "s1:s2,s3:s4,..." format and
			# then sent to sdfits-test for data-crunching
			scan_blocks = ','.join(['%i:%i'%(s['start'],s['end']) 
					       for s in scans 
					       if s['session'] is session])
			sdfits_dir = ' AGBT15B_313_%.2i' % session
			sdfits_args = ' -scans=\"%s\"' % scan_blocks
			# TODO: oops I also need to properly set the output dir!
			subprocess.Popen('sdfits-test -backends=vegasi'+
					 sdfits_args+sdfits_dir)

	# it's being quite slow on the import, moved inside the script	
	import GAS_gridregion
	data_dir='/lustre/pipeline/scratch/vsokolov/'
	# Run the GAS pipeline wrapper
	if do_calibration:
		for window in windows:
			# TODO: this is way too slow; gbtpipeline can accept
			# arguments like -m "50:60,80:90", rewrite the 
			# GAS wrapper to accept faster arguments
			for block in range(nblocks):	
				GAS_gridregion.doPipeline(
				   SessionNumber = scans[block]['session'],
			 	   StartScan     = scans[block]['start'],
				   EndScan       = scans[block]['end'  ], 
				   Source        = source,
				   Gains         = gains, 
				   Region        = region, 
				   Window        = str(window), 
				   OutputRoot    = data_dir+region+'/',
				   overwrite     = True                   )
	
	# Image the calibrated data
	if do_imaging:
		# TODO: trim and implement proper vlsr corrections
		# cloud 'I' had a somewhat mismatched vlsr
		startChannel, endChannel = (2800, 4600) \
			if cloud is 'I' else (3200, 5000)
		for line in lines:
			GAS_gridregion.griddata(rootdir=data_dir, 
			                        region=region, 
			                        indir=region+'_'+line, 
			                        outfile=region+'_'+line, 
			                        startChannel = startChannel, 
			                        endChannel = endChannel, 
			                        doBaseline = True,
						baselineRegion = 
							basebox(cloud, line)+
							startChannel,
						useBeam = beam,
						file_extension='')