pro propermotion_corrector,catra,catdec,pmra,pmdec,newra,newdec,$ catyr=catyr,newyr=newyr,$ i24=i24,osxg=osxg,$ verbose=verbose, _extra=e ;+ ;procedure propermotion_corrector ; computes proper motion and new coordinates ; ;syntax ; propermotion_corrector.catra,catdec,pmra,pmdec,newra,newdec,$ ; catyr=catyr,newyr=newyr,verbose=verbose,$ ; /i24,/osxg,/hrs,/idnum,/idpre,/idform,/pm,/chop,/osep ; ;parameters (all REQUIRED) ; catra [INPUT] catalog RA ; catdec [INPUT] catalog Dec ; * CATRA and CATDEC must have the same sizes ; * may be either float or string array ; * if float, assumed to be decimal degrees unless /I24 is set ; * if string, assumed to be decimal degrees unless ':' or ' ' ; are found ; pmra [INPUT] proper motion in RA [mas/yr] ; pmdec [INPUT] proper motion in Dec [mas/yr] ; * PMRA,PMDEC must be scalars, ; or have the same size as CATRA,CATDEC ; newra [OUTPUT] new RA ; newdec [OUTPUT] new Dec ; * newRA, newDEC will have the same size as CATRA,CATDEC ; * default is to return decimal degrees ; * set keyword /OSXG to return the output in sexagesimal ; ;keywords ; catyr [INPUT] epoch of CATRA,CATDEC ; * default is 2000.0 ; newyr [INPUT] epoch for which to compute new coordinates ; * default is today ; verbose [INPUT] controls chatter ; i24 [INPUT] caught and passed on to SKYPOS's first run ; * use iff input are _not_ in decimal degrees ; osxg [INPUT] caught and passed on to SKYPOS's second run ; * use iff you want the output in sexagesimal ; _extra [INPUT ONLY] pass defined keywords to subroutines ; SKYPOS: HRS, IDNUM, IDPRE, IDFORM, PM, CHOP, OSEP ; ;requires ; SKYPOS [DEG2HRS [STR_2_ARR, SYZE]] ; ;history ; vinay kashyap (2014sep05) ;- ; usage ok='ok' & np=n_params() & nra=n_elements(catra) & ndec=n_elements(catdec) mra=n_elements(pmra) & mdec=n_elements(pmdec) if np lt 6 then ok='Insufficient parameters' else $ if nra eq 0 then ok='CATRA is undefined' else $ if ndec eq 0 then ok='CATDEC is undefined' else $ if nra ne ndec then ok='CATRA and CATDEC are not compatible' else $ if mra eq 0 then ok='PMRA is undefined' else $ if mdec eq 0 then ok='PMDEC is undefined' else $ if mra ne ndec then ok='PMRA and PMDEC are not compatible' else $ if mra ne 1 or mra ne nra then ok='PM* should be scalar or match CAT*' if ok ne 'ok' then begin print,'Usage: propermotion_corrector.catra,catdec,pmra,pmdec,newra,newdec,$' print,' catyr=catyr,newyr=newyr,verbose=verbose,$' print,' /i24,/osxg,/hrs,/idnum,/idpre,/idform,/pm,/chop,/osep' print,' computes new coordinates including proper motion' if np ne 0 then message,ok,/informational return endif ; regularize inputs rapm=dblarr(nra) & decpm=rapm if nra eq 1 then begin & rapm[0]=pmra[0] & decpm[0]=pmdec[0] & endif if nra gt 1 and mra eq 1 then begin & rapm[*]=pmra[0] & decpm[*]=pmdec[0] & endif if nra gt 1 and mra gt 1 then begin & rapm=pmra & decpm=pmdec & endif ; keywords vv=0L & if keyword_set(verbose) then vv=long(verbose[0])>1L catepoch=fltarr(nra)+2000.0 if keyword_set(catyr) then begin ncyr=n_elements(catyr) if ncyr eq 1 then catepoch[*]=float(catyr[0]) if ncyr gt 1 then catepoch[0:(nra