Program: GALMOD Purpose: Making model observations of the HI gas in a spiral galaxy. Category: MODELS File: galmod.f Author: F.J. Sicking Keywords: INSET= Set to copy the coordinate system from. Usually a set with observations for which a model is wanted. Maximum number of subsets is 2048. BOX= Area of operation. [entire subsets of INSET] May exceed size of subsets of INSET. The subsets in outset will have this size. OUTSET= Set to contain the model. POS= Central position of galaxy. VSYS= Systemic velocity in (km/s). [0.0] RADII= Radii of rings in (arcsec). The first ring is the inner boundary of the model. The outer boundary will be the radius of the last ring. (The rings given here are interpolated to rings with a much smaller separation. EMPTY= Leave innerpart of first ring empty ? [Y] (Only asked if the radius of the first ring is not equal to zero.) If EMPTY=N galmod makes additional rings inside the first ring. It keeps all the parameters for these additional rings fixed at their values for the first ring. If for a keyword to specify a `ring property' (such as VROT=) there are less values present than the number of rings, for the remaining outward rings, the value for the keyword is kept fixed at its last specification. For example: a constant inclination of 80 degrees can be specified by INCL=80.0. VROT= Circular velocities of rings in (km/s). VDISP= To incorporate the velocity dispersion and the instrumental broadening in the model in (km/s). See description. DENS= Surface density of the HI in the rings in (HI-atoms per cm2). Z0= Scaleheights of the HI-layer in (arcsec). NRESTR= Number of rings inside first specification of the inclination and position angle. [0] The first specification of inclination an position angle is assigned to the (nrestr+1)th specification in RADII=. For the first NRESTR rings the inclination and position angle are kept constant at their first specification. The keyword NRESTR makes specifying a large central disk with fixed inclination and position angle (as in a spiral galaxy with an HI layer that is warped in its outer parts) easier. INCL= Inclinations of rings in (degrees). PA= Position angles of rings in (degrees). Measured counter clock- wise from the north. LTYPE= Layertype. The density profile in the direction perpendicular to the plane of the rings. [list options] Option 1: gaussian layer. 2: sech2 layer. 3: exponential layer. 4: Lorentzian layer. 5: box layer. CMODE= Determines the dependence of the number of clouds on the surface density of the HI. [1] The discretization noise in the maps made by galmod is proportional to the square root of the number of random signal contributions added into a pixel in the data cube times the amount of signal per contribution. With this keyword the latter can be influenced. If CMODE=0 then CDENS= is interpreted as the number of clouds per area of a pixel in the plane of the rings. In this case the amount of signal per cloud is proportional to the surface density of the HI gas in the plane of the ring. The discretization noise in the channel maps then becomes proportional to the surface density of the HI in the plane of the rings. It is however also proportional to the square root of the number of contibutions added into each pixel which is dependent on the distribution of the signal from the ring over the data cube. If CMODE=1, the default, the amount of signal per cloud is constant. In this case the discretization noise in the maps is proportional to the square root of the signal. This is the only case where the dependence of the discretization noise on the signal is not ambiguous and known. Therefore this is the default and strongly recommended. If CMODE=2 then the amount of signal per cloud is inversly proportional to the surface density of the HI gas. In this case the discretization noise is independent on the surface density of the HI in the plane of the rings but still on the distribution of the signal over the data cube. This option can be used if the surface density of the HI very strongly varies between the rings. CDENS= Surface density of clouds in the plane of the rings per area of a pixel. [1] The discretization noise in the maps is amongst others inversly proportional to the square root of this number. The way CDENS is interpreted depends CMODE= but it is always in units of 1E20 HI atoms per cm^2. NV= Number of subclouds in the velocity profile of a single `cloud'. [number of subsets] ** ISEED= Number to initialize the random number generator [-1]. A negative integer may be specified here to initialize the random number generator. Choosing a different number gives a different sequence of random numbers. (For example, the discretization noise in the maps made by galmod can be found from the difference between two identical models with distinct random number sequences.) Description: Galmod was originally developed by T.S. van Albada. This is a version for GIPSY under UNIX. It makes a model consisting of rings of different radii. The gas is assumed to be on circular orbits on these rings. Each ring is characterized by the following properties: a circular velocity, a velocity dispersion, a column density, a scaleheight perpendicular to the plane of the ring, an inclination and a position angle. This kind of model is often called a tilted ring model. First the routine 'regrids' the rings supplied by user to `standard' rings with a width of 0.75 times the minimum of the pixelsizes in each direction. Making the model, the routine basically does a Monte Carlo integration of the distribution of the HI-gas in space and velocity over each pixel in the datacube. Proceeding as follows: A loop is done over all the standard rings and each ring is filled with a number of HI 'clouds' at random positions. Their azimuths are randomly chosen from the interval [0,2*pi>. Their radii too, within the width of the current `standard' ring, but from a distribution of random numbers that is proportional with radius, to obtain a uniform distribution of clouds inside the plane of the ring. Finally, their heights above the plane are chosen from a distribution with the same shape and width as the density profile in this direction. which allows modelling of a gas layer with thickness. From the position of the cloud its systematic velocity, due to the combination of systemic motion and rotation, is calculated. Around this systematic velocity a velocity profile is built. For this purpose the cloud is divided into NV= subclouds and each of these is assigned a velocity which is the sum of the systematic velocity and a random contribution drawn from a gaussian distribution with a width (dispersion) equal to the value given at VDISP= which is closely related to the velocity dispersion. Now, having obtained a position and a velocity, the routine calculates the corresponding pixel in the data, does the (frequency dependent) conversion of HI column density to 21cm radiation flux per pixel and adds the (sub)cloud to the data. The `beam' resulting from this process is the pixel in the data cube. This is not as in real observations where pixels are only to sample the the data. Consequently, the quantity in the maps becomes flux per pixel expressed in W.U.. To smooth the maps to a real observational beam they have to be convolved. To do this the task SMOOTH could be used. As convolving function a gaussian could be used. Its FWHMs along the axes of the maps should be: CONBEAM = SQRT( beam%^2 - fwhm^2 * cdelt%^2 / 12 ) (The percent sign denotes the axis number.) The value for CONPOSANG depends on which of the values is the largest which will be taken as major axis of CONBEAM. The scale factor should be: SCALE = 2*pi*(beam1/fwhm)*(beam2/fwhm) / (cdelt1*cdelt2) (fwhm = conversion from dispersion to FWHM = 2.354820045) Basically, this process is equivalent to approximating a pixel with a gaussian with the same normalization and dispersion. This introduces errors which however will not be large if the beam is large (twice) compared to the pixel. The quantity in the maps remains flux per beam. The choice of the value of VDISP should be such that VDISP^2 + chwidth^2 / 12 = sig_instr^2 + sig_v^2 VDISP = The value for the keyword VDISP. chwidth = Velocity width of the channel maps. sig_instr = The dispersion of the instrumental broadening. sig_v = Velocity dispersion of the random motions of the HI gas. Usually Hanning smoothing has been applied, and then the instrumental profile can be approximated very well by a gaussian with a FWHM of twice the channnel separation. (If no Hanning smoothing has been done the instrumental profile is a sinc function with a FWHM of 1.2 times the channel speration. Galmod can not model this sinc function.) It may be convenient to first make a rough model with small values for CDENS and NV to check if the result of galmod will be satisfactory. Warning: An observed radial HI-profile is already convolved with the observational beam. So if it is not deconvolved before using GALMOD the resulting radial HI profile will be convolved twice. Note: Galmod uses a random number generator and a function to get random gaussian deviates drawn from: Press, Flannery, Teukolsky and Vetterling, Numerical Recipes. Updates: Dec -- 1992 : Document created. Oct -- 1993 : Some changes in the code: Better handling of the coordinate system. Avoiding unnecessary calculations if a small box is used. Better noise distribution. Added keyword CMODE. Aug -- 1994 : Corrected distribution of clouds inside radii, changed keywords PHI and INC into PA and INCL to match with other gipsy tasks.