238 KiB
238 KiB
In [27]:
import netCDF4 as nc
In [32]:
data = nc.Dataset('./data/2022-10-09/PAR_Minutes_Download/H08_20221009_0500_RFL020_FLDK.02401_02401.nc')
In [33]:
data
Out[33]:
<class 'netCDF4._netCDF4.Dataset'> root group (NETCDF4 data model, file format HDF5): title: Himawari-08 AHI equal latitude-longitude map data id: H08_20221009_0500_RFL020_FLDK.02401_02401.nc date_created: 2022-10-09T05:26:29Z pixel_number: 2401 line_number: 2401 upper_left_latitude: 60.0 upper_left_longitude: 80.0 grid_interval: 0.05 band_number: 6 algorithm_version: 0201 Ancillary meteorological data: JMA forcast Ancillary ozone data: JMA objective analysis BRDF correction: on (Morel and Maritorena 2001) dimensions(sizes): latitude(2401), longitude(2401), band(6), time(1), geometry(17) variables(dimensions): float32 latitude(latitude), float32 longitude(longitude), int32 band_id(band), float64 start_time(time), float64 end_time(time), float64 geometry_parameters(geometry), int16 TAOT_02(latitude, longitude), int16 TAAE(latitude, longitude), int16 PAR(latitude, longitude), int16 SWR(latitude, longitude), int16 UVA(latitude, longitude), int16 UVB(latitude, longitude), uint8 QA_flag(latitude, longitude) groups:
In [34]:
data.variables.keys()
Out[34]:
dict_keys(['latitude', 'longitude', 'band_id', 'start_time', 'end_time', 'geometry_parameters', 'TAOT_02', 'TAAE', 'PAR', 'SWR', 'UVA', 'UVB', 'QA_flag'])
In [35]:
data.variables['SWR']
Out[35]:
<class 'netCDF4._netCDF4.Variable'> int16 SWR(latitude, longitude) long_name: Shortwave radiation units: W/m^2 scale_factor: 0.05 add_offset: 0.0 valid_min: 0 valid_max: 26000 missing_value: -32768 unlimited dimensions: current shape = (2401, 2401) filling on, default _FillValue of -32767 used
In [38]:
data.variables['latitude']
Out[38]:
<class 'netCDF4._netCDF4.Variable'> float32 latitude(latitude) long_name: latitude units: degrees_north unlimited dimensions: current shape = (2401,) filling on, default _FillValue of 9.969209968386869e+36 used
In [2]:
import cv2
In [3]:
img = cv2.imread('./data/2022-10-09/PAR_Minutes_Analysis/20221009_0500.tif', 2) img
Out[3]:
array([[559.4 , 559.45 , 559.5 , ..., 326.30002, 332.75 , 331.55002], [559.55 , 559.65 , 559.9 , ..., 331.7 , 331.7 , 331.55002], [556.8 , 559.15 , 559.4 , ..., 337.95 , 337.75 , 331.95 ], ..., [816.45 , 816.35004, 816.45 , ..., 541.65 , 543.35004, 527.65 ], [817.45 , 815.25 , 814.5 , ..., 543.4 , 413.5 , 398.75 ], [817.5 , 813.35004, 817.3 , ..., 544.05 , 239.1 , 339.75 ]], dtype=float32)
In [4]:
import matplotlib.pyplot as plt
In [9]:
plt.imshow(img, "Greys_r")
Out[9]:
<matplotlib.image.AxesImage at 0x18f79cd60c8>
In [ ]: