# set up input files cp AER_solarFcst_SEEN0001_20111013_1800.nc in1.nc cp AER_solarFcst_SEEN0001_20111013_1800.nc in2.nc cp AER_solarFcst_SEEN0001_20111013_1800.nc in3.nc cp AER_solarFcst_SEEN0001_20111013_1800.nc sample.nc # rename DNI variable to Percent Clear Sky Max DNI ncrename -h -v DNI,DNI_PERCENT_CLEAR_SKY_MAX in1.nc # change DNI_PERCENT_CLEAR_SKY_MAX to be distinct from DNI ncap2 -h -s 'DNI_PERCENT_CLEAR_SKY_MAX=100.0*DNI_PERCENT_CLEAR_SKY_MAX/1200.0' in1.nc in1.nc # redefine DNI_PERCENT_CLEAR_SKY_MAX attributes ncatted -h -a description,DNI_PERCENT_CLEAR_SKY_MAX,m,c,"Percent of Clear Sky Maximum DNI" in1.nc ncatted -h -a units,DNI_PERCENT_CLEAR_SKY_MAX,m,c,"%" in1.nc # rename LAT variable to SOLAR_CAPACITY ncrename -h -v LAT,SOLAR_CAPACITY in1.nc ncap2 -h -s 'SOLAR_CAPACITY(:)=50.0' in1.nc in1.nc # define SOLAR_CAPACITY attributes ncatted -h -a units,SOLAR_CAPACITY,c,c,"MW" in1.nc # rename LON variable to SOLAR_STATION_ID ncrename -h -v LON,SOLAR_STATION_ID in1.nc ncap2 -h -s 'SOLAR_STATION_ID(:)=-999.000' in1.nc in1.nc # rename LAT variable to SOLAR_LOCATION ncrename -h -v LAT,SOLAR_LOCATION in2.nc ncap2 -h -s 'SOLAR_LOCATION(:)=-999.000' in2.nc in2.nc # rename LON variable to SOLAR_CUSTOMER ncrename -h -v LON,SOLAR_CUSTOMER in2.nc ncap2 -h -s 'SOLAR_CUSTOMER(:)=-999.000' in2.nc in2.nc # change lats/lons to hide station locations ncap2 -h -s 'LAT=LAT+3' in3.nc in3.nc ncap2 -h -s 'LON=LON+10' in3.nc in3.nc # Put everything together using Append. # That is, take the union of all unique variables. ncks -h -A in1.nc sample.nc ncks -h -A in2.nc sample.nc ncks -h -A in3.nc sample.nc # Remove FORECAST_TYPE ncks -h -a -O -x -v 'FORECAST_TYPE' sample.nc sample_file.nc