forked from ericmandel/js9
-
Notifications
You must be signed in to change notification settings - Fork 1
/
js9large.html
executable file
·190 lines (178 loc) · 7.66 KB
/
js9large.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http:https://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" >
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type="image/x-icon" rel="shortcut icon" href="./favicon.ico">
<link type="text/css" rel="stylesheet" href="js9support.css">
<link type="text/css" rel="stylesheet" href="js9.css">
<script type="text/javascript" src="js9prefs.js"></script>
<script type="text/javascript">
// example of overridding default parameters
JS9Prefs = JS9Prefs || {globalOpts: {}};
JS9Prefs.globalOpts.table = {xdim: 1024, ydim: 1024, bin: 1};
JS9Prefs.globalOpts.image = {xdim: 1024, ydim: 1024, bin: 1};
</script>
<script type="text/javascript" src="js9support.min.js"></script>
<script type="text/javascript" src="js9.min.js"></script>
<script type="text/javascript" src="js9plugins.js"></script>
<title>JS9 large file support</title>
</head>
<body>
<center><font size="+1">
<b>JS9 Large: dealing with large FITS files</b>
</font></center>
<table cellspacing="10">
<tr>
<td colspan="2">
JS9 deals with large files through the <b>fits2fits</b> mechanism
and use of <b>representation files</b>.
A brief explanation of is given below. See <a href="./help/repfile.html">Dealing with Large Files</a> for more details.
</td>
</tr>
<tr valign="top">
<td>
<div class="JS9Menubar"></div>
<div class="JS9"></div>
<div style="margin-top: 2px;">
<div class="JS9Colorbar"></div>
</div>
</td>
<td>
<table cellspacing="0">
<tr>
<td>
<table cellspacing="0">
<tr>
<td>
Always use fits2fits to<br>
make a rep file:
<ul>
<li> <a href='javascript:JS9.Load("fits/nicmos.fits", {fits2fits:true});'>Multi-extension file</a>
<li> <a href='javascript:JS9.Load("fits/jupiter_cube.fits", {fits2fits:"always"});'>Jupiter Cube data</a>
<li> <a href='javascript:JS9.Load("fits/casa.fits", {colormap:"heat", scale: "log", fits2fits:"always"});'>Chandra Cas-A table</a>
<li> <a href='javascript:JS9.Load("fits/d1000.fits", {colormap:"heat", fits2fits: "always"});'>1000x1000 image</a>
</ul>
</td>
<td>
Never use fits2fits,<br>
original file in memory:
<ul>
<li> <a href='javascript:JS9.Load("fits/nicmos.fits", {fits2fits:false});'>Multi-extension file</a>
<li> <a href='javascript:JS9.Load("fits/jupiter_cube.fits", {fits2fits:"never"});'>Jupiter Cube data</a>
<li> <a href='javascript:JS9.Load("fits/casa.fits.gz", {colormap:"cool", scale:"log", fits2fits:"never"});'>Chandra Cas-A table</a>
<li> <a href='javascript:JS9.Load("fits/i1000.fits", {colormap:"cool", fits2fits: "never"});'>1000x1000 image</a>
</ul>
</td>
<td>
fits2fits based on size,<br>
rep file if orig > 100Mb:
<ul>
<li> <a href='javascript:JS9.Load("large/pn_101_clean.fits", {colormap:"heat"});'>XMM table (50Mb)</a>
<li> <a href='javascript:JS9.Load("large/pn_201_clean.fits", {colormap:"cool"});'>XMM table (101Mb)</a>
<li> <a href='javascript:JS9.Load("large/f814w.fits.gz", {colormap:"grey", scale: "log", onload: function(im){im.setScale(0,100); im.setColormap(6.56,0.04);}});'>Hubble image (300Mb)</a>
<li> <a href='javascript:JS9.Load("large/f814w_bin24.fits.gz", {colormap:"grey", scale: "log", parentFile: "large/f814w.fits.gz", onload: function(im){im.setScale(0,100); im.setColormap(6.56,0.04);}});'>small Hubble w/parentFile</a>
</ul>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table cellspacing="2">
<tr>
<td>
<div class="JS9Panner" data-width="200" data-height="200"></div>
</td>
<td>
<div class="JS9Magnifier" data-width="200" data-height="200"></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div class="FITSBinning" data-js9id="JS9"></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
Large astronomical <a href="http:https://fits.gsfc.nasa.gov">FITS</a>
data files present a challenge for browser-based image display in two ways:
<ul>
<li> downloading large files can take a long time, even on the fastest connections
<li> browsers enforce hard (usually per-tab) memory limits.
</ul>
<p>
JS9 deals with large files through the <b>fits2fits</b> mechanism
and use of small <b>representation files</b>.
You first need to configure a Node.js-based
<a href="helper.html" target="_blank">Server-side Helper</a>.
Then set the following global parameter in your js9Prefs.json file:
<ul>
<li><b>globalOpts.fits2fits</b> # when/how to generate FITS representation files
</ul>
This property controls whether a FITS representation file is
automatically generated. It accepts the following values:
<ul>
<li><b>always</b>: always generate a FITS representation file
<li><b>never</b>: never generate a FITS representation file
<li><b>size>N</b>: generate a representation file is this file's size is greater than N Mb
</ul>
The current default for <b>fits2fits</b> is "size>100", which means that
representation files will be generated if the original FITS file has a size
greater than 100 Mb (assuming, of course, that the JS9 helper is set up.)
<p>
Once <b>fit2fits</b> is configured, JS9 will ask the JS9 helper to
check the <b>fits2fits</b> rule when loading a FITS URL. If the check
returns false, the FITS file will be loaded internally into JS9. If
true, the JS9 helper will extract a representation image (section) from the
parent file, store it in the temporary work directory, and then tell JS9 to
display the representation file.
<p>
The smaller in-memory representation file will be used when performing
browser-based analysis such as WCS reprojection, 3D plots, and
imexam. But the representation file knows its parent, and will send
the parent filename to server-side analysis tasks. Thus JS9 performs
quick-look analysis on the smaller file and more detailed server-side
analysis on the original parent file.
<p>
In this context, perhaps the most important server-side task is
the <b>Bin/Filter/Section</b> plugin available in the <b>View</b>
menu. This plugin allows you to extract sections from FITS binary
tables and images, with options to choose the image center, image
dimensions, and bin factor. (For tables, the plugin also allows you to
filter rows of the table by means of arithmetic and boolean operations
on the table columns.)
</td>
</tr>
</table>
JS9 Demos:
<ul>
<li><a href='js9basics.html'>JS9 Demo: the basics</a>
<li><a href='js9bespoke.html'>JS9 Demo: web page control of JS9</a>
<li><a href='js9sizes.html'>JS9 Demo: setting the size of the JS9 display</a>
<li><a href='js9plugins.html'>JS9 Demo: adding plugins to JS9</a>
<li><a href='js9imexam.html'>JS9 Demo: the imexam plugin for JS9</a>
<li><a href='js9blend.html'>JS9 Demo: image blending</a>
<li><a href='js9cat.html'>JS9 Demo: overlaying catalogs</a>
<li><a href='js9panzoom.html'>JS9 Demo: pan and zoom</a>
<li><a href='js9rgb.html'>JS9 Demo: RGB composite images</a>
<li><a href='js9multi.html'>JS9 Demo: independent instances of JS9</a>
<li><a href='js9analysis.html'>JS9 Demo: remote data analysis</a>
<li><a href='js9onchange.html'>JS9 Demo: running tasks when a region changes</a>
<li><a href='js9create.html'>JS9 Demo: creating a JS9 instance dynamically</a>
<li><a href='js9preload.html'>JS9 Demo: preloading images into JS9</a>
<li><a href='js9bitpix.html'>JS9 Demo: displaying different FITS datatypes</a>
<li><a href='js9allinone.html'>JS9 Demo: using the all-in-one files</a>
<li><a href='js9pngvsfits.html'>JS9 Demo: PNG representation files vs FITS files</a>
</ul>
</body>
</html>