Unidata / ldm-alchemy

Python tools to handle LDM data feeds and convert to other formats.
MIT License
12 stars 6 forks source link

GOES-16 fixes #3

Closed dopplershift closed 7 years ago

dopplershift commented 7 years ago

Fixing up a few issues, both self-inflicted and external:

Still need to address the problem with Puerto Rico sectors (and Alaska/Hawaii for GOES-17), where they are mixed with Full Disk images.

dopplershift commented 7 years ago

@lesserwhirls Can you double check me on the CF-compliance here? Here's the CDL output:

netcdf GOES16_Mesoscale-2_20170309_211050_0.47_1km_37.6N_86.3W {
dimensions:
    y = 1416 ;
    x = 1063 ;
variables:
    int time ;
        time:units = "seconds since 2017-03-09" ;
        time:standard_name = "time" ;
        time:long_name = "The start date / time that the satellite began capturing the scene" ;
        time:axis = "T" ;
        time:calendar = "standard" ;
    short Sectorized_CMI(y, x) ;
        Sectorized_CMI:_FillValue = 0s ;
        Sectorized_CMI:standard_name = "toa_bidirectional_reflectance" ;
        Sectorized_CMI:units = "1" ;
        Sectorized_CMI:grid_mapping = "lambert_projection" ;
        Sectorized_CMI:add_offset = 0.f ;
        Sectorized_CMI:scale_factor = 0.0002442f ;
        Sectorized_CMI:valid_min = 0s ;
        Sectorized_CMI:valid_max = 4095s ;
        Sectorized_CMI:coordinates = "time y x" ;
    short y(y) ;
        y:standard_name = "projection_y_coordinate" ;
        y:units = "meters" ;
        y:scale_factor = -1043.15110334742 ;
        y:add_offset = 802183.198474142 ;
    short x(x) ;
        x:standard_name = "projection_x_coordinate" ;
        x:units = "meters" ;
        x:scale_factor = 1043.15110334742 ;
        x:add_offset = -540352.271533947 ;
    int lambert_projection ;
        lambert_projection:grid_mapping_name = "lambert_conformal_conic" ;
        lambert_projection:standard_parallel = 36.9986288914587 ;
        lambert_projection:longitude_of_central_meridian = -86.4841945250225 ;
        lambert_projection:latitude_of_projection_origin = 36.9986288914587 ;
        lambert_projection:false_easting = 0. ;
        lambert_projection:false_northing = 0. ;
        lambert_projection:semi_major = 6371200. ;
        lambert_projection:semi_major_axis = 6371200. ;
        lambert_projection:semi_minor = 6371200. ;
        lambert_projection:semi_minor_axis = 6371200. ;

// global attributes:
        :title = "Sectorized Cloud and Moisture Imagery for the TMESO region." ;
        :ICD_version = "GROUND SEGMENT (GS) TO ADVANCED WEATHER INTERACTIVE PROCESSING SYSTEM (AWIPS) INTERFACE CONTROL DOCUMENT (ICD) Revision B" ;
        :Conventions = "CF-1.6" ;
        :channel_id = 1 ;
        :central_wavelength = 0.47f ;
        :abi_mode = 3 ;
        :source_scene = "Mesoscale-2" ;
        :periodicity = 0.5f ;
        :production_location = "WCDAS" ;
        :product_name = "TMESO-010-B12-M3C01" ;
        :satellite_id = "GOES-16" ;
        :product_center_latitude = 37.5754513935151 ;
        :product_center_longitude = -86.3303284485791 ;
        :projection = "Lambert Conformal" ;
        :bit_depth = 12 ;
        :source_spatial_resolution = 1.f ;
        :request_spatial_resolution = 1.043151f ;
        :start_date_time = "2017068211050" ;
        :number_product_tiles = 4 ;
        :product_tile_width = 1024 ;
        :product_tile_height = 1024 ;
        :product_rows = 1416 ;
        :product_columns = 1063 ;
        :pixel_x_size = 1.04315110334739 ;
        :pixel_y_size = 1.04315110334739 ;
        :satellite_latitude = 0. ;
        :satellite_longitude = -89.5 ;
        :satellite_altitude = 35785831. ;
        :created_by = "ldm-alchemy" ;
        :product_tiles_received = 4LL ;
}

I added a coordinates attribute to the data variable and created the time variable from scratch.

I also took the tactic of adding additional attributes to the grid mapping, rather than renaming--this allows code written for stock files to function fine with these tweaked files, but CF-compliant tools should now be happy with these files.

lesserwhirls commented 7 years ago

Looks good to me. No idea why the "axis" part was dropped from the ellipsoid info in the grid_mapping metadata.