00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 static const char docstring[] =
00011 "smoothsphere: smooth a projected sphere with a kernel\n"
00012 "\n"
00013 " [y,s,p]=smoothsphere(x,geom,k,kparam,kwt,bws)\n"
00014 " * Given a solar image of location given by `geom', smooth it\n"
00015 " using the radially-symmetric kernel `k'.\n"
00016 " * This version is threaded, using 8 threads by default.\n"
00017 " Set MXT_NUM_THREADS in the environment to lower this number.\n"
00018 " * Off-disk values are indicated by NaN in the output.\n"
00019 " * The kernel used is dependent only on the weighted distance\n"
00020 " between two positions, say P1 and P2, in three-dimensional\n"
00021 " coordinates, normalized to live on the unit sphere:\n"
00022 " d = P1 - P2\n"
00023 " dist = d' W d (>= 0)\n"
00024 " for a diagonal weight matrix W.\n"
00025 " The kernel values are specified for values of \"dist\" taken\n"
00026 " from a linear range from 0 to kparam(1). Given a certain\n"
00027 " value of \"dist\" found between an image pixel and the kernel\n"
00028 " center, the associated weight is interpolated linearly using\n"
00029 " the table. If dot > kparam(1), a zero weight is used.\n"
00030 " * The diagonal portion of the distance weight matrix W may be\n"
00031 " supplied as a triple kwt. This weights distances between\n"
00032 " P1 and P2 in the x, y, and z directions respectively. The\n"
00033 " P-angle (rotation in the x-y plane) is taken into account in\n"
00034 " this weighting, so that y is cross-track, and x and z are\n"
00035 " always along-track.\n"
00036 " * Typically the kernel falls to zero rather quickly. As a\n"
00037 " computational shortcut, it is assumed that the kernel extends\n"
00038 " only kparam(2) pixels on each side of its center. For W = I,\n"
00039 " this implies that an \"on\" pixel in x extends to influence at\n"
00040 " most a \"swath\" 2*kparam(2)+1 pixels on a side. Both the P-angle\n"
00041 " and the W matrix are taken into account in finding the swath.\n"
00042 " For instance, a W_y > 1 will cause the y portion of the swath\n"
00043 " to shrink, because distance decreases faster. The swath is\n"
00044 " always parallel to the (i,j) image axes, so P-angles not a\n"
00045 " multiple of 90 degrees will cause the swath to be enlarged\n"
00046 " to contain a rotated rectangle.\n"
00047 " * To decrease computational load, nearby pixels may be grouped\n"
00048 " into meta-pixels called blocks. This is especially trouble-free\n"
00049 " away from the limb, where local geometry is nearly planar, so\n"
00050 " the blocking is given as a table that depends on z (in [0,1]).\n"
00051 " A row in the table of (z,bw) means: above the value z, use\n"
00052 " a blocking of bw (>1). For z=0 to bws(1,1), no blocking is used.\n"
00053 " * For example, the small-image default means to use single pixels\n"
00054 " below 0.4, 2x2 blocks above 0.4, and 4x4 above 0.6. For typical\n"
00055 " MDI images, this is 16%, 20%, and 64% of on-disk pixels, respectively.\n"
00056 " Using block sizes that do not pack together is legal, but causes\n"
00057 " inefficiency due to poor fits between abutting blocks; diagnose\n"
00058 " bad packing with the p output.\n"
00059 " * Supply bws=[] to treat all pixels singly (turn off blocking).\n"
00060 " * The optional output s is the z-coordinate (in [0,R]).\n"
00061 " The optional p output is the block (patch) number of each\n"
00062 " pixel.\n"
00063 "\n"
00064 " Inputs:\n"
00065 " real x[m,n];\n"
00066 " real geom[5]; -- [x0 y0 rsun b0 p0]\n"
00067 " real k[p];\n"
00068 " real kparam[2]; -- [top window]\n"
00069 " opt real kwt = [1 1 1];\n"
00070 " opt real bws[bwnum,2] = [0.4 2;0.6 4]; -- m < 2048\n"
00071 " = [0.3 2;0.5 4; 0.7 8]; -- m >= 2048\n"
00072 "\n"
00073 " Outputs:\n"
00074 " real y[m,n];\n"
00075 " opt real s[m,n];\n"
00076 " opt int p[m,n];\n"
00077 "\n"
00078 " See also:\n"
00079 "\n"
00080 " implemented as a mex file\n"
00081 "\n"
00082 "";
00083
00084
00085