shuangshuang zi
New member
I am trying to use a custom Irrigation Area Fraction dataset (0-1) from China by converting a netcdf file into a binary (BIL) file. However, after running geogrid.exe, the generated geo_em.d01.nc and geo_em.d02.nc file does not reflect my custom dataset, and the values and projections are both incorrect.
The spatial map of irrigation area proportion data should look like this:

2. Retrieve grid information through cdo

3. Set the index to interpret the data

4. Configured GEOGRID.TBL to reference my dataset
2) Is there an error in my index file configuration?
3) How can I ensure the projection of custom data matches the projection set in the WRF domain?
4) My irrigation area proportion data (nc) is in WGS84—could this affect the results?
5) Why are both the values and coordinate system of my newly generated irrigation area proportion data incorrect?
The spatial map of irrigation area proportion data should look like this:
Steps I Followed
1.Saved it as a BIL file based on the pythoninput_netcdf_file = 'pro_area/pro_data/final_irrigation_fraction_out010.nc'
variable_name = 'Irrfrac'
final_fraction = xr.open_dataset(input_netcdf_file)[variable_name]
data_for_wps = final_fraction.fillna(-999.0)
data_for_wps = data_for_wps.astype(np.float32)
if data_for_wps.lat.values[0] > data_for_wps.lat.values[-1]:
data_for_wps = data_for_wps.reindex(lat=list(reversed(data_for_wps.lat.values)))
print("finidhed")
else:
print("finished")
numpy_array = data_for_wps.values
ny, nx = numpy_array.shape
output_filename = f"00001-{nx:05d}.00001-{ny:05d}"
print(output_filename)
big_endian_data = numpy_array.astype('>f4')
with open(output_filename, 'wb') as f:
f.write(big_endian_data.tobytes(order='C'))
2. Retrieve grid information through cdo

3. Set the index to interpret the data

4. Configured GEOGRID.TBL to reference my dataset
name = IRRFRAC
priority = 1
dest_type = continuous
interp_option = default:average_gcell(4.0)
rel_path = default:irrfraction/
Questions:
1) Is my data conversion workflow (from NetCDF to BIL) correct?2) Is there an error in my index file configuration?
3) How can I ensure the projection of custom data matches the projection set in the WRF domain?
4) My irrigation area proportion data (nc) is in WGS84—could this affect the results?
5) Why are both the values and coordinate system of my newly generated irrigation area proportion data incorrect?