Next: cw-data-analysis, Previous: condor-jobs, Up: Directory Index [Contents][Index]
convert degrees in the format "deg:min:sec.xx" into radians
rads = dms_to_rad ( "10:11:12.345" ); rads0 = (10 + 11/60 + 12.345/3600)*pi/180; assert ( rads, rads0, eps ); [sig, dd,mm,ss] = rad_to_dms ( rads ); assert ( sig, 1 ); assert ( dd, 10 ); assert ( mm, 11 ); assert ( ss, 12.345, 1e5*eps );
rads = dms_to_rad ( "-10:11:12.345" ); rads0 = -(10 + 11/60 + 12.345/3600)*pi/180; assert ( rads, rads0, eps ); [sig, dd,mm,ss] = rad_to_dms ( rads ); assert (sig, -1 ); assert ( dd, 10 ); assert ( mm, 11 ); assert ( ss, 12.345, 1e5*eps );
rads = dms_to_rad ( "-0:11:12.345" ); rads0 = -(11/60 + 12.345/3600)*pi/180; assert ( rads, rads0, eps ); [sig, dd,mm,ss] = rad_to_dms ( rads ); assert ( sig, -1 ); assert ( dd, 0 ); assert ( mm, 11 ); assert ( ss, 12.345, 1e5*eps );
Convert GPS times to UTC date strings (using LAL functions)
cell array of UTC date strings (or a single string)
matrix of GPS times
try lal; lalpulsar; catch disp("skipping test: LALSuite bindings not available"); return; end_try_catch assert(strcmp(gps_to_utc(800000000), "13-May-2005 06:13:07"));
convert an "hour:minute:second.xxx" string into radians
rads = hms_to_rad ( "10:11:12.345" ); rads0 = (10 + 11/60 + 12.345/3600)*pi/12; assert ( rads, rads0, eps ); [hh, mm, ss] = rad_to_hms ( rads ); assert ( hh, 10 ); assert ( mm, 11 ); assert ( ss, 12.345, 1e4*eps );
rads = hms_to_rad ( "0:11:12.345" ); rads0 = (11/60 + 12.345/3600)*pi/12; assert ( rads, rads0, eps ); [hh, mm, ss] = rad_to_hms ( rads ); assert ( hh, 0 ); assert ( mm, 11 ); assert ( ss, 12.345, 1e4*eps );
convert MJD (based on TDB) into GPS seconds
translated from LAL-function LALTDBMJDtoGPS()
in BinaryPulsarTiming.c
assert(MJDtt_to_GPS(45123), 75945548.816, 1e-6)
assert(MJDtt_to_GPS(123456), 6843916748.816, 1e-6)
convert MJD (based on TT) into GPS seconds
translated from LAL-function LALTTMJDtoGPS()
in BinaryPulsarTiming.c
assert(MJDtt_to_GPS(45123), 75945548.816, 1e-6)
assert(MJDtt_to_GPS(123456), 6843916748.816, 1e-6)
convert MJD (based on UTC) into GPS seconds
translated from lalapps-CVS/src/pulsar/TDS_isolated/TargetedPulsars.c
This conversion corresponds to what lalapps_tconvert
does, but
is NOT the right thing for pulsar timing, as pulsar-epochs are typically
given in MJD(TDB) ! ==> use MJDtdb_to_GPS.m for that purpose!
assert(MJDutc_to_GPS(45123), 75945613, 1e-6)
assert(MJDutc_to_GPS(123456), 6843916813, 1e-6)
convert radians ’rads’ into degrees "<sig>degs:minutes:secs", where <sig> is either +1 or -1
rads = dms_to_rad ( "10:11:12.345" ); [sig, dd,mm,ss] = rad_to_dms ( rads ); assert ( sig, 1 ); assert ( dd, 10 ); assert ( mm, 11 ); assert ( ss, 12.345, 1e5*eps );
rads = dms_to_rad ( "-10:11:12.345" ); [sig, dd,mm,ss] = rad_to_dms ( rads ); assert (sig, -1 ); assert ( dd, 10 ); assert ( mm, 11 ); assert ( ss, 12.345, 1e5*eps );
rads = dms_to_rad ( "-0:11:12.345" ); [sig, dd,mm,ss] = rad_to_dms ( rads ); assert ( sig, -1 ); assert ( dd, 0 ); assert ( mm, 11 ); assert ( ss, 12.345, 1e5*eps );
convert radians into hours:minutes:seconds format
rads = hms_to_rad ( "10:11:12.345" ); [hh, mm, ss] = rad_to_hms ( rads ); assert ( hh, 10 ); assert ( mm, 11 ); assert ( ss, 12.345, 1e4*eps );
rads = hms_to_rad ( "0:11:12.345" ); [hh, mm, ss] = rad_to_hms ( rads ); assert ( hh, 0 ); assert ( mm, 11 ); assert ( ss, 12.345, 1e4*eps );
Convert UTC date strings to GPS times (using LAL functions)
matrix of GPS times (integer seconds)
matrix of GPS times (nanoseconds)
cell array of UTC date strings
try lal; lalpulsar; catch disp("skipping test: LALSuite bindings not available"); return; end_try_catch assert(utc_to_gps("13-May-2005 06:13:07") == 800000000); [s, ns] = utc_to_gps("2011-04-24T04:25:06.123456789"); assert(s == 987654321 && ns == 123456789);
Next: cw-data-analysis, Previous: condor-jobs, Up: Directory Index [Contents][Index]