OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
remake_orbit_objects.py
Go to the documentation of this file.
1 def remake_orbit_objects(norb,nc_fid,ngid):
2  # Program to redefine orbit objects in Hawkeye L1A file
3  # input:
4  # - norb: number of orbits
5  # - nc_fid: netcdf file id
6  # - ngid: group id
7  # Liang Hong, 2/26/2020, note: there is a library bug in netCDF4 module giving runtime error when renamevariable
8  # Liang Hong, 2/24/2021, removed rpy_offset from navigation_data group attribute
9 
10 
14 
15  # set rol, pitch, yaw initial offsets to 0
16  # nc_fid.groups['navigation_data']
17  # ngid.rpy_offset = '0,0,0'
18 
19  # Create dimension
20  if 'x' not in nc_fid.dimensions.keys():
21  nc_fid.createDimension('x',norb)
22  nc_fid.createDimension('y',3)
23 
24  # Create data objects
25  orb_time_new = nc_fid.createVariable('/navigation_data/orb_time','f8',('x'),fill_value=-999)
26  orb_pos_new = nc_fid.createVariable('/navigation_data/orb_pos',float,('x','y'),fill_value=-999999)
27  orb_vel_new = nc_fid.createVariable('/navigation_data/orb_vel',float,('x','y'),fill_value=-999)
28 
29  # Set attributes
30  orb_time_new.long_name = "Orbit vector time (seconds of day)"
31  orb_pos_new.long_name = "Orbit position vectors"
32  orb_vel_new.long_name = "Orbit velocity vectors"
33  orb_time_new.valid_min = 0.0
34  orb_pos_new.valid_min = -7000.0
35  orb_vel_new.valid_min = -8.0
36  orb_time_new.valid_max = 86400.0
37  orb_pos_new.valid_max = 7000.0
38  orb_vel_new.valid_max = 8.0
39  orb_time_new.units = "seconds"
40  orb_pos_new.units = "kilometers"
41  orb_vel_new.units = "kilometers/second"
42 
43  return
def remake_orbit_objects(norb, nc_fid, ngid)