def get_input_file(self, filename):
<EOL>dest = get_bigdata('<STR_LIT>', self.env, self.detector, '<STR_LIT:input>',<EOL>filename)<EOL>if filename.endswith('<STR_LIT>'):<EOL><INDENT>newfilename = filename.rstrip('<STR_LIT>')<EOL>os.rename(filename, newfilename)<EOL>filename = newfilename<EOL><DEDENT>if filename.endswith('<STR_LIT>'):<EOL><INDENT>all_raws = raw_from_asn(filename)<EOL>for raw in all_raws:  <EOL><INDENT>get_bigdata('<STR_LIT>', self.env, self.detector, '<STR_LIT:input>',<EOL>raw)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>all_raws = [filename]<EOL><DEDENT>first_pass = ('<STR_LIT>' in os.environ and<EOL>'<STR_LIT>' in os.environ['<STR_LIT>'])<EOL>for raw in all_raws:<EOL><INDENT>ref_files = calref_from_image(raw)<EOL>for ref_file in ref_files:<EOL><INDENT>if ('<STR_LIT:$>' not in ref_file and<EOL>os.path.basename(ref_file) == ref_file):<EOL><INDENT>get_bigdata('<STR_LIT>', self.env, self.detector,<EOL>'<STR_LIT:input>', ref_file)<EOL>continue<EOL><DEDENT>if '<STR_LIT:$>' in ref_file and first_pass:<EOL><INDENT>first_pass = False<EOL>if not os.path.isdir('<STR_LIT>'):<EOL><INDENT>ref_path = os.path.dirname(dest) + os.sep<EOL>var = ref_file.split('<STR_LIT:$>')[<NUM_LIT:0>]<EOL>os.environ[var] = ref_path  <EOL><DEDENT><DEDENT>download_crds(ref_file, timeout=self.timeout)<EOL><DEDENT><DEDENT>
Copy input file (ASN, RAW, etc) into the working directory.
If ASN is given, RAW files in the ASN table is also copied.
The associated CRDS reference files are also copied or
downloaded, if necessary.

Data directory layout for CALCOS::

    detector/
        input/
        truth/

Parameters
----------
filename : str
    Filename of the ASN/RAW/etc to copy over, along with its
    associated files.