Skip to content

Commit 57eed00

Browse files
authored
Merge pull request #4 from pyobs/develop
v1.1
2 parents 4d44b4c + 632e037 commit 57eed00

File tree

7 files changed

+185
-125
lines changed

7 files changed

+185
-125
lines changed

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
pyobs-archive
2-
=============
1+
# pyobs-archive
32

43
A webservice for an archive for astronomical images. Implements most of the interfaces
54
defined by [Las Cumbres Observatory](https://developers.lco.global/#archive).
65

7-
Quick start
8-
-----------
6+
## Quick start
7+
98

109
Create a docker-compose.yaml:
1110

@@ -52,8 +51,8 @@ that must be used when sending new images:
5251

5352
Now you can open a browser at http://localhost:8000/ and log in to the homepage.
5453

55-
Development environment
56-
-----------------------
54+
## Development environment
55+
5756
For development, it might be easier to not use Docker. In that case, create a
5857
pyobs_archive/local_settings.py and override settings in the settings.py, like this:
5958

@@ -72,10 +71,19 @@ pyobs_archive/local_settings.py and override settings in the settings.py, like t
7271
ARCHIVE_ROOT = '/opt/pyobs/data/'
7372
PATH_FORMATTER = '{SITEID}/{TELID}/{INSTRUME}/'
7473
FILENAME_FORMATTER = None,
74+
75+
76+
## Changelog
77+
78+
#### version 1.0 (2020-11-23)
79+
- Initial release
80+
81+
#### version 1.1
82+
- Added footer to page
7583

7684

77-
Used packages
78-
-------------
85+
## Used packages
86+
7987
The following packages are used in this project.
8088

8189
Python:

pyobs_archive/api/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def ingest(filename):
183183
root = settings.ARCHIVE_ROOT
184184

185185
# open file
186+
log.info('Opening new file to ingest...')
186187
fits_file = fits.open(filename)
187188

188189
# get path for archive
@@ -194,6 +195,7 @@ def ingest(filename):
194195
else:
195196
tmp = os.path.basename(fits_file['SCI'].header['FNAME'])
196197
name = tmp[:tmp.find('.')] if '.' in tmp else tmp
198+
log.info('Formatted filename to %s.', name)
197199

198200
# create new filename and set it in header
199201
out_filename = name + '.fits.fz'
@@ -210,6 +212,7 @@ def ingest(filename):
210212
img.add_fits_header(fits_file['SCI'].header)
211213

212214
# write to database
215+
log.info('Writing to database...')
213216
img.save()
214217

215218
# link related
@@ -222,6 +225,7 @@ def ingest(filename):
222225

223226
# write FITS file to byte stream and close
224227
with io.BytesIO() as bio:
228+
log.info('Writing file...')
225229
fits_file.writeto(bio)
226230
fits_file.close()
227231

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
@font-face {
22
font-family: 'Alegreya';
3-
src:
4-
local('Alegreya'),
5-
local('Alegreya-Regular'),
6-
url('../fonts/Alegreya-Regular.ttf');
3+
src: local('Alegreya'),
4+
local('Alegreya-Regular'),
5+
url('../fonts/Alegreya-Regular.ttf');
76
font-weight: normal;
87
font-style: normal;
98
}
109

1110
@font-face {
1211
font-family: 'Alegreya';
13-
src:
14-
local('Alegreya-Bold'),
15-
url('../fonts/Alegreya-Bold.ttf');
12+
src: local('Alegreya-Bold'),
13+
url('../fonts/Alegreya-Bold.ttf');
1614
font-weight: bold;
1715
font-style: normal;
1816
}
1917

2018
@font-face {
2119
font-family: 'Roboto';
22-
src:
23-
local('Roboto')
24-
local('Roboto-Regular'),
25-
url('../admin/fonts/Roboto-Bold.ttf');
20+
src: local('Roboto') local('Roboto-Regular'),
21+
url('../admin/fonts/Roboto-Bold.ttf');
2622
font-weight: bold;
2723
font-style: normal;
2824
}
2925

26+
html, body {
27+
height: 100%;
28+
}
29+
3030
body {
3131
font-family: 'Roboto', serif;
3232
}
@@ -35,8 +35,14 @@ h1, h2, h3, h4, h5, h6, th, nav, label {
3535
font-family: 'Alegreya', serif;
3636
}
3737

38+
#wrap {
39+
min-height: 100%;
40+
}
41+
3842
#main {
39-
margin-top: 70px;
43+
margin-top: 20px;
44+
overflow: auto;
45+
padding-bottom: 50px; /* this needs to be bigger than footer height*/
4046
}
4147

4248
.datetext {
@@ -49,18 +55,39 @@ h1, h2, h3, h4, h5, h6, th, nav, label {
4955
width: 100%;
5056
}
5157

52-
.no-js #loader { display: none; }
53-
.js #loader { display: block; position: absolute; left: 100px; top: 0; }
58+
.no-js #loader {
59+
display: none;
60+
}
61+
62+
.js #loader {
63+
display: block;
64+
position: absolute;
65+
left: 100px;
66+
top: 0;
67+
}
68+
5469
.loading {
55-
position: fixed;
56-
left: 0;
57-
top: 0;
58-
width: 100%;
59-
height: 100%;
60-
z-index: 9999;
61-
background: url('../img/ajax-loader.gif') center no-repeat #fff;
70+
position: fixed;
71+
left: 0;
72+
top: 0;
73+
width: 100%;
74+
height: 100%;
75+
z-index: 9999;
76+
background: url('../img/ajax-loader.gif') center no-repeat #fff;
6277
}
6378

6479
table {
6580
font-size: small;
66-
}
81+
}
82+
83+
footer {
84+
background-color: black;
85+
color: grey;
86+
text-align: center;
87+
position: relative;
88+
margin-top: -40px; /* negative value of footer height */
89+
height: 40px;
90+
clear: both;
91+
padding-top: 0.5em;
92+
font-size: smaller;
93+
}

0 commit comments

Comments
 (0)