Department of Advanced Science and Technology
University of Computer Studies
B.C.Sc/B.C.Tech. ( Third Year)
Computer Organization
Mid Tearm Examination
Advanced Java Programming (CS-306)
Zone III
Answer ALL Questions
Time allowed 3hours.
(viii) Write the Clent Code.
| Name | |
| NRC | |
| Phone No | |
| FROM | |
| TO | |
|
Ordinary Class
First Class Upeer Class |
|
| Quantity | |
| Date | |
Figure 1
| String ticket[][]= {{"Yangon", "Mandalay","5000","7000", "9000"}, |
| {"Mandalay","Yangon","5000","7000","9000"}, |
| {"Taungoo", "Thahton","3000","4500","6000"}, |
| {"Thaton", "Taungoo", "3000", "4500", "6000"}}; |
| From | To | Ordinary Class | First Class | Upper Class |
|---|---|---|---|---|
| Yangon | Mandalay | 5000 | 7000 | 9000 |
| Mandalay | Yangon | 5000 | 7000 | 9000 |
| Taungo | Thahton | 3000 | 4500 | 6000 |
| Thahton | Taungoo | 3000 | 4500 | 6000 |
| Name | Daw Aye Aye Lwin |
| NRC | 14/YGN 001476 |
| Phone No | To Mandalay |
| From Yangon | To Mandalay |
| Date | 7/4/2017 |
Total price is 18000 kyats for 2 tickets.
Figure 3
7 is odd number.
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
If user selects the "Withdraw" button, the program checks the balance is enougn or not in the database. If the balance is enougn, program updates and displays the final balance with user name as shown in Figure 9, otherwise as shown in Figure 10.

Figure 10


Apply artifial intelligence in many fields such as smart medical and smart home.
Click the icon for detailed project.
Interested both traditional digital image processing and image processing using machine learning.
Click the icon for projects.
As a starter, I also have enormous passion for this fabulous world.
Click the icon for projects.
email
<EMAIL_ADDRESS>phone
+1<PHONE_NUMBER>
Instagram
ittlepearl33


| purge {renv} | R Documentation |
Purge packages from the cache. This can be useful if a package which had previously been installed in the cache has become corrupted or unusable, and needs to be reinstalled.
purge(package, ..., version = NULL, hash = NULL, prompt = interactive())
package |
A single package to be removed from the cache. |
... |
Unused arguments, reserved for future expansion. If any arguments
are matched to |
version |
The package version to be removed. When |
hash |
The specific hashes to be removed. When |
prompt |
Boolean; prompt the user before taking any action? Note that
|
purge()
is an inherently destructive option. It removes packages from the
cache, and so any project which had symlinked that package into its own
project library would find that package now unavailable. These projects would
hence need to reinstall any purged packages. Take heed of this in case you're
looking to purge the cache of a package which is difficult to install, or
if the original sources for that package are no longer available!
The set of packages removed from the renv
global cache,
as a character vector of file paths.
## Not run: # remove all versions of 'digest' from the cache renv::purge("digest") # remove only a particular version of 'digest' from the cache renv::purge("digest", version = "0.6.19") ## End(Not run)


Yogi
This is Yogi. He was 4 months old in this photo. I was out trying to find a rabbit to photograph, but ended up getting some great shots of him instead!
!-- Twitter Cards - Ref: https://davidwalsh.name/twitter-cards -->
I am currently in second semester of the Interactive Media Development program at Confederation College In Thunder Bay,ON. I was born and raised in this beautiful city. I originally started the IMD program with the intent of becoming a photographer. As I progressed, I realized that I am very interested in Web Development, Graphic Design, and Audio/Video as well! Stay tuned to watch my talents unfold as I make my way through this amazing adventure we call school!
This is a picture of one of my assigments for Graphic Design. I used Photoshop to create a "Jeep Ad".
This is a screen shot of my Interactive Game Prototype. I drew the character and backgrounds in Adobe Illustrator, I did the animations in Adobe Animate, and to finish it I am making it interactive with HTML and CreateJS.
This is a photo edit I did in Phototshop.
This is Yogi. He was 4 months old in this photo. I was out trying to find a rabbit to photograph, but ended up getting some great shots of him instead!
He's so photogenic!
This was one of my first photoshoots in first semester. Fall 2018, Thunder Bay, ON.
I was after shadows this day. I love the leading lines in this photo! It took many tries to get the angle I wanted.
This is Leila. She has also been a great subject for photoshoots. She's so sweet!


My Favorites
Favorites let you save results and label them for easy recall. To use:
- Sign In first
- Click the pushpin next to the title to save to My Favorites
- To view My Favorites, click the pushpin in the upper right menu
- Use the "...Send To" options to export to other formats and reference managers.
- Organize your results by adding labels. For example, frequently used databases:
Saved Searches
You can save searches to run again later, or to set alerts to be notified via email when new records are available.
Saved search alerts are most effective when combined with filters, such as material type(s), date range, and availability.
After doing a search...
- Sign In first
- Click the Save Search pin at the top of the results list.
- You'll receive a prompt to optionally set a notifcation for email alerts
- To return to your saved searches, click the pushpin icon in the upper right corner (same as for My Favorites)
- Alerts can be enabled or disabled by selecting the bell icon
Search History
Your search history is saved during your session as long as you keep the browser tab open. Sign In first to have your search history saved to your My Favorites account.


Thank You for completing the test, Here are Your results
Your Personality type is ENFJ
The personality test is based on Myers-Briggs Type Indicator (MBTI)
ENFJs are idealist organizers, driven to implement their vision of what is best for humanity. They often act as catalysts for human growth because of their ability to see potential in other people and their charisma in persuading others to their ideas. They are focused on values and vision, and are passionate about the possibilities for people.
ENFJs are typically energetic and driven, and often have a lot on their plates. They are tuned into the needs of others and acutely aware of human suffering; however, they also tend to be optimistic and forward-thinking, intuitively seeing opportunity for improvement. The ENFJ is ambitious, but their ambition is not self-serving: rather, they feel personally responsible for making the world a better place.


Getting Started
Building and Running KLEE
The current procedure for building KLEE with LLVM 2.9 (stable) is outlined below.
If you want to build KLEE with LLVM 3.4 (experimental), click here.
-
Install dependencies: KLEE requires all the dependencies of LLVM, which are discussed here. In particular, you should have the following packages (the list is likely not complete): g++, curl, dejagnu, subversion, bison, flex, bc, libcap-dev(el):
$ sudo apt-get install g++ curl dejagnu subversion bison flex bc libcap-dev # Ubuntu $ sudo yum install g++ curl dejagnu subversion bison flex bc libcap-devel # Fedora
On some architectures, you might also need to set the following environment variables (best to put them in a config file like .bashrc):
$ export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu $ export CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
-
Build LLVM 2.9: KLEE is built on top of LLVM; the first steps are to get a working LLVM installation. See Getting Started with the LLVM System for more information.
NOTE: The only LLVM version currently supported by KLEE is LLVM 2.9. KLEE is currently tested on Linux x86-64, and might break on x86-32. KLEE will not compile with LLVM versions prior to 2.9, and there is only experimental support for LLVM 3.4.
- Install llvm-gcc:
- Download and install the LLVM 2.9 release of llvm-gcc from here. On an x86-64 Linux platform you are going to need the archive LLVM-GCC 4.2 Front End Binaries for Linux x86-64.
- Add llvm-gcc to your PATH. It is important to do this first so that llvm-gcc is found in subsequent configure steps. llvm-gcc will be used later to compile programs that KLEE can execute. Forgetting to add llvm-gcc to your PATH at this point is by far the most common source of build errors reported by new users.
-
Download and build LLVM 2.9:
$ tar zxvf llvm-2.9.tgz $ cd llvm-2.9 $ ./configure --enable-optimized --enable-assertions $ make
The
--enable-optimized
configure argument is not necessary, but KLEE runs very slowly in Debug mode. You may run into compilation issues if you use new kernels/glibc versions. Please see this mailing list post for details on how to fix this issue.
- Install llvm-gcc:
-
Build STP: The default version of KLEE uses the STP constraint solver. We recommend downloading the version at this link, which we have tested and used successfully, but you can download a more recent revision from the STP website if you prefer. Please let us know if you have successfully and extensively used KLEE with a more recent version of STP.
$ tar xzfv stp-r940.tgz $ cd stp-r940 $ ./scripts/configure --with-prefix=`pwd`/install --with-cryptominisat2 $ make OPTIMIZE=-O2 CFLAGS_M32= install
As documented on the STP website, it is essential to run the following command before using STP (and thus KLEE):
$ ulimit -s unlimited
You can make this persistent by updating the
/etc/security/limits.conf
file.If you encounter build errors with the r940 version, you have to modify the STP code according to this commit (the files to modify in r940 are CVC.y, smtlib.y and smtlib2.y in src/parser/).
-
(Optional) Build uclibc and the POSIX environment model: By default, KLEE works on closed programs (programs that don’t use any external code such as C library functions). However, if you want to use KLEE to run real programs you will want to enable the KLEE POSIX runtime, which is built on top of the uClibc C library.
- Download KLEE’s uClibc. KLEE uses a version of uClibc which has been modified slightly for our purposes.
-
Build uClibc with llvm-gcc:
$ tar zxvf klee-uclibc-0.02.tgz $ ./configure --with-llvm=path-to-llvm $ make
NOTE: If you are on a different target (i.e., not i386 or x64), you will need to run make config and select the correct target. The defaults for the other uClibc configuration variables should be fine.
-
Download KLEE:
$ git clone https://github.com/klee/klee.git
-
Configure KLEE: From the KLEE source directory, run:
$ ./configure --with-llvm=full-path-to-llvm --with-stp=full-path-to-stp/install --with-uclibc=full-path-to-klee-uclibc --enable-posix-runtime
NOTE: If you skipped step 4, simply remove the
--with-uclibc
and--enable-posix-runtime
options. -
Build KLEE:
$ make ENABLE_OPTIMIZED=1
-
Run the regression suite to verify your build:
$ make check $ make unittests
NOTE: For testing real applications (e.g. Coreutils), you may need to increase your system’s open file limit (ulimit -n). Something between 10000 and 999999 should work. In most cases, the hard limit will have to be increased first, so it is best to directly edit the
/etc/security/limits.conf
file. -
You’re ready to go! Check the Tutorials page to try KLEE.


HexEdit Pro stores the name and other information about all files that you have opened. You can also see the top few entries in this list in Recently Opened Files entries of the File menu.
You can resize the dialog if you want to see more or less of the list.
List of Recently Opened Files
Most of the dialog is taken up with the list which shows all of your recently opened files. The list is split into (up to) 9 columns (described below). You can show and hide any of the columns by right-clicking any column heading and selecting from the list. You can also resize any of the columns by dragging the separator (the vertical line between the column headings), or double-click the separator to size the column to the width of the widest item.
By default the files appear in the order they were opened, with the most recent at the top, but you can sort on any column by clicking on the column header. Click the same column header again to reverse the order.
To select a file to open or remove from the list just click anywhere on its row. You can select more than one entry by shift-clicking to select a contiguous group or by control-clicking to select or deselect individual entries. The number of files currently selected is shown in the Selected count underneath the Remove button.
The columns of the list are:
|
Column |
Description |
|
File Name |
The name of the file (excluding path information which is shown in the Location column). |
|
Location |
This is the folder (directory) in which the file is located. |
|
Last Opened |
This is when you last opened the file in HexEdit Pro. This is not to be confused with the time of last access (see below) stored by the file system. |
|
Size |
This is the size of the file on disk. |
|
Type |
This is a brief description of the file (based on the file extension) according to Windows. |
|
Modified |
This is when the file was last modified according to the filesystem. This will be similar to the last opened time if you last changed the file in HexEdit Pro. |
|
Attributes |
Shows the characters: R (read-only), A (archived), H (hidden), S (system) which are flags stored by the file system (see File Properties Page for more info) |
|
Created |
This is when the file was created according to Windows. For FAT filesystems this may not be stored and may be the same as Modified time (above). |
|
Accessed |
This is when the file was last accessed according to Windows. For FAT filesystems this may not be stored and may be the same as Modified time (above). |
|
Category |
A category can be associated with every file (see File Summary Page). It is useful to categorize files so you can sort by this column. |
|
Keywords |
One or more keywords associated with the file. |
|
Comments |
Any other free-form text to be associated with the file. |
.
Open
Clicking this button opens all selected files and closes the dialog. If there is no file selected in the list then this button is disabled. You can also double-click an entry in the list to open just that file.
Open read-only
This is the same as the Open button except that the file(s) are opened in read-only mode.
Close/Save
This closes the dialog. If items have been deleted (using the Validate or Remove buttons) then this button changes to Save and selecting the button removes the items from the list.
X
Select the Close button in the top-right corner to close the dialog without making any changes. Any items removed from the list using the Validate or Remove button are not removed from the list.
Remove
This removes all selected files from the recently opened files list. Of course, the files themselves are not deleted or affected in any way.
Note that this also loses formatting (font, the number of columns/offset/grouping, autofit, decimal addresses etc), display (window position, hex/char area display), editing (RO/RW and OVR/INS modes) and other information (highlights, mark etc) associated with the file(s). (This information is stored with the entry for each recently opened file.) However, bookmarks for the file(s) are retained.
Validate All
Use this to check the validity of the files in the recently use list. If a file is not found on disk then it is removed from the list.
Keep network and removeable files
When validating you may not want to remove files from the list if they are not currently available. For example, a file may reside on removeable media (floppies, zip disks, CDs, DVDs etc) or on a network drive that is not always available. When this check-box is on and the Validate All option is used only files on fixed local drives will ever be removed from the list (if not found).
Search
Allows searching all fields of the list (case-insensitive). All items found are selected.
Help
Click the Help button to display this information in the on-line help.


Register
Name should only consists of alphabets and/or spaces
Mobile number should be of 10 digits and start from 7/8/9
Invalid E-MAIL
Please enter your address
Password must contain at least 6 characters, including UPPER/lowercase and numbers.
Please enter the same password
Register


${head}
${title}
${body}
<#list sitemap.sections as section> <#if !section.name?starts_with("!")>
${section.name}
<#list section.entries as entry> <#if entry = page>
${entry.title}
<#else>
${entry.title}
#if> #list>
#if> #list>


--- layout: post title: Precompile Static HTML Pages with Rails 3 Asset Pipeline date: '2012-02-23T20:38:00.001-08:00' author: Rimas Silkaitis tags: - rails modified_time: '2012-02-23T20:51:44.719-08:00' blogger_id: tag:blogger.com,1999:blog-6201986.post-6792721175845825744 blogger_orig_url: http://neovintage.blogspot.com/2012/02/precompile-static-html-pages-with-rails.html ---
At CarWoo we recently upgraded all the way from Rails 2.3.8 to 3.2 and with that brought the asset pipeline. We probably could have skipped the asset pipeline but we figured we should throw in it for good measure. One of the problems that we ran into was including some of the compiled javascript and stylesheet files from the assets directory into our 404 and 500 error pages. In Rails 2.3, we just created static html pages and threw them in the public folder and didn't think about them ever again. Unfortunately, since the Rails 3 asset pipeline adds and MD5 hash to the js and css files names, statically linking them wasn't going to work.
I wish I could take credit for this, but the honorable @sshconnection recommended that we just precompile 404 and 500 pages as well. And wouldn't you know that, it was way easier than you think it could be.
First get your config in place:
Just like any Rails convention, add the extensions to want to use to precompile. In my case, I used erb in my 404 page:
This probably should be labelled as a quick tip, but it was a little a-ha moment for me and I figured I'd share it.


Continuous and discrete (count or categorical) estimation of density, probability mass function (p.m.f.) and regression functions are performed using associated kernels. The cross-validation technique and the local Bayesian procedure are also implemented for bandwidth selection.
| Version: | 1.0 |
| Published: | 2015-03-30 |
| Author: | W. E. Wansouwé, S. M. Somé and C. C. Kokonendji |
| Maintainer: | W. E. Wansouwé <ericwansouwe at gmail.com> |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| URL: | www.r-project.org |
| NeedsCompilation: | no |
| CRAN checks: | Ake results |
| Reference manual: | Ake.pdf |
| Package source: | Ake_1.0.tar.gz |
| Windows binaries: | r-devel: Ake_1.0.zip, r-release: Ake_1.0.zip, r-oldrel: Ake_1.0.zip |
| OS X binaries: | r-release: Ake_1.0.tgz, r-oldrel: Ake_1.0.tgz |
Please use the canonical form https://CRAN.R-project.org/package=Ake to link to this page.


Gareth Bale: Spanish press turn on Real Madrid forward – ‘Disrespectful. Misguided. Ungrateful. In that order’
Bale mocked the perception of himself in Spain during Wales’ celebrations after qualifying for Euro 2020
by Jack RathbornThe Madrid press have predictably come after Gareth Bale after the Real Madrid forward celebrated Wales’s qualification for Euro 2020 alongside a flag that read: “Wales. Golf. Madrid. In that order”.
Bale has long since had a frosty relationship with the Madrid-based press with constant speculation over his future.
While Bale will feel mistreated by the club after Zinedine Zidane overlooked him this year to push him towards the Bernabeu exit, he must surely have known how the images from Tuesday night would go down back in the Spanish capital.
Marca’s front page responded: “Disrespectful. Misguided. Ungrateful. In that order.”
While AS columnist Tomas Roncero did his own play on the flag, writing: “Out. Out. Out.”
AS also led with Bale’s relationship with Real on their front page, emphasising the flag incident was the last straw and that Real’s patience has run out.
But Bale appears comfortable for now, with a contract that runs until 2022, a January exit appears unlikely no matter the desire from Los Blancos to make it happen.
Real Madrid play Real Sociedad on Saturday, with Bale certain to receive a hostile reception from the Bernabeu crowd.


lingvo.base_runner module¶
Base class for all jobs.
-
class
lingvo.base_runner.
BaseRunner
(params, model_task_name, logdir, tf_master, trial=<lingvo.base_trial.NoOpTrial object>)[source]¶ Bases:
object
Base class for all jobs.
-
params
¶
-
classmethod
_GetTtlDir
(path, duration)[source]¶ Returns a path to a time-limited directory under dir if required.
-
_WriteSummaries
(summary_writer, job_name, global_step, summaries, text_filename=None)[source]¶ Construct the summary and write them to the summary writer.
Parameters: - summary_writer – The summary writer to use.
- job_name – The name of the job that tries to write this summary.
- global_step – The checkpoint used for eval is generated at this step.
- summaries – a dict from keys to
tf.Summary
protobuf messages. - text_filename – If not None, writes the summary to the text file.
-


| 005:081 Yusufali | : |
If only they had believed in Allah, in the Prophet, and in what hath been revealed to him, never would they have taken them for friends and protectors, but most of them are rebellious wrong-doers. |
| 005:082 Khan | : |
Verily, you will find the strongest among men in enmity to the believers (Muslims) the Jews and those who are Al-Mushrikun (see V.2:105), and you will find the nearest in love to the believers (Muslims) those who say: "We are Christians." That is because amongst them are priests and monks, and they are not proud. |
| 005:082 Maulana | : |
Thou wilt certainly find the most violent of people in enmity against the believers to be the Jews and the idolaters; and thou wilt find the nearest in friendship to the believers to be those who say, We are Christians. That is because there are priests and monks among them and because they are not proud. |
| 005:082 Pickthal | : |
Thou wilt find the most vehement of mankind in hostility to those who believe (to be) the Jews and the idolaters. And thou wilt find the nearest of them in affection to those who believe (to be) those who say: Lo! We are Christians. That is because there are among them priests and monks, and because they are not proud. |
| 005:082 Rashad | : |
You will find that the worst enemies of the believers are the Jews and the idol worshipers. And you will find that the closest people in friendship to the believers are those who say, "We are Christian." This is because they have priests and monks among them, and they are not arrogant. |
| 005:082 Shakir | : |
Certainly you will find the most violent of people in enmity for those who believe (to be) the Jews and those who are polytheists, and you will certainly find the nearest in friendship to those who believe (to be) those who say: We are Christians; this is because there are priests and monks among them and because they do not behave proudly. |
| 005:082 Sherali | : |
Thou shalt certainly find the Jews and those who associate partners with ALLAH to be the most vehement of men in enmity against the believers. And thou shalt assuredly find those who say, 'We are Christians,' to be the nearest of them in friendship to the believers. That is because among them are savants and monks and because they are not arrogant. |
| 005:082 Yusufali | : |
Strongest among men in enmity to the believers wilt thou find the Jews and Pagans; and nearest among them in love to the believers wilt thou find those who say, "We are Christians": because amongst these are men devoted to learning and men who have renounced the world, and they are not arrogant. |
Concepts/Themes Covered: أركان الإسلام > التوحيد > الكافرون > عداوة الكفار Pillars of Islam> Islamic> The Disbelievers> The Disbelievers' Hostility الديانات > بنو إسرائيل > إلقاء العداوة بينهم Religions>Children of Israel>Creating Hostility among them الديانات > بنو إسرائيل > حالاتهم Religions>Children of Israel>Their Status الديانات > بنو إسرائيل > عداوتهم لله و الملائكة و المؤمنين Religions>Children of Israel> Their Hostility against Allah, the Angels and the Believers الديانات > النصارى > الرهبان Religions>The Christians>The Priests الديانات > النصارى > القسيسون Religions>The Christians>The Priests الديانات > النصارى > مواقفهم Religions>The Christians>Their Stands
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


[Previous Routine] [Next Routine] [List of Routines]NAME TVLIST PURPOSE: Cursor controlled listing of image pixel values in a window. CALLING SEQUENCE: TVLIST, [image, dx, dy, TEXTOUT =, OFFSET = , ZOOM = ] OPTIONAL INPUTS: IMAGE - Array containing the image currently displayed on the TV. If omitted, the byte pixel intensities are read from the TV If the array does not start at position (0,0) on the window then the OFFSET keyword should be supplied. DX -Integer scalar giving the number of pixels in the X direction to be displayed. If omitted then DX = 18 for byte images, and DX = 14 for integer images. TVLIST will display REAL data with more significant figures if more room is availble to print. DY - Same as DX, but in Y direction. If omitted, then DY = DX OPTIONAL INPUT KEYWORDS: OFFSET - 2 element vector giving the location of the image pixel (0,0) on the window display. OFFSET can be positive (e.g if the image is centered in a larger window) or negative (e.g. if the only the central region of an image much larger than the window is being displayed. Default value is [0,0], or no offset. ZOOM - Scalar specifying the magnification of the window with respect to the image variable. Use, for example, if image has been REBINed before display. TEXTOUT - Optional keyword that determines output device. The following dev/file is opened for output. textout=1 TERMINAL using /more option (default) textout=2 TERMINAL without /more option textout=3.prt textout=4 laser.tmp textout=5 user must open file textout=7 Append to an existing .prt file if it exists textout = filename (default extension of .prt) If TEXTOUT > 3 or set to a filename, then TVLIST will prompt for a brief description to be included in the output file OUTPUTS: None. PROCEDURE: Program prompts user to place cursor on region of interest in image display. Corresponding region of image is then displayed at the terminal. A compression factor between the image array and the displayed image is determined using the ratio of image sizes. If necessary, TVLIST will divide all pixel values in a REAL*4 image by a (displayed) factor of 10^n (n=1,2,3...) to make a pretty format. SYSTEM VARIABLE: The nonstandard system variable !TEXTOUT is used as an alternative to the keyword TEXTOUT. The procedure ASTROLIB can be used to define !TEXTOUT (and !TEXTUNIT) if necessary. RESTRICTIONS: TVLIST may not be able to correctly format all pixel values if the dynamic range near the cursor position is very large. PROCEDURES CALLED: F_FORMAT(), UNZOOM_XY REVISION HISTORY: Written by rhc, SASC Tech, 3/14/86. Added textout keyword option, J. Isensee, July, 1990 Check for readable pixels W. Landsman May 1992 Use integer format statement from F_FORMAT W. Landsman Feb 1994 Added OFFSET, ZOOM keywords W. Landsman Mar 1996 More intelligent formatting of longword, call TEXTOPEN with /STDOUT W. Landsman April, 1996 Added check for valid dx value W. Landsman Mar 1997 Converted to IDL V5.0 W. Landsman September 1997 (See tvlist.pro)
T_APER
[Previous Routine] [Next Routine] [List of Routines]NAME: T_APER PURPOSE: Driver procedure (for APER) to compute concentric aperture photometry. EXPLANATION: Data is read from and written to disk FITS ASCII tables. Part of the IDL-DAOPHOT photometry sequence CALLING SEQUENCE: T_APER, image, fitsfile, [ apr, skyrad, badpix, PRINT=, NEWTABLE=, /SILENT, SETSKYVAL = ] INPUTS: IMAGE - input data array FITSFILE - disk FITS ASCII table name (from T_FIND). Must contain the keywords 'X' and 'Y' giving the centroid of the source positions in FORTRAN (first pixel is 1) convention. An extension of .fit is assumed if not supplied. OPTIONAL INPUTS: User will be prompted for the following parameters if not supplied. APR - Vector of up to 12 REAL photometry aperture radii. SKYRAD - Two element vector giving the inner and outer radii to be used for the sky annulus BADPIX - Two element vector giving the minimum and maximum value of a good pixel (Default [-32765,32767]) OPTIONAL KEYWORDS INPUTS: PRINT - if set and non-zero then NSTAR will also write its results to a file aper.prt. One can specify a different output file name by setting PRINT = 'filename'. SILENT - If this keyword is set and non-zero, then APER will not display photometry results at the screen, and the results will be automatically incorporated in the FITS table without prompting the user NEWTABLE - Name of output disk FITS ASCII table, scalar string. If not supplied, then the input FITSFILE will be updated with the aperture photometry results. SETSKYVAL - Use this keyword to force the sky to a specified value rather than have APER compute a sky value. SETSKYVAL can either be a scalar specifying the sky value to use for all sources, or a 3 element vector specifying the sky value, the sigma of the sky value, and the number of elements used to compute a sky value. The 3 element form of SETSKYVAL is needed for accurate error budgeting. PROMPTS: T_APER requires the number of photons per analog digital unit (PHPADU), so that it can compute Poisson noise statistics to assign photometry errors. It first tries to find the PHPADU keyword in the original image header, and if not found will look for the GAIN, CCDGAIN and finally ATODGAIN keywords. If still not found, T_APER will prompt the user for this value. PROCEDURES: APER, FTADDCOL, FTGET(), FTINFO, FTPUT, READFITS(), SXADDPAR, SXPAR(), WRITEFITS REVISON HISTORY: Written W. Landsman ST Systems Co. May 1988 Store results as flux or magnitude August 1988 Added SILENT keyword W. Landsman Sep. 1991 Changed ERR SKY to ERR_SKY W. Landsman March 1996 Replace TEXTOUT keyword with PRINT keyword W. Landsman May 1996 Check CCDGAIN or ATODGAIN keywords to find phpadu W. Landsman May 1997 Converted to IDL V5.0 W. Landsman September 1997(See t_aper.pro)
T_FIND
[Previous Routine] [Next Routine] [List of Routines]NAME: T_FIND PURPOSE: Driver procedure (for FIND) to locate stars in an image. EXPLANATION: Finds positive brightness perturbations (i.e stars) in a 2 dimensional image. Output is to a FITS ASCII table. CALLING SEQUENCE: T_FIND, image, im_hdr, [ fitsfile, hmin, fwhm, sharplim, roundlim, PRINT = , /SILENT ] INPUTS: image - 2 dimensional image array (integer or real) for which one wishes to identify the stars present im_hdr - FITS header associated with image array OPTIONAL INPUTS: T_FIND will prompt for these parameters if not supplied fitsfile - scalar string specifying the name of the output FITS ASCII table file fwhm - FWHM to be used in the convolving filter hmin - Threshold intensity for a point source - should generally be 3 or 4 sigma above background level sharplim - 2 element vector giving low and high Limit for sharpness statistic (Default: [0.2,1.0] ) roundlim - 2 element vector giving low and high Limit for roundness statistic (Default: [-1.0,1.0] ) OPTIONAL INPUT KEYWORDS: PRINT - if set and non-zero then NSTAR will also write its results to a file FIND.PRT. One can specify the output file name by setting PRINT = 'filename'. SILENT - If this keyword is set and non-zero, then FIND will work silently, and not display each star found OUTPUTS: None PROCEDURES CALLED: CHECK_FITS, FDECOMP, FIND, FTADDCOL, FTCREATE, SXADDHIST, SXADDPAR, SXDELPAR, SXPAR(), WRITEFITS REVISION HISTORY: Written W. Landsman, STX May, 1988 Added phpadu, J. Hill, STX, October, 1990 New calling syntax output to disk FITS table, W. Landsman May 1996 Work with more than 32767 stars W. Landsman August 1997 Converted to IDL V5.0 W. Landsman September 1997(See t_find.pro)
T_GETPSF
[Previous Routine] [Next Routine] [List of Routines]NAME: T_GETPSF PURPOSE: Driver procedure (for GETPSF) to generate a PSF from isolate stars. EXPLANATION: Generates a point-spread function from one or more isolated stars. List of stars is read from the FITS ASCII table output of T_APER. PSF is represented as a sum of a Gaussian plus residuals. Ouput residuals are written to a FITS image file. CALLING SEQUENCE: T_GETPSF, image, fitsfile, [ idpsf, psfrad, fitrad, psfname, /DEBUG, NEWTABLE =] INPUTS: IMAGE - image array FITSFILE - scalar string giving name of disk FITS ASCII table. Must contain the keywords 'X','Y' (from T_FIND) and 'AP1_MAG','SKY' (from T_APER). OPTIONAL INPUTS: IDPSF - vector of stellar ID indices indicating which stars are to be used to create the PSF. Not that the PSF star should be specified *not* by its STAR_ID value, but rather by the its row number (starting with 0) in the FITS table PSFRAD - the radius for which the PSF will be defined FITRAD - fitting radius, always smaller than PSFRAD PSFNAME - name of FITS image file to contain PSF residuals, scalar string GETPSF will prompt for all the above values if not supplied. OPTIONAL KEYWORD INPUT NEWTABLE - scalar string specifying the name of the output FITS ASCII table. If not supplied, then the input table is updated with the keyword PSF_CODE, specifying which stars were used for the PSF. DEBUG - if this keyword is set and non-zero, then the result of each fitting iteration will be displayed. PROMPTS: T_GETPSF will prompt for the readout noise (in data numbers), and the gain (in photons or electrons per data number) so that pixels can be weighted during the PSF fit. To avoid the prompt, add the keywords RONOIS and PHPADU to the FITS ASCII table header. PROCEDURES USED: FTADDCOL, FTGET(), FTPUT, GETPSF, READFITS(), SXADDHIST, SXADDPAR, SXPAR(), WRITEFITS, ZPARCHECK REVISION HISTORY: Written W. Landsman STX May, 1988 Update PSF_CODE to indicate PSF stars in order used, W. Landsman Mar 96 I/O to FITS ASCII disk files W. Landsman May 96 Converted to IDL V5.0 W. Landsman September 1997(See t_getpsf.pro)
T_GROUP
[Previous Routine] [Next Routine] [List of Routines]NAME: T_GROUP PURPOSE: Driver procedure (for GROUP) to place stars in non-overlapping groups. EXPLANATION: This procedure is part of the DAOPHOT sequence that places star positions with non-overlapping PSFs into distinct groups Input and output are to FITS ASCII tables CALLING SEQUENCE: T_GROUP, fitsfile, [ rmax, XPAR = , YPAR = , NEWTABLE = ] INPUTS: FITSFILE - Name of disk FITS ASCII table containing the X,Y positions in FITS (FORTRAN) convention (first pixel is 1,1) OPTIONAL INPUTS: rmax - maximum allowable distance between stars in a single group OPTIONAL INPUT KEYWORDS: XPAR, YPAR - scalar strings giving the field name in the output table containing the X and Y coordinates. If not supplied, then the fields 'X' and 'Y' are read. NEWTABLE - scalar giving name of output disk FITS ASCII table. If not supplied, PROCEDURES: FTADDCOL, FTGET(), FTINFO, FTPUT, GROUP, READFITS(), SXADDHIST, SXADDHIST, WRITEFITS REVISION HISTORY: Written, W. Landsman STX Co. May, 1996 Converted to IDL V5.0 W. Landsman September 1997(See t_group.pro)
T_NSTAR
[Previous Routine] [Next Routine] [List of Routines]NAME: T_NSTAR PURPOSE: Driver procedure (for NSTAR) for simultaneous PSF fitting. EXPLANATION: Input and output are to disk FITS ASCII tables. CALLING SEQUENCE: T_NSTAR, image, fitsfile, [psfname, groupsel, /SILENT, /PRINT NEWTABLE = , /VARSKY ] INPUTS: IMAGE - 2-d image array FITSFILE - scalar string giving name of disk FITS ASCII table. Must contain the keywords 'X','Y' (from T_FIND) 'AP1_MAG','SKY' (from T_APER) and 'GROUP_ID' (from T_GROUP). This table will be updated with the results of T_NSTAR, unless the keyword NEWTABLE is supplied. OPTIONAL INPUTS: PSFNAME - Name of the FITS file created by T_GETPSF containing PSF residuals, scalar string GROUPSEL - Scalar or vector listing the groups to process. For example, to process stars in groups 2 and 5 set GROUPSEL = [2,5]. If omitted, or set equal to -1, then NSTAR will process all groups. OPTIONAL KEYWORD INPUTS: VARSKY - If this keyword is set and non-zero, then the mean sky level in each group of stars, will be fit along with the brightness and positions. SILENT - if set and non-zero, then NSTAR will not display its results at the terminal PRINT - if set and non-zero then NSTAR will also write its results to a file NSTAR.PRT. One can specify the output file name by setting PRINT = 'filename'. NEWTABLE - Name of output disk FITS ASCII table to contain the results of NSTAR. If not supplied, then the input FITSFILE will be updated. DEBUG - if this keyword is set and non-zero, then the result of each fitting iteration will be displayed. PROCEDURES CALLED: FTADDCAL, FTINFO, FTGET(), FTPUT, NSTAR, SXADDHIST, SXADDPAR, SXPAR(), READFITS(), WRITEFITS REVISION HISTORY: Written W. Landsman STX Co. May, 1988 Check for CCDGAIN, ATODGAIN keywords to get PHPADU W. Landsman May 1997 Fixed typo preventing compilation, groupsel parameter W.L. July 1997 Converted to IDL V5.0 W. Landsman September 1997(See t_nstar.pro)
T_SUBSTAR
[Previous Routine] [Next Routine] [List of Routines]NAME: T_SUBSTAR PURPOSE: Driver procedure (for SUBSTAR) to subtract scaled PSF values EXPLANATION: Computes residuals of the PSF fitting program CALLING SEQUENCE: T_SUBSTAR, image, fitsfile, id,[ psfname, /VERBOSE, /NOPSF ] INPUT-OUTPUT: IMAGE - On input, IMAGE is the original image array. A scaled PSF will be subtracted from IMAGE at specified star positions. Make a copy of IMAGE before calling SUBSTAR, if you want to keep a copy of the unsubtracted image array INPUTS: FITSFILE - scalar string giving the name of the disk FITS ASCII produced as an output from T_NSTAR. OPTIONAL INPUTS: ID - Index vector indicating which stars are to be subtracted. If omitted, (or set equal to -1), then stars will be subtracted at all positions specified by the X and Y vectors. (IDL convention - zero-based subscripts) PSFNAME - Name of the FITS file containing the PSF residuals, as generated by GETPSF. SUBSTAR will prompt for this parameter if not supplied. OPTIONAL INPUT KEYWORD: VERBOSE - If this keyword is set and non-zero, then the value of each star number will be displayed as it is processed. NOPSF - if this keyword is set and non-zero, then all stars will be be subtracted *except* those used to determine the PSF. An improved PSF can then be derived from the subtracted image. If NOPSF is supplied, then the ID parameter is ignored NOTES: T_SUBSTAR does not modify the input FITS table. PROCEDURES USED: FTGET(), READFITS(), SUBSTAR REVISION HISTORY: Written, R. Hill, ST Sys. Corp., 22 August 1991 Added NOPSF keyword W. Landsman March, 1996 Use FITS format for PSF resduals July, 1997 Converted to IDL V5.0 W. Landsman September 1997(See t_substar.pro)
UNZOOM_XY
[Previous Routine] [Next Routine] [List of Routines]NAME: UNZOOM_XY PURPOSE: Converts X, Y position on the image display to the the X,Y position on the corresponding image array. (These positions are identical only for an unroamed, unzoomed image with with pixel (0,0) of the image placed at position (0,0) on the TV.) CALLING SEQUENCE: UNZoom_XY, Xtv,Ytv,Xim,Yim, [ OFFSET =, ZOOM = ] INPUTS: XTV - Scalar or vector giving X position(s) as read on the image display (e.g. with CURSOR,XTV,YTV,/DEVICE) XTV - Scalar or vector giving Y position(s) on the image display. If only 2 parameters are supplied then XTV and YTV will be modfied on output to contain the image array coordinates. OPTIONAL KEYWORD INPUT: OFFSET - 2 element vector giving the location of the image pixel (0,0) on the window display. OFFSET can be positive (e.g if the image is centered in a larger window) or negative (e.g. if the only the central region of an image much larger than the window is being displayed. Default value is [0,0], or no offset. OUTPUTS: XIM,YIM - X and Y coordinates of the image corresponding to the cursor position on the TV display. NOTES: The integer value of a pixel is assumed to refer to the *center* of a pixel. REVISON HISTORY: Adapted from MOUSSE procedure W. Landsman March 1996 Converted to IDL V5.0 W. Landsman September 1997(See unzoom_xy.pro)
UVBYBETA
[Previous Routine] [Next Routine] [List of Routines]NAME: UVBYBETA PURPOSE: Derive dereddened colors, metallicity, and Teff from Stromgren colors. EXPLANATION: Adapted from FORTRAN routine of same name published by T.T. Moon, Communications of University of London Observatory, No. 78. Can be used either interactively or called from a main procedure. CALLING SEQUENCE: uvbybeta ;Prompt for all parameters uvbybeta,by,m1,c1,beta,n ;Supply inputs, print outputs uvbybeta, by, m1, c1, beta, n, name, Te, Mv, Eby, delm0, radius, [ TEXTOUT= ] INPUTS: by - Stromgren b-y color, scalar m1 - Stromgren line-blanketing parameter, scalar c1 - Stromgren Balmer discontinuity parameter, scalar beta - H-beta line strength index.  Used only when writing to disk for identification purposes. OPTIONAL INPUT KEYWORD: TEXTOUT Used to determine output device. If not present, the value of !TEXTOUT system variable is used (see TEXTOPEN) textout=1 Terminal with /MORE textout=2 Terminal without /MORE textout=3 uvbybeta.prt (output file) textout=4 Laser Printer textout=5 User must open file textout=7 Append to existing uvbybeta.prt file textout = filename (default extension of .prt) OPTIONAL OUTPUTS: Te - approximate effective temperature MV - absolute visible magnitude Eby - Color excess b-y delm0 - metallicity index, delta m0, may not be calculable for early B stars. radius - Stellar radius (R/R(solar)) SYSTEM VARIABLES: If keyword textout not used, the non-standard system variable !TEXTOUT becomes the output device indicator. Set !TEXTOUT =3 to have results directed to a file UVBYBETA.PRT If all output parameters were supplied, then type TEXTCLOSE to close this file REVISION HISTORY: W. Landsman IDL coding February, 1988 Keyword textout added, J. Isensee, July, 1990 Made some constants floating point. W. Landsman April, 1994 Converted to IDL V5.0 W. Landsman September 1997(See uvbybeta.pro)
VACTOAIR
[Previous Routine] [Next Routine] [List of Routines]NAME: VACTOAIR PURPOSE: Convert vacuum wavelengths to air wavelengths EXPLANATION: Corrects for the index of refraction of air under standard conditions. Wavelength values below 2000 A will not be altered. Accurate to about 0.005 A CALLING SEQUENCE: VACTOAIR, WAVE INPUT/OUTPUT: WAVE - Wavelength in Angstroms, scalar or vector WAVE should be input as vacuum wavelength(s), it will be returned as air wavelength(s). WAVE is always converted to double precision EXAMPLE: If the vacuum wavelength is W = 2000, then IDL> VACTOAIR, W yields an air wavelength of W = 1999.353 Angstroms METHOD: An approximation to the 4th power of inverse wavenumber is used See IUE Image Processing Manual Page 6-15. REVISION HISTORY Written, D. Lindler 1982 Documentation W. Landsman Feb. 1989 Converted to IDL V5.0 W. Landsman September 1997(See vactoair.pro)
VALID_NUM
[Previous Routine] [Next Routine] [List of Routines]Project : SOHO - CDS Name : VALID_NUM() Purpose : Check if a string is a valid number representation. Explanation : The input string is parsed for characters that may possibly form a valid number. It is more robust than simply checking for an IDL conversion error because that allows strings such as '22.3qwert' to be returned as the valid number 22.3 See also the original NUM_CHK which returns the status in the opposite sense. Use : IDL> status = valid_num(string [,value] [,/integer]) Inputs : string - the string to be tested Opt. Inputs : None Outputs : The function returns 1 for valid, 0 for invalid number Opt. Outputs: value - The value the string decodes to. This will be returned as a double precision number unless /INTEGER is present, in which case a long integer is returned. Keywords : Integer - if present code checks specfically for an integer. Calls : None Restrictions: None Side effects: None Category : Utilities, Numerical Prev. Hist. : Small changes from NUM_CHK by Andrew Bowen, Tessella Support Services, 8/3/93 Written : CDS version by C D Pike, RAL, 24-May-93 Modified : Version 1, C D Pike, RAL, 24-May-93 Version 2, William Thompson, GSFC, 14 October 1994 Added optional output parameter VALUE to allow VALID_NUM to replace STRNUMBER in FITS routines. Version : Version 1 24-May-93 Converted to IDL V5.0 W. Landsman September 1997(See valid_num.pro)
VECT
[Previous Routine] [Next Routine] [List of Routines]NAME: VECT PURPOSE: Print a set of numbers as a string with delimiters included EXPLANATION: This function returns the given vector in parenthesized coordinates as in the form (X,Y). No limit on the number of dimensions. Also note that the vector does not need to be numbers. It may also be a string vector. e.g. ['X','Y'] CALLING SEQEUNCE: tmp = VECT( vctr, [ form, FORMAT = , DELIM = ] ) INPUT: VCTR The vector to be displayed e.g. [56,44] OPTIONAL KEYWORD INPUT: FORMAT This KEYWORD allows the specification of a format for the elements. e.g.: VECT([2,3],format='(f7.1)') gives '(2.0,3.0)' DELIM This KEYWORD specifies the delimeter. The default is ',' but other useful examples might be ', ' or ':' OPTIONAL INPUT FORM This parameter may be used instead of the keyword FORMAT OUTPUT: tmp A returned string of the parenthesized vector Other Procedures/Functions Called: STRN HISTORY: 03-JUL-90 Version 1 written by Eric W. Deutsch 24-AUG-91 Format='' keyword added (E. Deutsch) 29-AUG-91 FORM parameter added (E. Deutsch) Converted to IDL V5.0 W. Landsman September 1997(See vect.pro)
WCSSPH2XY
[Previous Routine] [Next Routine] [List of Routines]NAME: WCSSPH2XY PURPOSE: Convert spherical coordinates to x and y (map) angular coordinates EXPLANATION: Convert spherical (longitude and latitude -- sky) coordinates to x and y (map) angular coordinates. This procedure is the inverse of WCSXY2SPH. See WCS_DEMO for example of use. CATEGORY: Mapping and Auxilliary FITS Routine CALLING SEQUENCE: wcssph2xy, longitude, latitude, x, y, [ map_type , CTYPE = , FACE =,PROJP1 = , PROJP2= , CRVAL = , CRXY = , LONGPOLE = , NORTH_OFFSET =, SOUTH_OFFSET =, BADINDEX =] INPUT PARAMETERS: longitude - longitude of data, scalar or vector, in degrees latitude - latitude of data, same number of elements as longitude, in degrees map_type - optional positional parameter, numeric scalar (0-25) corresponding to a particular map projection. This is not a FITS standard, it is simply put in to allow function similar to that of less general map projection procedures (eg AITOFF). The following list gives the map projection types and their respective numbers. FITS Number Name Comments code code ---- ------ ----------------------- ----------------------------------- DEF 0 Default = Cartesian AZP 1 Zenithal perspective projp1 required TAN 2 Gnomic AZP w/ projp1 = 0 SIN 3 Orthographic AZP w/ projp1 = Infinity (>10^14) STG 4 Stereographic AZP w/ projp1 = 1 ARC 5 Zenithal Equidistant ZPN 6 Zenithal polynomial prop1-projp9 required, useless ZEA 7 Zenithal equal area AIR 8 Airy projp1 required CYP 9 Cylindrical perspective projp1 and projp2 required CAR 10 Cartesian MER 11 Mercator CEA 12 Cylindrical equal area projp1 required COP 13 Conical perspective projp1 and projp2 required COD 14 Conical equidistant projp1 and projp2 required COE 15 Conical equal area projp1 and projp2 required COO 16 Conical orthomorphic projp1 and projp2 required BON 17 Bonne's equal area projp1 required PCO 18 Polyconic GLS 19 Sinusoidal PAR 20 Parabolic AIT 21 Hammer-Aitoff MOL 22 Mollweide CSC 23 Cobe Quadrilateralized convergence of inverse is poor Spherical Cube QSC 24 Quadrilateralized Spherical Cube TSC 25 Tangential Spherical Cube OPTIONAL INPUT KEYWORD PARAMETERS: CTYPE - One, two, or three element vector containing 8 character strings corresponding to the CTYPE1, CTYPE2, and CTYPE3 FITS keywords: CTYPE(0) - first four characters specify standard system ('RA--','GLON' or 'ELON' for right ascension, Galactic longitude or ecliptic longitude respectively), second four letters specify the type of map projection (eg '-AIT' for Aitoff projection) CTYPE(1) - first four characters specify standard system ('DEC-','GLAT' or 'ELAT' for declination, galactic latitude or ecliptic latitude respectively; these must match the appropriate system of ctype1), second four letters of ctype2 must match second four letters of ctype1. CTYPE(2) - if present must be the 8 character string,'CUBEFACE', only used for spherical cube projections to identify an axis as containing the face on which each x and y pair of coordinates lie. PROJP1 - scalar with first projection parameter, this may or may not be necessary depending on the map projection used PROJP2 - scalar with second projection parameter, this may or may not be necessary depending on the map projection used CRVAL - 2 element vector containing standard system coordinates (the longitude and latitude) of the reference point CRXY - 2 element vector giving the x and y coordinates of the reference point, if this is not set the offset is [0,0] This is not a FITS standard -- it is similar to CRPIX but in angular X,Y coordinates (degrees) rather than pixel coordinates LONGPOLE - native longitude of standard system's North Pole, default is 180 degrees NORTH_OFFSET - offset (radians) added to input points near north pole. SOUTH_OFFSET - offset (radians) added to input points near south pole. BADINDEX - vector, list of transformed points too close to poles. OUTPUT PARAMETERS: x - x coordinate of data, same number of elements as longitude, in degrees; if CRXY is set, then x will be returned offset by crxy(0). NOTE: x in all map projections increases to the left, not the right. y - y coordinate of data, same number of elements as longitude, in degrees; if CRXY is set, y will be returned offset by crxy(1) bad - vector returning index to transformed points close to pole. OPTIONAL OUTPUT KEYWORD PARAMETERS: FACE - a output variable used for spherical cube projections to designate the face of the cube on which the x and y coordinates lie. Will contain the same number of elements as X and Y. Must contain at least 1 arbitary element on input If FACE is NOT defined on input, it is assumed that the spherical cube projection is laid out over the whole sky in the "sideways T" configuration. NOTES: The conventions followed here are described in more detail in "Representations of Celestial Coordinates in FITS" by Eric Greisen and Mark Calabretta (draft dated August 24, 1993). The general scheme outlined in that article is to first use WCS_ROTATE to convert coordinates in one of three standard systems (celestial, galactic, or ecliptic) into a "native system" of latitude and longitude. The latitude and longitude are then converted into x and y coordinates which depend on the map projection which is performed. The rotation from standard to native coordinates can be skipped if one so desires. This procedure necessitates two basic sections. The first converts "standard" coordinates to "native" coordinates while the second converts "native" coordinates to x and y coordinates. The first section is simply a call to WCS_ROTATE, while the second contains the guts of the code in which all of the map projection is done. This procedure can be called in a form similar to AITOFF, EQPOLE, or QDCB by calling wcssph2xy with a fifth parameter specifying the map projection by number and by not using any of the keywords related to the map projection type (e.g. CTYPE). PROCEDURE: The first task of the procedure is to do general error-checking to make sure the procedure was called correctly and none of the parameters or keywords conflict. This is particularly important because the procedure can be called in two ways (either using FITS-type keywords or using a number corresponding to a map projection type). All variables are converted into double precision values and angular measurements are converted from degrees into radians. If necessary, longitude values are converted into the range -pi to pi. Any latitude points close to the of the poles are mapped to a specific latitude of from the pole so that the map transformations become completely invertible. The magnitude of this correction is given by the keywords NORTH_OFFSET and SOUTH_OFFSET and a list of affected points is optionally returned in the "badindex" output parameter. The next task of the procedure is to convert the "standard" coordinates to "native" coordinates by rotating the coordinate system. This rotation is performed by the procedure WCS_ROTATE and is governed by the keywords CRVAL and LONGPOLE. The final task of the WCSSPH2XY is to take "native" latitude and longitude coordinates and convert them into x and y coordinates. Any map specific error-checking is done at this time. All of the equations were obtained from "Representations of Celestial Coordinates in FITS" and cases needing special attention are handled appropriately (see the comments with individual map projections for more information on special cases). Note that a further transformation (using the CD matrix) is required to convert the (x,y) coordinates to pixel coordinates. COMMON BLOCKS: none PROCEDURES CALLED: WCS_ROTATE COPYRIGHT NOTICE: Copyright 1993, The Regents of the University of California. This software was produced under U.S. Government contract (W-7405-ENG-36) by Los Alamos National Laboratory, which is operated by the University of California for the U.S. Department of Energy. The U.S. Government is licensed to use, reproduce, and distribute this software. Neither the Government nor the University makes any warranty, express or implied, or assumes any liability or responsibility for the use of this software. AUTHOR: Rick Balsano MODIFICATIONS/REVISION LEVEL: 1.1 8/31/93 2.3 9/15/93 W. Landsman (HSTX) Update quad cube coords, vectorize keywords 2.4 12/29/93 I. Freedman (HSTX) Eliminated LU decomposition 2.5 1/5/93 I. Freedman (HSTX) Offset keywords / bad point index 2.6 Dec 94 Compute pole for transformations where the reference pixel is at the native origin W. Landsman (HSTX) 2.7 May 95 Change internal variable BETA for V4.0 compatibility 2.8 June 95 Change loop indices from integer to long 2.9 3/18/96 Change FACE usage for cube projections to match WCSLIB C/FORTRAN software library. Converted to IDL V5.0 W. Landsman September 1997(See wcssph2xy.pro)
WCSXY2SPH
[Previous Routine] [Next Routine] [List of Routines]NAME: WCSXY2SPH PURPOSE: Convert x and y (map) coordinates to spherical coordinates EXPLANATION: To convert x and y (map) coordinates to spherical (longitude and latitude or sky) coordinates. This procedure is the inverse of WCSSPH2XY. CATEGORY: Mapping and Auxilary FITS Routine CALLING SEQUENCE: wcsxy2sph, x, y, longitude, latitude, [map_type], [ CTYPE = ,$ FACE = ,PROJP1 = , PROJP2 = ,CRVAL =, CRXY =, LONGPOLE= ] INPUT PARAMETERS: x - x coordinate of data, scalar or vector, in degrees, NOTE: x increases to to the left, not the right y - y coordinate of data, same number of elements as x, in degrees map_type - optional positional parameter, scalar corresponding to a particular map projection. This is not a FITS standard, it is simply put in to allow function similar to that of less general map projection procedures (eg AITOFF). The following list gives the map projection types and their respective numbers. FITS Number Name Comments code code ---- ------ ----------------------- ----------------------------------- DEF 0 Default = Cartesian AZP 1 Zenithal perspective projp1 required TAN 2 Gnomic AZP w/ projp1 = 0 SIN 3 Orthographic AZP w/ projp1 = Infinity (>10^14) STG 4 Stereographic AZP w/ projp1 = 1 ARC 5 Zenithal Equidistant ZPN 6 Zenithal polynomial prop1-projp9 required, useless ZEA 7 Zenithal equal area AIR 8 Airy projp1 required CYP 9 Cylindrical perspective projp1 and projp2 required CAR 10 Cartesian MER 11 Mercator CEA 12 Cylindrical equal area projp1 required COP 13 Conical perspective projp1 and projp2 required COD 14 Conical equidistant projp1 and projp2 required COE 15 Conical equal area projp1 and projp2 required COO 16 Conical orthomorphic projp1 and projp2 required BON 17 Bonne's equal area projp1 required PCO 18 Polyconic GLS 19 Sinusoidal PAR 20 Parabolic AIT 21 Hammer-Aitoff MOL 22 Mollweide CSC 23 Cobe Quadrilateralized inverse converges poorly Spherical Cube QCS 24 Quadrilateralized Spherical Cube TSC 25 Tangential Spherical Cube OPTIONAL KEYWORD PARAMETERS: CTYPE - One, two, or three element vector containing 8 character strings corresponding to the CTYPE1, CTYPE2, and CTYPE3 FITS keywords: CTYPE(0) - first four characters specify standard system ('RA--','GLON' or 'ELON' for right ascension, galactic longitude or ecliptic longitude respectively), second four letters specify the type of map projection (eg '-AIT' for Aitoff projection) CTYPE(1) - first four characters specify standard system ('DEC-','GLAT' or 'ELAT' for declination, galactic latitude or ecliptic latitude respectively; these must match the appropriate system of ctype1), second four letters of ctype2 must match second four letters of ctype1. CTYPE(2) - if present must be the 8 character string,'CUBEFACE', only used for spherical cube projections to identify an axis as containing the face on which each x and y pair of coordinates lie. FACE - a input variable used for spherical cube projections to designate the face of the cube on which the x and y coordinates lie. Must contain the same number of elements as X and Y. CRVAL - 2 element vector containing standard system coordinates (the longitude and latitude) of the reference point CRXY - 2 element vector giving the x and y coordinates of the reference point, if this is not set the offset of the x coordinate is assumed to be 0. LONGPOLE - native longitude of standard system's North Pole, default is 180 degrees, numeric scalar PROJP1 - scalar with first projection parameter, this may or may not be necessary depending on the map projection used PROJP2 - scalar with second projection parameter, this may or may not be necessary depending on the map projection used OUTPUT PARAMETERS: longitude - longitude of data, same number of elements as x, in degrees latitude - latitude of data, same number of elements as x, in degrees NOTES: The conventions followed here are ; in FITS" by Eric Greisen and Mark Calabretta (draft dated August 16, 1994). The general scheme outlined in that article is to convert x and y coordinates into a "native" longitude and latitude and then rotate the system into one of three generally recognized systems (celestial, galactic or ecliptic). This procedure necessitates two basic sections. The first converts x and y coordinates to "native" coordinates while the second converts "native" to "standard" coordinates. The first section contains the guts of the code in which all of the map projection is done. The second step is performed by WCS_ROTATE and only involves rotation of coordinate systems. WCSXY2SPH can be called in a form similar to AITOFF, EQPOLE, or QDCB by calling wcsxy2sph with a fifth parameter specifying the map projection by number and by not using any of the keywords related to the map projection type (eg ctype1 and ctyp2). PROCEDURE: The first task of the procedure is to do general error-checking to make sure the procedure was called correctly and none of the parameters or keywords conflict. This is particularly important because the procedure can be called in two ways (either using FITS-type keywords or using a number corresponding a map projection type). All variables are converted into double precision values. The second task of the procedure is to take x and y coordinates and convert them into "native" latitude and longitude coordinates. Map-specific error-checking is done at this time. All of the equations were obtained from "Representations of Celestial Coordinates in FITS" and cases needing special attention are handled appropriately (see the comments with individual map projections for more information on special cases). WCS_ROTATE is then called to convert the "native" coordinates to "standard" coordinates by rotating the coordinate system. This rotation is governed by the keywords CRVAL, and LONGPOLE. The transformation is a straightforward application of euler angles. Finally, longitude values are converted into the range from 0 to 360 degrees. COMMON BLOCKS: none PROCEDURES CALLED: WCS_ROTATE COPYRIGHT NOTICE: Copyright 1991, The Regents of the University of California. This software was produced under U.S. Government contract (W-7405-ENG-36) by Los Alamos National Laboratory, which is operated by the University of California for the U.S. Department of Energy. The U.S. Government is licensed to use, reproduce, and distribute this software. Neither the Government nor the University makes any warranty, express or implied, or assumes any liability or responsibility for the use of this software. AUTHOR: Rick Balsano MODIFICATIONS/REVISION LEVEL: 1.1 8/31/93 1.2 9/12/93 W. Landsman Vectorized CRXY, CRVAL, CTYPE 1.3 29/12/93 I. Freedman Eliminated LU decomposition 1.4 22/09/94 W. Landsman If scalar input, then scalar output 1.5 02/03/05 W. Landsman Change variable name BETA for V4.0 compatibility 1.6 06/07/05 W. Landsman Change loop index from integer to long Converted to IDL V5.0 W. Landsman September 1997(See wcsxy2sph.pro)
WCS_DEMO
[Previous Routine] [Next Routine] [List of Routines]NAME: WCS_DEMO PURPOSE: Demonstrate the basic capabilities of procedures WCSSPH2XY & WCSXY2SPH CATEGORY: Mapping and Auxilary FITS Demo Routine CALLING SEQUENCE: .run wcs_demo: compiles wcs_demo and the supporting demo routines wcs_demo: run the demo INPUT PARAMETERS: none OUTPUT PARAMETERS: none PROCEDURE: This is a demo program which is meant to call the routines wcssph2xy.pro and wcsxy2sph.pro. Since the purpose of this routine is both to show what the routines can do and what the user has to do, a file is created with all of the commands needed to complete the desired operation. Wcs_demo actually executes this command file, so the user can exactly duplicate the results by simply re-executing this file. Also, this allows a user to edit an already existing file which calls wcssph2xy.pro and wcsxy2sph.pro properly and extend the file's usefulness. This demo program allows several possible tests. The first option is to simply draw a grid of evenly spaced latitude and longitude lines in a particular map transformation. Another possibility is to do a full loop, creating a Cartesian grid of latitude and longitude lines and calling wcssph2xy.pro to convert them to a particular map. Then, wcsxy2sph.pro is called to invert the process and the difference between the original and final latitudes and longitudes can be plotted. This allows one to assess the level of the numerical errors introduced by the mapping routines. A third possible option is to look at some of the map transformations and include rotations of the reference points so that a different perspective is given. COMMON BLOCKS: none PROCEDURES CALLED: SPHDIST(), WCSXY2SPH, WCSSPH2XY COPYRIGHT NOTICE: Copyright 1991, The Regents of the University of California. This software was produced under U.S. Government contract (W-7405-ENG-36) by Los Alamos National Laboratory, which is operated by the University of California for the U.S. Department of Energy. The U.S. Government is licensed to use, reproduce, and distribute this software. Neither the Government nor the University makes any warranty, express or implied, or assumes any liability or responsibility for the use of this software. AUTHOR: Rick Balsano MODIFICATIONS/REVISION LEVEL: 1.1 8/31/93 1.2 3/19/96 - J. Bloch - LANL - Made compatible with wcslib-2.2 by Calabretta. Converted to IDL V5.0 W. Landsman September 1997(See wcs_demo.pro)
WCS_ROTATE
[Previous Routine] [Next Routine] [List of Routines]NAME: WCS_ROTATE PURPOSE: Rotate between standard (e.g. celestial) and native coordinates EXPLANATION: Computes a spherical coordinate rotation between native coordinates and standard celestial coordinate system (celestial, Galactic, or ecliptic). Applies Equations 4 - 7 in the memo "Representations of Celestial Coordinates in FITS" by Eric Greisen and Mark Calabretta See http://www.cv.nrao.edu/fits/documents/wcs/wcs.html CATEGORY: Mapping and Auxiliary FITS Routine CALLING SEQUENCE: WCS_ROTATE, longitude, latitude, phi, theta, crval, [LONGPOLE = , /REVERSE, /ORIGIN ] INPUT PARAMETERS: crval - 2 element vector containing standard system coordinates (the longitude and latitude) of the reference point INPUT OR OUTPUT PARAMETERS longitude - longitude of data, scalar or vector, in degrees, in the standard celestial coordinate system latitude - latitude of data, same number of elements as longitude, in degrees phi - longitude of data in the native system, in degrees, scalar or vector theta - latitude of data in the native system, in degress, scalar or vector if the keyword(REVERSE) is set then phi and theta are input parameters and longitude and latitude are computed. Otherwise, longitude and latitude are input parameters and phi and theta are computed. OPTIONAL KEYWORD PARAMETERS: ORIGIN - If this keyword is set and non-zero, then the reference point given by CRVAL in the native system is assumed to be at the origin of the coordinates, rather than at the North Pole. ORIGIN should be set for cylindrical projections (Cylindrical perspective-CYP, Cartesian - CAR, Mercator - MER, Cylindrical Equal area - CEA) and conventional projections (Bonne's equal area - BON, Polyconic - PCO, Sinusoidal - GLS, Parabolic - PAR, Aitoff - AIT, Mollweide - MOL, COBE quadrilateralized sphere - CSC, Quadrilateralized Spherical Cube - QSC, and Tangential Spherical Cube - TSC) LONGPOLE - native longitude of standard system's North Pole, default is 180 degrees REVISION HISTORY: Written W. Landsman December, 1994 Fixed error in finding North Pole if /ORIGIN and LONGPOLE NE 180 Xiaoyi Wu and W. Landsman, March, 1996 Fixed implementation of March 96 error, J. Thieler, April 1996 Updated to IDL V5.0 W. Landsman December 1997 Fixed determination of alpha_p if /ORIGIN and LONGPOLE EQ 180 W. Landsman May 1998(See wcs_rotate.pro)
WEOF
[Previous Routine] [Next Routine] [List of Routines]NAME : WEOF PURPOSE : Emulates the VMS WEOF routine on UNIX machines. EXPLANATION : Emulates the VMS WEOF routine on UNIX machines. *** Unix only *** CALLING SEQUENCE : WEOF, UNIT Inputs : UNIT = Tape unit number. Tape drives are selected via the UNIX environment variables "MT1", "MT2", etc. The desired tape drive is thus specified by numbers, as in VMS. Must be from 0 to 9. Opt. Inputs : None. Outputs : None. Opt. Outputs: None. Keywords : None. Calls : CHECK_TAPE_DRV Common : None. Restrictions: The environment variable "MTn", where n corresponds to the variable UNIT, must be defined. E.g., setenv MT0 /dev/nrst0 Requires IDL v3.0 or later. Side effects: The device file is opened. Category : Utilities, I/O, Tape. Prev. Hist. : VERSION 1, R. W. Thompson 11/30/89 William Thompson, Apr 1991, rewrote to better emulate VMS version. Written : R. W. Thompson, GSFC/IUE, 30 November 1989. Modified : Version 1, William Thompson, GSFC, 21 December 1993. Rewrote to use IOCTL. Version : Version 1, 21 December 1993. Converted to IDL V5.0 W. Landsman September 1997(See weof.pro)
WFPC2_READ
[Previous Routine] [Next Routine] [List of Routines]NAME: WFPC2_READ PURPOSE: Read WFPC2 images in either FITS or STSDAS format into IDL variables. EXPLANATION: This a versatile procedure for reading Wide Field Planetary Camera 2 (WFPC2) images. One can read either FITS or STSDAS format, and specific chip or chips. One can also read all four chips into a "batwing" mosaic-- so-called because the PC chip (chip 1) has a plate scale of 0.045", while the other three WF chips have a plate scale of 0.1" CALLING SEQUENCE: WFPC2_READ,filename,chip1,hdr1,chip2,hdr2,chip3,hdr3,chip4,hdr4 or WFPC2_READ,filename,chip,hdr, NUM_CHIP = [1,2,3,4], [/TRIM, PATH = ] or WFPC2_READ,filename,image,hdr,/BATWING INPUTS: filename - Name of FITS or STSDAS file with a stack of images from the four WF/PC-2 chips, followed by a FITS ASCII table with header parameters for each chip. If the file name extension ends in 'h' then it is assumed to be an STSDAS file. If no extension is supplied, and the file is is not found, then WFPC2_READ first tries appending a '.fits' extension, and then tries appending a '.c0h' extension. INPUT KEYWORD PARAMETERS: NUM_CHIP - Integer scalar or vector, subset of 1, 2, 3, 4, specifying particular chip numbers to read. Outputs will be in same order as specification of subset. (See Example 2.) /TRIM - If set, trim off areas with no image and re-orient so all chips to a common orientation suitable for insertion into "bat-wing" mosaic (no image distortion removal, however). PATH - scalar string specifying a !PATH-like list of directories in which to search for the file. Default is to look only in the current directory. /BATWING - Return a 1600 x 1600 array containing all four chips in a "bat wing" mosaic formation. This image is mainly for display purposes, since the PC chip is compressed to match the plate scale of the WF chips. In addition, a small astrometry error is introduced since chips do not have the same rotation, nor are they aligned at the integer pixel level. OUTPUTS: chipN - 800 X 800 image from chip N. If /TRIM is set then the output size is somewhat smaller (e.g. 756 x 757) headerN - Individual FITS header for chip N with correct astrometry. PROCEDURES USED: For FITS I/O: FITS_CLOSE, FITS_OPEN, FITS_READ For STSDAS I/O: EXTGRP, FTGET(), SXOPEN, SXREAD() Other procedures: CHECK_FITS, FDECOMP, FIND_WITH_DEF(), HEXTRACT, HROTATE, SXADDHIST, SXADDPAR, SXPAR() EXAMPLE: (1) Read all four chips of the FITS file u2ou0201t_c0f.fits IDL> wfpc2_read,'u2ou0201t_c0f',c1,h1,c2,h2,c3,h3,c4,h4 (2) Note that supplying the .fits extension is optional. Now read only chips 1 (the PC chip) and 3. Trim off portions of the arrays where there is no image. IDL> wfpc2_read,'u2ou0201t_c0f',c1,h1,c3,h3,num=[1,3],/trim (3) Note that with the /TRIM option the output chip sizes are no longer 800 x 800 but odd sizes such as 770 by 753. Now read all 4 chips into a 1600 x 1600 "batwing" mosaic IDL> wfpc2_read,'u2ou0201t_c0f',im,h,/batwing MODIFICATION HISTORY: Written by W. Landsman, Raytheon STX, for IDL V5.0 June 1998 Based on code by Robert Hill, Raytheon STX(See wfpc2_read.pro)
WFPCREAD
[Previous Routine] [Next Routine] [List of Routines]NAME: WFPCREAD PURPOSE: Read designated header and chip of a WFPC image EXPLANATION: This procedure is designed to read the designated header and chip of a WFPC image. If the PAR input parameter is supplied, then the group PARameter byte array is is returned. If it is not, then the header is modified by placing all the group parameters in the header as data cards. CALLING SEQUENCE: WFPCREAD, file, chip, wfhdr, wfimg, par INPUT: FILE - The filename of the Header file of the image CHIP - The chip number to read (usually 0-3) OUTPUT: WFHDR - Returned WF/PC header in a string array WFIMG - Returned WF/PC float image array OPTIONAL OUTPUT: PAR - PARameter byte array (for group format header) HISTORY: 25-JUN-1990 Version 1 written 2-APR-1992 Added code to add CAM and CHIP onto the FILTNAM1 EWD 27-JUL-1992 Proper Header finally added (E. Deutsch) Converted to IDL V5.0 W. Landsman September 1997(See wfpcread.pro)
WHERENAN
[Previous Routine] [Next Routine] [List of Routines]NAME: WHERENAN PURPOSE: Find the indices of all IEEE NaN values in an array. EXPLANATION: Find the positions of all values within an array that correspond to the IEEE NaN (not-a-number) special values. CALLING SEQUENCE: Result = WHERENAN( ARRAY [, COUNT ] ) INPUT PARAMETERS: ARRAY = Array to test against the IEEE NaN special values. Must be of either floating point, double-precision, or complex type. OUTPUTS: The result of the function is the indices of all values of ARRAY corresponding to the IEEE NaN specification, similar to the IDL WHERE function. OPTIONAL OUTPUT PARAMETERS: COUNT = Number of values found corresponding to IEEE NaN. SIDE EFFECTS: If no NaN values are found, or if ARRAY is not of type float, double precision, or complex, then -1 is returned, and COUNT is set to 0. RESTRICTIONS: ARRAY must be of type float, double-precision, or complex. PROCEDURE: The bit patterns of the numbers being tested are compared against the IEEE NaN standard. MODIFICATION HISTORY: William Thompson, Feb. 1992. William Thompson, Oct. 1992, fixed bug regarding order of bytes on VAX machines. Converted to IDL V5.0 W. Landsman September 1997(See wherenan.pro)
WHERE_NEGZERO
[Previous Routine] [Next Routine] [List of Routines]Name: WHERE_NEGZERO() PURPOSE: Find positions of IEEE -0.0 values. EXPLANATION : Finds the positions of all values within an array that correspond to the IEEE value -0.0, as determined from the bit pattern. Prior to IDL V5.1, the VMS operating system had trouble coping with these values. If using any other operating system, then no action is performed. CALLING SEQUENCE: Result = WHERE_NEGZERO( ARRAY [, COUNT, /QUIET ] ) INPUTS: ARRAY = Array to test against the IEEE -0.0 value. Must be either floating point or double-precision. OUTPUTS: The result of the function is the indices of all values of ARRAY corresponding to the IEEE -0.0 value, similar to the IDL WHERE function. OPTIONAL OUTPUT: COUNT = Number of values found corresponding to IEEE -0.0. OPTIONAL INPUT KEYWORD: QUIET = If set, then warning messages are not printed out. RESTRICTIONS: ARRAY must be of type float or double-precision. SIDE EFFECTS: If no -0.0 values are found, or if ARRAY is not of type float, or double precision, or if the operating system is something other than VMS, then -1 is returned, and COUNT is set to 0. REVISION HISTORY: Written, 31-Jan-1997, William Thompson, GSFC Converted to IDL V5.0 W. Landsman September 1997(See where_negzero.pro)
WHERE_TAG
[Previous Routine] [Next Routine] [List of Routines]NAME: WHERE_TAG PURPOSE: Like WHERE but works on structure tag names EXPLANATION: Obtain subscripts of elements in structure array for which a particular Tag has values in a range or matching specified values. Like the WHERE function but for use with structures CATEGORY: Structures CALLING SEQUENCE: w = where_tag( struct, [ Nfound, TAG_NAME=, TAG_NUMBER = , RANGE =, VALUES =, RANGE =, ISELECT =, /NOPRINT ] INPUTS: Struct = structure array to search. INPUT KEYWORDS: User *must* specify (1) TAG_NAME or TAG_NUMBER to search, and (2) the VALUES or RANGE to search on TAG_NAME = Scalar string specifying Tag Name TAG_NUMBER = otherwise give the Tag Number, RANGE = [min,max] range to search for in Struct, VALUES = one or array of numbers to match for in Struct, ISELECT= specifies indices to select only part of structure array, (use it to recycle subscripts from previous searches). /NOPRINT = suppress informational messages about nothing found. OUTPUTS: Nfound = # of occurences found. RESULT: Function returns subscripts (indices) to desired elements. EXAMPLES: Suppose STR is a structure with tags CAT_NO:indgen(10), and NAME:strarr(10). Find the indices where STR.CAT_NO is between 3 and 5. IDL> print, WHERE_TAG( str, TAG_NAME = 'CAT_NO', VALUE = [3,4,5] ) ;or IDL> print, WHERE_TAG( str, TAG_NUM = 0, RANGE = [3,5]) PROCEDURE: Get tag number and apply the WHERE function appropriately. MODIFICATION HISTORY: written 1990 Frank Varosi STX @ NASA/GSFC Stop printing "Tagnot found" with /NOPRINT, CD Pike 8-Jun-93 (See where_tag.pro)
WRITEFITS
[Previous Routine] [Next Routine] [List of Routines]NAME: WRITEFITS PURPOSE: Write IDL array and header variables to a disk FITS file. EXPLANATION: A minimal FITS header is created if not supplied. WRITEFITS works for all types of FITS files except random groups CALLING SEQUENCE: WRITEFITS, filename, data [, header, NaNvalue = , /APPEND] INPUTS: FILENAME = String containing the name of the file to be written. DATA = Image array to be written to FITS file. If DATA is undefined or a scalar, then only the FITS header (which must have NAXIS = 0) will be written to disk OPTIONAL INPUT: HEADER = String array containing the header for the FITS file. If variable HEADER is not given, the program will generate a minimal FITS header. OPTIONAL INPUT KEYWORD: NaNvalue - Value in the data array to be set to the IEEE NaN condition. This is the FITS representation of undefined values APPEND - If this keyword is set then the supplied header and data array are assumed to be an extension and are appended onto the end of an existing FITS file. Note that the primary header in the existing file must already have an EXTEND keyword to indicate the presence of an FITS extension. OUTPUTS: None RESTRICTIONS: (1) It recommended that BSCALE and BZERO not be used (or set equal to 1. and 0) with REAL*4 or REAL*8 data. (2) WRITEFITS will remove any group parameters from the FITS header EXAMPLE: Write a randomn 50 x 50 array as a FITS file creating a minimal header. IDL> im = randomn(seed, 50, 50) ;Create array IDL> writefits, 'test', im ;Write to a FITS file "test" PROCEDURES USED: CHECK_FITS, HEADFITS(), HOST_TO_IEEE, IS_IEEE_BIG(), MKHDR, SXDELPAR, SXADDPAR, SXPAR() MODIFICATION HISTORY: WRITTEN, Jim Wofford, January, 29 1989 MODIFIED, Wayne Landsman, added BITPIX = -32,-64 support for UNIX Use new BYTEODER keywords 22-Feb-92 Modify OPENW for V3.0.0 W. Landsman Dec 92 Work for "windows" R. Isaacman Jan 93 More checks for null data Mar 94 Work for Linux W. Landsman Sep 95 Added call to IS_IEEE_BIG() W. Landsman Apr 96 Make sure SIMPLE is written in first line of header W. Landsman Jun 97 Use SYSTIME() instead of !STIME W. Landsman July 97 Create a default image extension header if needed W. Landsman June 98 Converted to IDL V5.0 W. Landsman June 98(See writefits.pro)
XMEDSKY
[Previous Routine] [Next Routine] [List of Routines]NAME: XMEDSKY PURPOSE: Subtract sky from an image as a 1-D function of X EXPLANATION: The sky is the column-by-column median of pixels within 3 sigma of the image global median. Default is [32, 1023, 12, 499], appropriate for STIS slitless spectra binned 1 X 2. This procedure is called by the cosmic ray rejection routine CR_REJECT CALLING SEQUENCE: XMEDSKY, Image, Bkg, [ CLIP = ] INPUTS: Image: Input image for which sky vector is to be computed. INPUT KEYWORD PARAMETERS: CLIP: [x0, x1, y0, y1]: region of image to be used for all statistical computations. OUTPUT PARAMETER: Bkg: Vector of sky values. PROCEDURE CALLS: STDEV() - In /obsolete directory of standard IDL distribution If since V5.1 then the STDDEV function is used instead. MODIFICATION HISTORY: Written by: R. S. Hill, Hughes STX, 20 Oct. 1997 Converted to V5.0, use STDDEV() W. Landsman June 1998(See xmedsky.pro)
XY2AD
[Previous Routine] [Next Routine] [List of Routines]NAME: XY2AD PURPOSE: Compute R.A. and Dec from X and Y and a FITS astrometry structure EXPLANATION: The astrometry structure must first be extracted by EXTAST from a FITS header. A tangent (gnomonic) projection is computed directly; other projections are computed using WCSXY2SPH. Angles are returned in degrees. XY2AD is meant to be used internal to other procedures. For interactive purposes use XYAD. CALLING SEQUENCE: XY2AD, x, y, astr, a, d INPUTS: X - row position in pixels, scalar or vector Y - column position in pixels, scalar or vector ASTR - astrometry structure, output from EXTAST procedure containing: .CD - 2 x 2 array containing the astrometry parameters CD1_1 CD1_2 in DEGREES/PIXEL CD2_1 CD2_2 .CDELT - 2 element vector giving physical increment at reference pixel .CRPIX - 2 element vector giving X and Y coordinates of reference pixel (def = NAXIS/2) .CRVAL - 2 element vector giving R.A. and DEC of reference pixel in DEGREES .CTYPE - 2 element vector giving projection types .LONGPOLE - scalar longitude of north pole (default = 180) .PROJP1 - Scalar parameter needed in some projections .PROJP2 - Scalar parameter needed in some projections OUTPUT: A - R.A. in DEGREES, same number of elements as X and Y D - Dec. in DEGREES, same number of elements as X and Y RESTRICTIONS: Note that all angles are in degrees, including CD and CRVAL Also note that the CRPIX keyword assumes an FORTRAN type array beginning at (1,1), while X and Y give the IDL position beginning at (0,0). No parameter checking is performed. REVISION HISTORY: Written by R. Cornett, SASC Tech., 4/7/86 Converted to IDL by B. Boothman, SASC Tech., 4/21/86 Perform CD multiplication in degrees W. Landsman Dec 1994 Converted to IDL V5.0 W. Landsman September 1997(See xy2ad.pro)
XYAD
[Previous Routine] [Next Routine] [List of Routines]NAME: XYAD PURPOSE: Use a FITS header to convert pixel (X,Y) to celestial coordinates EXPLANATION: Use astrometry in a FITS image header to compute R.A. and Dec in decimal degrees from X and Y. CALLING SEQUENCE: XYAD, HDR ;Prompt for X and Y positions XYAD, HDR, X, Y, A, D, [ /PRINT] INPUTS: HDR - FITS Image header containing astrometry info OPTIONAL INPUTS: X - row position in pixels, scalar or vector Y - column position in pixels, scalar or vector X and Y should be in IDL convention, (first pixel is (0,0)). OPTIONAL OUTPUT: A - Right ascension in decimal DEGREES, same number of elements as X and Y D - Declination in decimal DEGREES OPTIONAL KEYWORD INPUT: PRINT - If this keyword is set and non-zero, then results are displayed at the terminal. OPERATIONAL NOTES: If less than 5 parameters are supplied, or if the /PRINT keyword is set, then then the X and Y positions are displayed at the terminal. If this procedure is to be used repeatedly with the same header, then it would be faster to use XY2AD. PROCEDURES CALLED ADSTRING(), EXTAST, GSSSXYAD, XY2AD REVISION HISTORY: W. Landsman STX Jan, 1988 Use astrometry structure W. Landsman Jan, 1994 Recognize GSSS header W. Landsman June, 1994 Changed ADSTRING output format W. Landsman September 1995 Converted to IDL V5.0 W. Landsman September 1997(See xyad.pro)
XYXY
[Previous Routine] [Next Routine] [List of Routines]NAME: XYXY PURPOSE: To use a pair of headers to convert X/Y positions from one frame to another. CALLING SEQUENCE: XYXY, hdra, hdrb, xa, ya, [ xb, yb ] INPUTS: hdra - The header containing the plate solution describing the frame of reference being converted FROM. hdra - The header containing the plate solution describing the frame of reference being converted TO. xa - A scalar or vector containing the x coordinate(s) to convert. ya - A scalar or vector containing the y coordinate(s) to convert. Must have the same number of elements as 'xa'. OUTPUTS: xb - The converted x coordinate(s). If this parameter is not specified, it is returned through 'xa'. yb - The converted y coordinate(s). If this parameter is not specified, it is returned through 'ya'. PROCEDURE: The procedures 'xyad' and 'adxy' are used to perform the conversion. The equinoxes of each header are checked with "get_equinox" to make sure that they are identical, and "precess" is used if they are not PROCEDURES USED: GET_EQUINOX(), EXTAST, XYAD, ADXY, PRECESS MODIFICATION HISTORY: Written by Michael R. Greason, Hughes-STX, 13 April 1992. Updated to use ASTROMETRY structures. J.D.Offenberg, HSTX, Jan 1993 Converted to IDL V5.0 W. Landsman September 1997(See xyxy.pro)
XYZ
[Previous Routine] [Next Routine] [List of Routines]NAME: XYZ PURPOSE: Calculate heliocentric X,Y, and Z coordinates for 1950.0 EXPLANATION: The positive X axis is directed towards the equinox, the Y-axis towards the point on the equator at right ascension 6h, and the Z axis toward the north pole of the equator. CALLING SEQUENCE: xyz, date, x, y, z INPUT: date - reduced julian date (=JD - 2400000), scalar or vector OUTPUT: X,Y,Z - scalars or vectors giving heliocentric rectangular coordinates (in A.U) for each date supplied. EXAMPLE: What were the rectangular coordinates of the sun on Jan 1, 1982 at 0h UT (= julian day 2444969.5) IDL> xyz,44969.5,x,y,z ==> x = 0.1502, y = -0.8915, z = -0.3867 within 0.001 A.U of the Astronomical Almanac position REVISION HISTORY Original algorithm from Almanac for Computers, Doggett et al. USNO 1978 Adapted from the book Astronomical Photometry by A. Henden Written W. Landsman STX June 1989 Correct error in X coefficient W. Landsman HSTX January 1995 Converted to IDL V5.0 W. Landsman September 1997(See xyz.pro)
YDN2MD
[Previous Routine] [Next Routine] [List of Routines]NAME: YDN2MD PURPOSE: Convert from year and day number of year to month and day of month. CATEGORY: CALLING SEQUENCE: ydn2md,yr,dy,m,d INPUTS: yr = year (like 1988). in dy = day number in year (like 310). in KEYWORD PARAMETERS: OUTPUTS: m = month number (like 11 = Nov). out d = day of month (like 5). out COMMON BLOCKS: NOTES: Note: On error returns m = d = -1. MODIFICATION HISTORY: R. Sterner 20 June, 1985 (for budget workspace). Johns Hopkins University Applied Physics Laboratory. RES 18 Sep, 1989 --- converted to SUN Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory This software may be used, copied, or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made. This routine is provided as is without any express or implied warranties whatsoever. Other limitations apply as described in the file disclaimer.txt. Converted to IDL V5.0 W. Landsman September 1997(See ydn2md.pro)
YMD2DN
[Previous Routine] [Next Routine] [List of Routines]NAME: YMD2DN PURPOSE: Convert from year, month, day to day number of year. CATEGORY: CALLING SEQUENCE: dy = ymd2dn(yr,m,d) INPUTS: yr = year (like 1988). scalar or vector m = month number (like 11 = Nov). scalar or vector d = day of month (like 5). scalar or vector KEYWORD PARAMETERS: OUTPUTS: dy = day number in year (like 310). out COMMON BLOCKS: NOTES: MODIFICATION HISTORY: Written by R. Sterner, 20 June, 1985. Johns Hopkins University Applied Physics Laboratory. RES 18 Sep, 1989 --- converted to SUN R. Sterner, 1997 Feb 3 --- Made work for arrays. Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory This software may be used, copied, or redistributed as long as it is not sold and this copyright notice is reproduced on each copy made. This routine is provided as is without any express or implied warranties whatsoever. Other limitations apply as described in the file disclaimer.txt. Converted to IDL V5.0 W. Landsman 2-Jan-1998(See ymd2dn.pro)
ZANG
[Previous Routine] [Next Routine] [List of Routines]NAME: ZANG PURPOSE: Determine the angular size of an object as a function of redshift EXPLANATION: ZANG asumes a Friedmann cosmology (homogeneous, isotropic universe with zero cosmological constant. CALLING SEQUENCE: angsiz = zang( dl, [ z, h, omg ] ) INPUTS: dl - linear size of the object in kpc OPTIONAL INPUT User will be prompted for these parameters if not supplied. z - redshift of object h - Hubble constant in km/s/Mpc (usually 50 - 100) omega - Cosmological density parameter (twice the deceleration parameter q0), Omega =1 at the critical density OUTPUT: angsiz - Angular size of the object at the given redshift in arc seconds NOTES: One (and only one) of the input parameters may be supplied as a vector In this case, the output ANGSIZ will also be a vector. Be sure to supply the input linear size dl in units of kpc. REVISION HISTORY: Written J. Hill STX July, 1988 Converted to IDL V5.0 W. Landsman September 1997(See zang.pro)
ZBRENT
[Previous Routine] [Next Routine] [List of Routines]NAME: ZBRENT PURPOSE: Find the zero of a 1-D function up to specified tolerance. EXPLANTION: This routine assumes that the function is known to have a zero. CALLING: x_zero = ZBRENT( x1, x2, FUNC_NAME="name" ) INPUTS: x1, x2 = scalars, 2 points which bracket location of function zero, that is, F(x1) < 0 < F(x2). Note: computations are performed with same precision (single/double) as the inputs and user supplied function. REQUIRED INPUT KEYWORD: FUNC_NAME = function name (string) Calling mechanism should be: F = func_name( px ) where: px = scalar independent variable, input. F = scalar value of function at px, should be same precision (single/double) as input. OPTIONAL INPUT KEYWORD: MAX_ITER = maximum allowed number iterations, default=100. TOLERANCE = desired accuracy of minimum location, default = 1.e-3. OUTPUTS: Returns the location of zero, with accuracy of specified tolerance. PROCEDURE: Brent's method to find zero of a function by using bracketing, bisection, and inverse quadratic interpolation, from Numerical Recipes (by Press, et al.), sec.9.3 (p.251). EXAMPLE: Find the root of the COSINE function between 1. and 2. radians IDL> print, zbrent( 1, 2, FUNC = 'COS') and the result will be !PI/2 within the specified tolerance MODIFICATION HISTORY: Written, Frank Varosi NASA/GSFC 1992. FV.1994, mod to check for single/double prec. and set zeps accordingly. Converted to IDL V5.0 W. Landsman September 1997(See zbrent.pro)
ZENPOS
[Previous Routine] [Next Routine] [List of Routines]NAME: ZENPOS PURPOSE: Return the zenith RA and Dec in radians for a given Julian date. CALLING SEQUENCE: ZENPOS, Date, Ra, Dec INPUT: Date The Julian date, in double precision, of the date and time for which the zenith position is desired, scalar or vector. OUTPUTS: Ra The right ascension in RADIANS of the zenith. Dec The declination in RADIANS of the zenith. PROCEDURE: The local sidereal time is computed; this is the RA of the zenith. It and the observatories latitude (corresponding to the Dec.) are converted to radians and returned as the zenith direction. PROMPTS: ZENPOS will prompt for the following 3 parameters if they are not defined in the common block SITE (see below) LAT,LNG - north latitude and west longitude of the desired location in DEGREES TZONE - Time Zone (in hours) of the desired location (e.g. 4 = EDT, 5 = EST) COMMON BLOCKS: SITE - This common block should contain the three scalars LAT, LNG and TZONE PROCEDURE CALLS: CT2LST - Convert to Local Mean Sidereal Time MODIFICATION HISTORY: Written by Michael R. Greason, STX, 14 October 1988. Converted to IDL V5.0 W. Landsman September 1997(See zenpos.pro)
ZOOM_XY
[Previous Routine] [Next Routine] [List of Routines]NAME: ZOOM_XY PURPOSE: Converts X, Y position on the image array to the the X,Y position in the current window. (These positions are identical only for an unroamed, zoomed image with with pixel (0,0) of the image placed at position (0,0) on the TV.) CALLING SEQUENCE: ZOOM_XY, Xim,Yim,Xtv,Ytv, [ OFFSET =, ZOOM = ] INPUTS: XIM - Scalar or vector giving X position(s) as read on the image display (e.g. with CURSOR,XIM,YIM,/DEVICE) YIM - Like XTV but giving Y position(s) as read on the image display. If only 2 parameters are supplied then XIM and YIM will be modfied on output to contain the converted coordinates. OPTIONAL KEYWORD INPUT: OFFSET - 2 element vector giving the location of the image pixel (0,0) on the window display. OFFSET can be positive (e.g if the image is centered in a larger window) or negative (e.g. if the only the central region of an image much larger than the window is being displayed. Default value is [0,0], or no offset. ZOOM - Scalar specifying the magnification of the window with respect to the image variable. OUTPUTS: XTV,YTV - REAL*4 X and Y coordinates of the image corresponding to the cursor position on the TV display. Same number of elements as XIM, YIM. NOTES: The integer value of a pixel is assumed to refer to the *center* of a pixel. REVISON HISTORY: Adapted from MOUSSE procedure of the same name W. Landsman HSTX Mar 1996 Converted to IDL V5.0 W. Landsman September 1997(See zoom_xy.pro)
ZPARCHECK
[Previous Routine] [List of Routines]NAME: ZPARCHECK PURPOSE: Routine to check user parameters to a procedure CALLING SEQUENCE: zparcheck, progname, parameter, parnum, types, dimens, [ message ] INPUTS: progname - scalar string name of calling procedure parameter - parameter passed to the routine parnum - integer parameter number types - integer scalar or vector of valid types 1 - byte 2 - integer 3 - int*4 4 - real*4 5 - real*8 6 - complex 7 - string 8 - structure 9 - double complex dimens - integer scalar or vector giving number of allowed dimensions. OPTIONAL INPUT: message - string message describing the parameter to be printed if an error is found OUTPUTS: none EXAMPLE: IDL> zparcheck, 'HREBIN', hdr, 2, 7, 1, 'FITS Image Header' This example checks whether the parameter 'hdr' is of type string (=7) and is a vector (1 dimension). If either of these tests fail, a message will be printed "Parameter 2 (FITS Image Header) is undefined" "Valid dimensions are 1" "Valid types are string" SIDE EFFECTS: If an error in the parameter is a message is printed a RETALL issued HISTORY version 1 D. Lindler Dec. 86 documentation updated. M. Greason, May 1990. Recognize double complex datatype W. Landsman September 1995 Converted to IDL V5.0 W. Landsman September 1997(See zparcheck.pro)


psin(1) Qualcomm Atheros Open Powerline Toolkit psin(1) NAME psin - Import PIB Prescalers SYNOPSIS psin [options] [<stdin] file SYNOPSIS Read an amplitude map from stdin and insert it into a nexisting PIB file, replacing the previous amplitude map. This program permits custom amplitude maps to be loaded into a PIB file. It can also pipe a map directly from one PIB file to another. Atheros can provide standard amplitude maps (prescalers) that conform to most national or international EMI regulations. Generally speaking, these maps should not be modified but there are execeptions. This program is part of the Qualcomm Atheros Powerline Toolkit. See the AMP man page for an overview and installation instructions. CAVEATS The Atheros Windows Device Manager determines the type of prescalers stored in the PIB by inspecting the ToneMaskType code which is also stored in the PIB but is not part of the prescaler set. If this program is used to store a new prescaler set in a PIB and the ToneMaskType code is not updated to reflect the change then the Windows Device Manager will continue to display the previous prescaler type. This will confuse Windows Device Manager users. Use program set‚Ä‚Äź pib to set the ToneMaskType code and program pskey to verify the true prescaler type. OPTIONS None. ARGUMENTS file The name of an Atheros Parameter Information Block (PIB) file. The original prescalers are replaced and the checksum is re-computed. By convention, PIB files have a .pib extension but this program does not enforce that convention and does not make any assumption based on filename or extension but the program will reject invalid PIB files. Only one file may be specified on the command line. FILES An amplitude map consists of 1155 frequency-amplitude pairs. Each pair consists of a decimal index and a hexadecimal scaler value. The index represents a frequecy from 1.8 mhz through 30 mhz. The scaler represents the amplitude attenua‚Äź tion applied at that frequency. The frequency and attenuation are computed as follows. frequency = (index + 74) / 40.96 decibels = 20 * log10 (scaler / 256) EXAMPLE The following example loads prescaler file abc.psc into PIB file abc.pib. The ToneMaskType code is not updated by this operation and should be updated separately to avoid confusing Windows Device Manager users. Program setpib is one means of updating this code. # psin < abc.psc abc.pib DISCLAIMER PIB file structure and content is proprietary to Qualcomm Atheros, Ocala FL USA. Consequently, public information is not available. Qualcomm Atheros reserves the right to modify PIB file structure or content in future firmware releases with‚Äź out any obligation to notify or compensate users of this program. Tampering with prescaler settings may violate national or international electo-magnetic emission standards and lead to fines or penalties. Qualcomm Atheros shall not be held responsible for any consequences of modifications made to prescaler sets provided to their customers. SEE ALSO psgraph(7), pskey(1), psout(1), setpib(1) CREDITS Charles Maier<EMAIL_ADDRESS>Nathaniel Houghton<EMAIL_ADDRESS>open-plc-utils-0.0.3 November 2013 psin(1)


Japanese man arrested in Perth after child pornography found on phone
PERTH: A man was arrested at Perth International Airport last weekend after Australian Border Force (ABF) officers found a large amount of child pornography on his phone.
The 30-year-old Japanese was selected for a baggage examination when he landed in Perth on Saturday (Nov 2) night after a flight from Tokyo.
"During the examination of his mobile phone, officers located more than 200 video files and images," said ABF in a news release.
"Due to the large number of videos, investigators reviewed only a small selection, which it will be alleged were found to depict the sexual abuse or exploitation of children," it added.
READ: Indonesian man arrested in Perth for allegedly possessing child pornography
The remainder of those files, as well as around 300 more videos on a separate application on the phone, will undergo forensic examination in the coming weeks.
The man's visa was cancelled and his phone seized.
He appeared at the Perth Magistrate’s Court on Sunday and was charged under the Customs Act with one count of attempting to import child abuse material.
ABF Regional Commander for Western Australia, Rod O’Donnell, warned all travellers that the possession of abhorrent child exploitation material is viewed very seriously under Australian law.
READ: Malaysian detained in Australia over child porn allegedly found on mobile phone
“Tackling child exploitation in particular is an operational priority for the ABF as part of its role in protecting the border from individuals who may pose a threat to the community.
“ABF officers have significant powers under the Customs Act to search the mobile phones and electronic devices of international travellers and they exercise those powers at airports around the country on a daily basis,” he said.
If found guilty, the man faces up to 10 years in jail and/or a fine of up to A$525,000 (US$362,800).