original_docstring:  Submit "pre-ARD" processing orders and create tracking metadata
      
docstring: Submit "pre-ARD" processing orders and create tracking metadata
docstring_tokens: Submit " pre - ARD " processing orders and create tracking metadata
code: def submit(ctx, image_collection, index, row, col,
             period_start, period_end, period_freq, date_format):
      """ Submit "pre-ARD" processing orders and create tracking metadata
      """
      from cedar.exceptions import EmptyOrderError
      from cedar.sensors import CREATE_ARD_COLLECTION
      from cedar.utils import load_ee
  
      # Need index OR (row AND col) -- blame index param if it goes wrong
      _, index_param = options.fetch_param(ctx, 'index')
      if index:
          if row or col:
              raise click.BadParameter(
                  'Cannot use `--index` with `--row` or `--col`',
                  ctx=ctx, param=index_param)
      elif row and col:
          if index:
              raise click.BadParameter(
                  'Cannot use `--row` and `--col` with `--index`',
                  ctx=ctx, param=index_param)
          index = list(itertools.product(row, col))
      else:
          raise click.BadParameter(
              'Must specify `--index` OR both `--row` and `--col`',
              ctx=ctx, param=index_param)
  
      # Eventually we'll support not having a period_start/period_end, but not yet
      if not period_start or not period_end:
          name = f'period_{"start" if not period_start else "end"}'
          param = options.fetch_param(ctx, name)[1]
          raise click.BadParameter(f'Must pass {name}ing period',
                                   ctx=ctx, param=param)
  
      # Check that we know about the image collection
      for collection in image_collection:
          if collection not in CREATE_ARD_COLLECTION:
              raise KeyError(f'Unknown image collection "{collection}"')
  
      # Get parse(d) config and build tracker
      config = options.fetch_config(ctx)
      tracker = config.get_tracker()
  
      # Login to EE
      ee = load_ee(True)
  
      msg = [
          f'Tiles: {", ".join([f"h{c:04d}v{r:04d}" for r, c in index])}',
          f'Collections: {", ".join(image_collection)}',
          f'Time period: {period_start.isoformat()} - {period_end.isoformat()}',
          f'At frequency: {period_freq}'
      ]
      click.echo('Submitting preARD tasks for:')
      click.echo("\n".join([f"    {s}" for s in msg]))
  
      # Submit!
      try:
          tracking_info_name, tracking_info_id = tracker.submit(
              image_collection,
              index,
              period_start, period_end,
              period_freq=period_freq
          )
          click.echo('Wrote job tracking to store object named '
                     f'"{tracking_info_name}" ({tracking_info_id})')
      except EmptyOrderError as ece:
          click.echo(repr(ece))
          click.echo('Did not find data to order. Check your search parameters')
          raise click.Abort()
      except Exception as e:
          click.echo('Unknown error occurred. See exception printed below')
          raise e
code_tokens: def submit ( ctx , image_collection , index , row , col , period_start , period_end , period_freq , date_format ) : from cedar . exceptions import EmptyOrderError from cedar . sensors import CREATE_ARD_COLLECTION from cedar . utils import load_ee _ , index_param = options . fetch_param ( ctx , 'index' ) if index : if row or col : raise click . BadParameter ( 'Cannot use `--index` with `--row` or `--col`' , ctx = ctx , param = index_param ) elif row and col : if index : raise click . BadParameter ( 'Cannot use `--row` and `--col` with `--index`' , ctx = ctx , param = index_param ) index = list ( itertools . product ( row , col ) ) else : raise click . BadParameter ( 'Must specify `--index` OR both `--row` and `--col`' , ctx = ctx , param = index_param ) if not period_start or not period_end : name = f'period_{"start" if not period_start else "end"}' param = options . fetch_param ( ctx , name ) [ 1 ] raise click . BadParameter ( f'Must pass {name}ing period' , ctx = ctx , param = param ) for collection in image_collection : if collection not in CREATE_ARD_COLLECTION : raise KeyError ( f'Unknown image collection "{collection}"' ) config = options . fetch_config ( ctx ) tracker = config . get_tracker ( ) ee = load_ee ( True ) msg = [ f'Tiles: {", ".join([f"h{c:04d}v{r:04d}" for r, c in index])}' , f'Collections: {", ".join(image_collection)}' , f'Time period: {period_start.isoformat()} - {period_end.isoformat()}' , f'At frequency: {period_freq}' ] click . echo ( 'Submitting preARD tasks for:' ) click . echo ( "\n" . join ( [ f"    {s}" for s in msg ] ) ) try : tracking_info_name , tracking_info_id = tracker . submit ( image_collection , index , period_start , period_end , period_freq = period_freq ) click . echo ( 'Wrote job tracking to store object named ' f'"{tracking_info_name}" ({tracking_info_id})' ) except EmptyOrderError as ece : click . echo ( repr ( ece ) ) click . echo ( 'Did not find data to order. Check your search parameters' ) raise click . Abort ( ) except Exception as e : click . echo ( 'Unknown error occurred. See exception printed below' ) raise e
short_docstring: Submit "pre-ARD" processing orders and create tracking metadata
short_docstring_tokens: Submit " pre - ARD " processing orders and create tracking metadata
comment: """ Submit "pre-ARD" processing orders and create tracking metadata
      """$SEP$# Need index OR (row AND col) -- blame index param if it goes wrong$SEP$# Eventually we'll support not having a period_start/period_end, but not yet$SEP$# Check that we know about the image collection$SEP$# Get parse(d) config and build tracker$SEP$# Login to EE$SEP$# Submit!