Skip to content

Commit

Permalink
Merge pull request #8 from ddasilva/write_zarr
Browse files Browse the repository at this point in the history
Write Mock Level3 Zarr File
  • Loading branch information
starfleetjames authored Dec 18, 2024
2 parents d2f4491 + 6281153 commit 953b370
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion suncet_processing_pipeline/make_level3.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,22 @@ def run(self):
"""Main method to process the level2 -> level3 stage."""
# Load metadata
metadata = metadata_mgr.MetadataManager(self.run_dir)

# Write NetCDF output
nc_output_path = self.run_dir / 'level3' / 'suncet_level3.nc'
self._write_nc_file(nc_output_path, metadata)

# Write Zarr output in zip file using NetCDF library. This requires
# a custom file:// string
zarr_output_path = 'file://' + str(
self.run_dir / 'level3' / 'suncet_level3.zarr#mode=nczarr,zip'
)
self._write_nc_file(zarr_output_path, metadata)

def _write_nc_file(self, nc_output_path, metadata):
print(f'Writing {nc_output_path}')

# Start NetCDF File
nc_output_path = self.run_dir / 'level3' / 'suncet_level3.nc'
nc = Level3NetCDFWriter(nc_output_path, metadata)

# placeholder, TODO check real image size
Expand Down

0 comments on commit 953b370

Please sign in to comment.