Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Application:Geo
rnxcmp
gpscal
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gpscal of Package rnxcmp
# # c-shell script # GPS calendar created by Hatanaka Y. 1995.3.14 # modified by Hatanaka Y. 1996.7.20 # 1999.2.18 fix bug of GPS week for January, 1980 # if ($#argv != 2 )then echo Usage : $0 mm yyyy echo 'this month ...' set mm = `date '+%m'` set yyyy = `date '+%Y'` else if($1 < 1 || $1 > 12 || $2 > 2099 || $2 < 1980) then echo input parameters : out of range echo ' mm = (1-12)' echo ' yyyy = (1980-2099)' exit else set mm = $1 set yyyy = $2 endif #--------------------------------------------------------------- # calculate DOY(day of year) of yyyy/mm/00 #--------------------------------------------------------------- set num_of_days = ( 31 28 31 30 31 30 31 31 30 31 30 31 ) if ( $yyyy % 4 == 0 ) set num_of_days[2] = 29 set i = 1; set doy = 0 while ($i < $mm) @ doy += $num_of_days[$i]; @ i++ end #--------------------------------------------------------------- # calculate GPS week of yyyy/mm/01 #--------------------------------------------------------------- set dd = 1 set mm2 = $mm set yy = $yyyy if( $mm2 <= 2 ) then @ yy-- @ mm2 += 12 endif @ jd = (36525 * $yy) / 100 + (306001 * ($mm2 + 1)) / 10000 + $dd + 1720981 @ week = ($jd - 2444237) / 7 - 1 #--------------------------------------------------------------- # print calender #--------------------------------------------------------------- cal $mm $yyyy |awk 'BEGIN {doy='"$doy"'; week='"$week"';\ getline;\ printf(" %s\n",$0);\ printf("Week Sun Mon Tue Wed Thu Fri Sat\n")}\ $1 == 1 {printf("%0.4d ",week);\ for(i=7;i>NF;i--)printf(" ");\ for (i=1;i<=NF;i++) printf(" %2d",$i);\ printf("\n");\ printf(" ");\ for(i=7;i>NF;i--) printf(" ");\ for (i=1;i<=NF;i++) printf(" %0.3d",$i+doy);\ printf("\n")}\ $1 > 1 && $1~/^[0-9]/{week++;printf("%0.4d ",week);\ for (i=1;i<=NF;i++) printf(" %2d",$i);\ printf("\n");\ printf(" ");\ for (i=1;i<=NF;i++) printf(" %0.3d",$i+doy);\ printf("\n")}'
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor