Page 1 of 1

PACE OCI level-2 AOP wavelength_3d variable missing

Posted: Wed Oct 08, 2025 4:26 pm America/New_York
by clays_bio
Hi everyone, I'm trying to figure out which wavelengths are used in the Rrs array in PACE OCI level-2 AOP files that I downloaded, which don't have the sensor_band_parameters/wavelength_3d variable mentioned in all the documentation and other posts on this forum. The sample netCDF file at https://oceancolor.gsfc.nasa.gov/data/pace/format/#oci doesn't have it either, but the format for level-2 AOP files does list that variable. I'm not sure if I'm missing something obvious or if there was an update to the format in version 3.1 and the documentation is out of date... Can anyone tell me how to get the wavelength_3d values in version 3.1 PACE OCI files?

Re: PACE OCI level-2 AOP wavelength_3d variable missing

Posted: Wed Oct 08, 2025 4:53 pm America/New_York
by oo_processing
Hey,

If you are running a python environment, try this:

Code: Select all

>>> import netCDF4
>>> f=netCDF4.Dataset('l2/PACE_OCI.20240501T000458.L2.OC_AOP.V3_1.nc')
>>> f['sensor_band_parameters/wavelength_3d']
<class 'netCDF4._netCDF4.Variable'>
int32 wavelength_3d(wavelength_3d)
    long_name: wavelengths
    units: nm
    _FillValue: -32767
    valid_min: 0
    valid_max: 20000
path = /sensor_band_parameters
unlimited dimensions:
current shape = (172,)
filling on
>>> f['sensor_band_parameters/wavelength_3d'][:]
array([346, 348, 351, 353, 356, 358, 361, 363, 366, 368, 371, 373, 375,
       378, 380, 383, 385, 388, 390, 393, 395, 398, 400, 403, 405, 408,
       410, 413, 415, 418, 420, 422, 425, 427, 430, 432, 435, 437, 440,
       442, 445, 447, 450, 452, 455, 457, 460, 462, 465, 467, 470, 472,
       475, 477, 480, 482, 485, 487, 490, 492, 495, 497, 500, 502, 505,
       507, 510, 512, 515, 517, 520, 522, 525, 527, 530, 532, 535, 537,
       540, 542, 545, 547, 550, 553, 555, 558, 560, 563, 565, 568, 570,
       573, 575, 578, 580, 583, 586, 588, 613, 615, 618, 620, 623, 625,
       627, 630, 632, 635, 637, 640, 641, 642, 643, 645, 646, 647, 648,
       650, 651, 652, 653, 655, 656, 657, 658, 660, 661, 662, 663, 665,
       666, 667, 668, 670, 671, 672, 673, 675, 676, 677, 678, 679, 681,
       682, 683, 684, 686, 687, 688, 689, 691, 692, 693, 694, 696, 697,
       698, 699, 701, 702, 703, 704, 706, 707, 708, 709, 711, 712, 713,
       714, 717, 719], dtype=int32)
-Y

Re: PACE OCI level-2 AOP wavelength_3d variable missing

Posted: Wed Oct 08, 2025 5:14 pm America/New_York
by clays_bio
That works! But I don't understand why... I typically use R but this is the result with similar code:

Code: Select all

> library(ncdf4)
> nc = nc_open('../../PACE_OCI.20250101T000242.L2.OC_AOP.V3_0.nc')
> ncvar_get(nc, 'sensor_band_parameters/wavelength_3d')
[1] "vobjtovarid4: error #F: I could not find the requsted var (or dimvar) in the file!"
[1] "var (or dimvar) name: sensor_band_parameters/wavelength_3d"
[1] "file name: ../../PACE_OCI.20250101T000242.L2.OC_AOP.V3_0.nc"
Error in vobjtovarid4(nc, varid, verbose = verbose, allowdimvar = TRUE) : 
  Variable not found

Re: PACE OCI level-2 AOP wavelength_3d variable missing

Posted: Wed Oct 08, 2025 6:19 pm America/New_York
by oo_processing
Same error here. You may submit a bug report to the ncdf4 author.

-Y

Re: PACE OCI level-2 AOP wavelength_3d variable missing

Posted: Thu Oct 09, 2025 2:01 pm America/New_York
by clays_bio
Thanks for checking! I sent a message to the ncdf4 author.