# Set up the home dir to use in the rest of this session import time setOffScreen(1) # command line options have been removed. Use this script as a template and use sed, awk or whatever works to insert necessary # parameters. inputFileName1 = '/Users/kbah/glance/input/kaba/fullres/conus/GRB_VAL_band10_ncsa_fcm_rem_2km_conus_sim_abi_2005_0604_2200utc.nc' selectedField1 = 'ABI_Rad_b10' inputFileName2 = '/Users/kbah/glance/input/wendy/fullres/new/conus/GOESR_BAND10_ABI_CONUS_SIM_2KM_2005_0604_2200UTC.NC' selectedField2 = 'rad_b01' sourceType = 'netcdf.grid' displayType = 'planviewcolor' outFileName = '/Users/kbah/glance/output/conus/script/testb10.jpg' dataMin=None dataMax=None cTable="Inverse Gray Scale" projection=None scaleFactor=1.0 width = 800 height = 800 idv.getStateManager().setViewSize(java.awt.Dimension(width,height)) #change the width and height of the display #### GET THE DATA FOR USE IN McIDAS-V ONLY RUN CODE IF NO ERRORS ARE ENCOUNTERED### with managedDataSource(inputFileName1, dataType=sourceType) as dd1: dataSource1 = idv.getDataManager().findDataSource(dd1.getName()) dataChoice1 = dataSource1.findDataChoice(selectedField1) flatField1 = dataSource1.getData(selectedField1) #### GET LABELS #### #### Use Grid Utilities to get color bar label ([0] is selecting the first element in the java array returned from GridUtill.getParamUnits(Choice1)) colorBarLabel1= GridUtil.getParamUnits(flatField1)[0] dataDescription1 = dataChoice1.getDescription() # Display the data and get the displayControl (dc) dc=createDisplay('planviewcolor',dataChoice1) time.sleep(5) # get the view managers for setting lat/lon lines, projections and color tables myDisplay = firstDisplay() #set the projection if type(projection).__name__ != 'NoneType': myDisplay.setProjectionByName(projection) #zoom if desired myDisplay.setScaleFactor(scaleFactor) #---changing the color table---# ctm=idv.getColorTableManager() ct=ctm.getColorTable(cTable) dc.setColorTable(ct) # Turn off the layer label dc.setShowInDisplayList(0) #### SAVE THE IMAGE #### writeImage(outFileName,\ "matte background=white top=80;matte background=black bottom=40;\ colorbar width=300 height=20 anchor=UM place=UM,0,20 showlines=true tickmarks=2 showunit=true;\ overlay text="+dataDescription1+" place=LM,0,-20 anchor=LM color=yellow fontsize=20 fontface=Arial;\ overlay text="+str(colorBarLabel1)+" anchor=UM place=UM,0,60 color=black fontsize=12 fontface=Arial")