parameter ifake ichip if ichip>0 string outfield '{field}%i1' ichip else string outfield {field} end_if open fakein ./{field}fake.lis stat nfake=count[fakein] if ifake>nfake printf 'Error: not enough lines in {field}fake.lis' end_if do i=1,ifake read fakein end_do mag=@fakein.1 abin=@fakein.2 close fakein ! Find the number of stars observed in this magnitude bin. If n>10, do ! completeness: find the average color of the stars in this bin printf '{outfield}/{outfield}.mag' >./a.inp printf '%2f12.3 ' mag abin >>./a.inp $(cd src ; make fake) $bin/fake < a.inp open fake ./fort.7 read fake n=@fake.1 read fake do i=1,nfilt string var 'fake.%i1' i string tvar 'tfake%i1' i {tvar}=10.^(-0.4*(@{var}-25)) end_do close fake if n<10|tfake2>90 do i=2,nfilt string tvar 'tfake%i1' i {tvar}=tfake1*10.^(0.4*faintcol) end_do end_if do i=1,nfilt string tvar 'tfake%i1' i string mvar 'fake%i1' i {mvar}={mvar}+{tvar} end_do type fake1 fake2 end