I am using GDAL to process grib2 data. This data is downloaded from NCEP using HTTP random access based on the byte ranges specified in the index file for each grib file. This .idx file looks like this:
1:0:d=2019101400:PRMSL:mean sea level:30 hour fcst:
2:2285226:d=2019101400:REFD:263 K level:30 hour fcst:
3:2892001:d=2019101400:PRES:1 hybrid level:30 hour fcst:
4:5329680:d=2019101400:CLWMR:1 hybrid level:30 hour fcst:
5:5615579:d=2019101400:CICE:1 hybrid level:30 hour fcst:
6:5880098:d=2019101400:RWMR:1 hybrid level:30 hour fcst:
7:6228703:d=2019101400:SNMR:1 hybrid level:30 hour fcst:
8:6478687:d=2019101400:REFD:1 hybrid level:30 hour fcst:
9:7924976:d=2019101400:TCOND:1 hybrid level:30 hour fcst:
10:8217813:d=2019101400:RIME:1 hybrid level:30 hour fcst:
11:8510802:d=2019101400:HGT:1 hybrid level:30 hour fcst:
12:9925562:d=2019101400:TMP:1 hybrid level:30 hour fcst:
13:12075121:d=2019101400:RH:1 hybrid level:30 hour fcst:
14:14803802:d=2019101400:SPFH:1 hybrid level:30 hour fcst:
15.1:17668539:d=2019101400:UGRD:1 hybrid level:30 hour fcst:
15.2:17668539:d=2019101400:VGRD:1 hybrid level:30 hour fcst:
16:21815010:d=2019101400:VVEL:1 hybrid level:30 hour fcst:
For some models, there is an issue which is shown in the above example. Band 15 has two sub-bands, with identical byte markers. I am not sure how to extract the data pertaining to UGRD and VRGD separately. I have not encountered any documentation that describes this.
Opening the associated grib2 file with GDAL splits those bands up properly, so they are definitely isolated datasets.