sds.setfillvalue(0) # Assign an attribute to the dataset sds.units = "W/m^2/micron/sr" # Write data sds[:, :] = numpy_array[:, :] print(f'writing sds with shape {numpy_array.shape}') # Close the dataset sds.endaccess() # Create an HDF file sdout = SD(str(generic_rad), SDC.WRITE | SDC.CREATE) # # write out two channels # write_chan(sdout, ch30_calibrated, 'ch30') write_chan(sdout, ch31_calibrated, 'ch31') # Flush and close the HDF file sdout.filename = modis_meta['filename'] sdout.comment = "written by modis_multichannel.ipynb" sdout.end() # %% from a301.scripts import hdf4ls hdf4ls.hdf4ls(str(generic_rad))