Netcdf format

How do I...?
Post Reply
User avatar
jconrado
Posts: 10
Joined: Thu Jan 28, 2016 5:16 pm

Netcdf format

Post by jconrado »

Hi,

I would like to know how I can save my image displayed on the Mcidas-V screen in Netcdf format with the latitude and longitude values of each point in the image.

Thanks,

Conrado
User avatar
barryr
Posts: 213
Joined: Thu Jan 08, 2009 5:42 pm
Contact:

Re: Netcdf format

Post by barryr »

Hi Conrado,

Here some information from a coworker who has a better understanding of the netCDF files created by exporting displayed data in McV (documented here and here)...

  • As you noted, netCDF files that are created from displayed imagery in McV do not currently include the latitude and longitude values. There is a request (inquiry 2389) to add this ability.
  • Rather than lat/lon values the netCDF files created by exporting a displayed satellite image contain variables for ImageElement and ImageLine. These points are geo-located from a mcidas_area variable which has attributes including AreaDirectory and NavBlock.
  • There is a forum - Saving to Netcdf file and Latitude, longitude values - that has some additional information about this issue. It includes a reference to a script the user wrote to create individual netCDF files containing the data values, latitude and longitude. My coworker wrote a simplified version of that script that might be of use. Here it is:

    Code: Select all

    # variables
    loc = 'C:/Users/[path_to_data]'

    # load image data
    addeParms = dict(
        server = 'adde.ucar.edu',
        dataset = 'RTIMAGES',
        descriptor = 'GE-IR',
        unit = 'TEMP',
        )
    ir_data = loadADDEImage(**addeParms)

    # save to a grid
    exportGridToNetcdf(ir_data,loc+'satellite_grid.nc')

    # load the grid
    ir_grid = loadGrid(filename=loc+'satellite_grid.nc',field='Band4_TEMP')

    # lats and lons
    lats = extractLatitudeFromNWPGrid(ir_grid)
    lons = extractLongitudeFromNWPGrid(ir_grid)

    # create lat/lon netCDF files
    exportGridToNetcdf(lons,loc+'satellite_lons.nc')
    exportGridToNetcdf(lats,loc+'satellite_lats.nc')

  • Another option we haven't tried but you could investigate is to go from a CSV file to netCDF using methods outside of McV. For example, you can load in your image data source and create a Grid Table display (under the General menu in the Displays pane of the Field Selector). The grid table display has columns for latitude, longitude, and data value. There's no menu item in the Layer Controls to export the table to a CSV (which is requested in inquiry 1428), but you can click in one of the cells, do Ctrl+A and Ctrl+C to copy all of the cells. You can then open Microsoft Excel and paste McV's Grid Table cells into it. A Google search of "CSV to netCDF" suggests that there are a variety of ways to generate the netCDF files.

Thanks,
Barry
Post Reply