I need to convert netCDF files from AWS's GOES data into GeoTIFF. My end goal is to use these as raster layers in GeoServer. I have used GDAL to warp a GeoTIFF into EPSG 4326 so for now I just need to get it into a GeoTIFF. I tried using gdal_translate with the command:
gdal_translate NETCDF:"OR_ABI-L2-CMIPF-M3C02_G16_s20180640000387_e20180640011153_c20180640011226.nc":CMI test2.tif
This gives me an image, but opening it with an image viewer just shows a white background with a completely black circle. I've also tried using Python with the code:
# Required libraries import matplotlib.pyplot as plt from netCDF4 import Dataset import pdb # Path to the GOES-R simulated image file path = '/home/brian/projects/aws_goes_testing/OR_ABI-L2-CMIPF-M3C02_G16_s20180640000387_e20180640011153_c20180640011226.nc' # Open the file using the NetCDF4 library nc = Dataset(path) # Extract the Brightness Temperature values from the NetCDF data = nc.variables['CMI'][:] # Show data plt.imshow(data) plt.show()
This gives me an image I want but I'm not sure how I can save the data variable as a GeoTIFF. Obviously I can use plt.savefig() but this isn't what I want since it will include the axis and everything from the figure I don't want.