original_docstring: 
        Saves a tile table to the operations database, optionally into a FITS table.
  
        The default is to update the tile database in SQL. No parameters are needed in 
        this case.
  
        Parameters
        ----------
        tiledb : `~lvmsurveysim.scheduler.TileDB`
           The instance of a tile database to save
        fits : bool
           Optional, save to FITS table instead of database.
        path : str or ~pathlib.Path
           Optional, the path and basename of the fits file, no extension.
           Expects to find 'path.fits'.
        overwrite : bool
           Optional, overwrite the FITS file if it already exists. Default False
        
docstring: Saves a tile table to the operations database, optionally into a FITS table.
  The default is to update the tile database in SQL. No parameters are needed in
  this case.
  
  Parameters
  
  tiledb : `~lvmsurveysim.scheduler.TileDB`
  The instance of a tile database to save
  fits : bool
  Optional, save to FITS table instead of database.
  path : str or ~pathlib.Path
  Optional, the path and basename of the fits file, no extension.
docstring_tokens: Saves a tile table to the operations database optionally into a FITS table . The default is to update the tile database in SQL . No parameters are needed in this case . Parameters tiledb : ` ~lvmsurveysim . scheduler . TileDB ` The instance of a tile database to save fits : bool Optional save to FITS table instead of database . path : str or ~pathlib . Path Optional the path and basename of the fits file no extension .
code: def save_tiledb(cls, tiledb, fits=False, path=None, overwrite=False):
        """
        Saves a tile table to the operations database, optionally into a FITS table.
  
        The default is to update the tile database in SQL. No parameters are needed in 
        this case.
  
        Parameters
        ----------
        tiledb : `~lvmsurveysim.scheduler.TileDB`
           The instance of a tile database to save
        fits : bool
           Optional, save to FITS table instead of database.
        path : str or ~pathlib.Path
           Optional, the path and basename of the fits file, no extension.
           Expects to find 'path.fits'.
        overwrite : bool
           Optional, overwrite the FITS file if it already exists. Default False
        """
        targfile = str(tiledb.targets.filename) if tiledb.targets.filename is not None else 'NA'
        targhash = cls.md5(targfile)
        tile_table = tiledb.tile_table
        if fits:
           assert path != None, "path not provided for FITS save"
           tile_table.meta['targhash'] = targhash
           tile_table.meta['targfile'] = targfile
           tile_table.meta['scitile1'] = tiledb.tileid_start
           tile_table.write(path+'.fits', format='fits', overwrite=overwrite)
           s = len(tile_table)
        else:
           # store tiles in the Ops DB
           with cls.get_db().atomic():
                 # add metadata:
                 cls.set_metadata('targfile', targfile)
                 cls.set_metadata('targhash', targhash)
                 cls.set_metadata('scitile1', tiledb.tileid_start)
                 # save tile table
                 s = s2a.astropy2peewee(tile_table, Tile, replace=True)
        return s
code_tokens: def save_tiledb ( cls , tiledb , fits = False , path = None , overwrite = False ) : targfile = str ( tiledb . targets . filename ) if tiledb . targets . filename is not None else 'NA' targhash = cls . md5 ( targfile ) tile_table = tiledb . tile_table if fits : assert path != None , "path not provided for FITS save" tile_table . meta [ 'targhash' ] = targhash tile_table . meta [ 'targfile' ] = targfile tile_table . meta [ 'scitile1' ] = tiledb . tileid_start tile_table . write ( path + '.fits' , format = 'fits' , overwrite = overwrite ) s = len ( tile_table ) else : with cls . get_db ( ) . atomic ( ) : cls . set_metadata ( 'targfile' , targfile ) cls . set_metadata ( 'targhash' , targhash ) cls . set_metadata ( 'scitile1' , tiledb . tileid_start ) s = s2a . astropy2peewee ( tile_table , Tile , replace = True ) return s
short_docstring: Saves a tile table to the operations database, optionally into a FITS table.
short_docstring_tokens: Saves a tile table to the operations database optionally into a FITS table .
comment: """
        Saves a tile table to the operations database, optionally into a FITS table.
  
        The default is to update the tile database in SQL. No parameters are needed in 
        this case.
  
        Parameters
        ----------
        tiledb : `~lvmsurveysim.scheduler.TileDB`
           The instance of a tile database to save
        fits : bool
           Optional, save to FITS table instead of database.
        path : str or ~pathlib.Path
           Optional, the path and basename of the fits file, no extension.
           Expects to find 'path.fits'.
        overwrite : bool
           Optional, overwrite the FITS file if it already exists. Default False
        """$SEP$# store tiles in the Ops DB$SEP$# add metadata:$SEP$# save tile table