<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_NetCDF_georeference(origin, outfile):
 """Write georeference info to a netcdf file, usually sww. The origin can be a georef instance or parameters for a geo_ref instance outfile is the name of the file to be written to. """


    geo_ref = ensure_geo_reference(origin)
    geo_ref.write_NetCDF(outfile)
    return geo_ref