00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 static const char docstring[] =
00011 "savefitsa: save array as file in FITS format\n"
00012 "\n"
00013 " error = savefitsa(array, file, bitpix, bscale, bzero, blank)\n"
00014 " * array is a d-dimensional real-valued array; it is written in\n"
00015 " natural Matlab/Fortran order to filename. (The transposed\n"
00016 " version is just \"savefits\".)\n"
00017 " * filename is silently overwritten if it exists.\n"
00018 " * bitpix must belong to {8,16,32,64,-32,-64}; negative numbers imply\n"
00019 " floating-point FITS output, 8 is *unsigned* character, and 16, 32,\n"
00020 " 64 are signed integers.\n"
00021 " * bscale and bzero are most useful when integers are written.\n"
00022 " Whenever they are supplied, the value actually written to the file,\n"
00023 " which must belong to the corresponding range, is:\n"
00024 " (array - bzero) / bscale\n"
00025 " Therefore, unsigned integers may be written using bscale = 1\n"
00026 " and bzero = 2^15, 2^31, etc.\n"
00027 " * blank is the value of the blank flag to be used in the FITS file.\n"
00028 " A blank will be inserted when an IEEE NaN is encountered in\n"
00029 " the image input. This will be turned back into a NaN by a FITS\n"
00030 " reader.\n"
00031 " * If the blank is supplied as zero, a standard default is used:\n"
00032 " bitpix=8 --> blank = 255; 16 --> -32768; 32 --> -2^31; 64 -> -2^52.\n"
00033 " (The last is the largest double-precision integer.) This\n"
00034 " practice is recommended.\n"
00035 " * If the matrix contains NaNs, and bitpix belongs to {8,16,32,64},\n"
00036 " the blank argument must be given. In this case, there\n"
00037 " could be a conflict between of the legitimate integer codings\n"
00038 " and its use as a blank flag. Of course, whatever value of blank\n"
00039 " is used, the image must not contain any value such that\n"
00040 " (array - bzero)/bscale == blank, or it too will be interpreted\n"
00041 " as a NaN.\n"
00042 " * Note that the blank argument is the value put into the FITS\n"
00043 " file, not in the original image. It is not translated using\n"
00044 " bscale and bzero.\n"
00045 " * Error is 1 if there was an error, 0 otherwise. An error\n"
00046 " synopsis is printed if error = 1.\n"
00047 "\n"
00048 " Inputs:\n"
00049 " real array image;\n"
00050 " string filename;\n"
00051 " opt int bitpix = -64;\n"
00052 " opt real bscale = 1;\n"
00053 " opt real bzero = 0;\n"
00054 " opt real blank = {255,-32768,-2^31,-2^52}; -- unused if bitpix<0\n"
00055 "\n"
00056 " Outputs:\n"
00057 " int error;\n"
00058 "\n"
00059 " See Also: loadfitsa, savefits\n"
00060 "\n"
00061 " implemented as a MEX file.\n"
00062 " turmon, rewritten, aug 2002\n"
00063 " turmon, updated for 64-bit matlab, 4/2010\n"
00064 " if the transposition routine is in an available library,\n"
00065 " you can get the transposed behavior by defining FITS_TRANSPOSE_MODE\n"
00066 " at compile time.\n"
00067 "\n"
00068 "";
00069
00070
00071