Masturbation ?ruins? viagra sale online a person for partner sexThe use of masturbation can in fact be used as part of partner sex and mutual masturbation is common practices by many people around the world. Other skinny cialis online prescription individuals who don't need to lose weight but still suffer from man boobs have also found targeted exercises that zero in on the specific area have cured them from the man boob look. If you buy cialis canada just do not want to spend too much on this then the enlargement exercises program may be the best option. If you, can i buy viagra in spain, just do not want to spend too much on this then the enlargement exercises program may be the best option. If you viagra prix pharmacie just do not want to spend too much on this then the enlargement exercises program may be the best option. If you purchase viagra uk have ever wondered about Extagen and its potential effects upon yourself this article is meant to shed some light on the matter. This has cheap viagra cialis been proven by individuals using their own mental techniques such as thinking about sports during sex. Saw Palmetto buy propecia canada also bolsters the male reproductive system and helps maintain an appropriate balance of the male sexual hormones.

It?s easy buy viagra online no prescription to be selfish and focus on yourself.

"A money buy viagra dubai back guarantee is a surefire sign of a quality penis extender. Man boob, viagra tablets for sale, targeted exercise. The Extagen achat viagra internet Proprietary Blend includes: L Arginine Yohimbe Extract (Pausinystalia yohimba)(bark) Maca Extract (Lepidium meyenii) (root) Catuaba Muira Puama (aerial) Nettle (leaf) American Ginseng Korean Ginseng Siberian Ginseng Zinc (oxide) Gluconate 200% DV. Of course viagra to buy uk there is no harm in trying to build muscle fast. Epimedium leaves order viagra canada also increases sexual desire and reduces fatigue. It probably buy accutane online without prescription doesn?t help foreplay if there is a 10 minute pause to fit the pump and use it. Premature ejaculation acheter cialis en pharmacie is one of the erectile dysfunction problems of men. Men on achat cialis en suisse the average ejaculate 2 3 minutes after penetration in contrast to women who take their time (over 10 minutes). Much of, cheap cialis online, premature ejaculation suffering can actually be cured through mental techniques. Most men viagra low price taking anti impotence drugs get an erection and can perform again.

I hope acheter viagra suisse you are aware that there is a world of difference between an orgasm and an ejaculation. Usually premature comprar cialis en andorra ejaculation pills only will only cause at best short term placebo effect type results.

Erectile dysfunction comprar viagra en argentina includes all male sexual performance problems like the terrible male morale killer premature ejaculation. This usually (viagra kaufen ohne rezept) occurs after a period of time in which these men tried to get rid of their man boobs with common chest exercises like push ups and chest presses. Water is, vente viagra cnrs, a natural detox for the body and could be a factor for curing impotence. Saw Palmetto can i buy accutane contains Sterols and Fatty acids (Caproic acid Lauric acid and Palmitic acid) which promote efficient prostate function and inhibit inflammation. While shampooing buying viagra uk massage your scalp with your fingertips for 5 to 10 minutes.

It probably (buy propecia online without prescription) doesn?t help foreplay if there is a 10 minute pause to fit the pump and use it. However men (cialis cost at walmart) are always left confused and disheartened when they come across the huge and often unbelievable offers on the internet. Premature ejaculation, cialis price per pill, is the male sexual problem of ejaculating before penetration or ejaculating very soon after vaginal penetration. Herbal pills cheap viagra online pharmacy target the breast tissue only so the only feminization changes you will see are in your breast area. The saddest prix cialis suisse thing is that many men feel that they are destined to forever walk with their man boobs and that there is nothing they can do about it.

Those two, comprar cialis en andorra, biochemicals cause growth. In just buy cheap viagra online uk two weeks from TODAY your penis will be noticeably longer thicker and more satisfying to women.

Use unbiased cialis cost sources and study up on NATURAL methods for increasing penis size. Then they viagra online gÓÌnstig add the claim "also stops premature ejaculation" just so that they can sell more units. Whereas women prix cialis 5 are more open in discussing personal and sexual matters with their peers and with their doctors men are generally reticent to seek advice from other people even with medical professionals on matters of men's sexual health. That is, where can i buy propecia, why I recommend all men stay away from pills. Reason TwoIt's prix viagra 100 the most cost effective way to enhancement you will ever see. Premature ejaculation propecia online affects 30% of all men at some time in their lives. However the cialis online perscription big caveat is that you can NOT gain any girth with surgery. There is buying viagra from canada a way to make your penis length grow by 3 or 4 inches. There are viagra price cvs many different type of product on the market but the one which really works above all others is natural penis enlargement. In this viagra sale article I'm going to share the steps that I took. There is buy viagra online nothing in them that will increase your penis size. Premature ejaculation can i buy viagra without a prescription affects 30% of all men at some time in their lives. 5 inches viagra to buy uk long and 5 inches around to over 8 inches long and exactly 6 inches around quickly and permanently.

I discovered best cialis price a complete system to make my length grow and I utilized it to get my incredible results. Take away achat cialis pharmacie the fear (with behavioural therapy) and the PE also disappears. PC elevations vente viagra cnrs are done simply by elevating your anatomy in a perpendicular fashion WITHOUT the hands and done in repetitions of 8 10 at a time. It must buy cialis daily use be noted however that there are also innumerable sites conveying bogus and incredible information on men's sexual health therefore a questioning intelligence and sharp discernment are also necessary to acquire the accurate facts from the internet. Growth is buy accutane 40mg caused by something far more difficult to get into the body in pill form. Those companies viagra deutschland kaufen are being sued left and right for one reason: Their products do NOT do what they claim What about natural methods. I recommend female viagra for sale taking a multi vitamin formula exercising regularly and eating a healthy diet. The beauty acheter cialis pharmacie of natural growth is that it is what it says it is entirely natural. If you comprar viagra en zaragoza want to use this article on your website or in your ezine make all the urls (links) active.

Because I buy cheap cialis online blew a fortune when I first started with penis enlargement. 5 inches acheter viagra belgique long and 5 inches around to over 8 inches long and exactly 6 inches around quickly and permanently. Put it buying accutane online into action tonight and you can immediately start having sex that is much longer lasting and more mutually satisfying. If you, cheap viagra soft, want to make your penis bigger thicker and much more satisfying to women the following will help you greatly.

But be, achat viagra en belgique, warned if you don't use a trusted guide then they too will do nothing for you. This means, purchase viagra without prescription, that while it may be NICE to have a longer male anatomy for pure passion and pleasure you are FAR better off having GREAT girth instead. This prepares order viagra online the body for the growth it will cause.

5 inches buy cheap viagra in uk long and 5 inches around to a very well endowed 8 inches PLUS in length and exactly 6 inches in girth. If you comprar viagra sin receta want to know the best methods for getting your penis bigger read on. Pumps can can i buy viagra in the uk give you an erection that is firmer but they will not permanently increase your penis size at all and they are extremely dangerous and their use can result in serious injury. Pills creams achat cialis en france and "special" condoms in addition to being VERY ineffective and not producing an effect on staying power that is very noticeable at all will cause you to become dependent on them such that your sex life will be even worse than it is now if you try to have sex without them. These exercises viagra online lowest price involve clenching and unclenching of the PC muscle and are highly simple to perform. The milking vente viagra en pharmacie method is designed to enlarge the penis girth using very simple strokes to force blood into the shaft which causes the cell reaction and growth. Though the viagra online usa exercises are highly effective you should not expect results overnight. Penis yeast buy cialis 5 mg infection if left untreated for long can cause very serious conditions. They work, viagra kaufen in deutschland, differently. Such erection cheap viagra fast enhancer pills work by nourishing your sexual system improving blood flow into the penis chambers and raising the testosterone levels in your body. Ending premature cheap cialis viagra ejaculation can do wonders for your sex life. However if buying viagra somehow the Candida yeast's activity increases it results in yeast infections. These treatments achat viagra pharmacie only treat the itches and burns but do nothing to treat the root cause of yeast infection which is the excessive activity of Candida yeast. You could comprar cialis contrareembolso do the same thing with a little bit of baby lotion. Sores in propecia online no prescription the penis head. Unlike prescription accutane online drugs these herbal pills and patches do not give you any nasty side effects.

With so buy propecia australia many products out there to choose from how do you get any real penis enlargement facts Unfortunately most of the products offered are just plain junk. Let us acheter cialis en espagne look at them. Aside from prix viagra 50 doing fat burning exercises like running jogging walking biking cross country skiing etc.

To gain cialis prix a complete relief and prevent the recurrence you need to treat the root cause check the Candida activity. Also be viagra where to buy sure to demand a 100% guarantee like I did. Some of viagra sale online the symptoms include severe itching burning sensation during urination and intercourse sores and redness in the penis and skin flaking and dryness. That way buy viagra online in australia you know you have NOTHING to lose and a lifetime of amazing sex to gain. Yeast infection, cialis farmacia online, in men can be very frustrating both physical and emotional it is important to seek treatment immediately as it can be fatal if left untreated for long. The best cialis low cost methods for making your penis bigger do not involve any pills or potions. But when (cialis price at walmart) you have a very thin penis the task becomes a lot more difficult. A high (viagra for sale) quality pump costs a few hundred dollars that not many men are willing to spend. This is acheter viagra en suisse because; OTC medicines only treat the symptoms of yeast infections and do nothing to actually treat the root cause of yeast infections. As long purchase viagra online as this root cause is not fixed it will be common to see yeast infections that will keep recurring with increased severity as they keep getting resistant to the drugs and treatments prescribed by doctors. The answers order viagra without prescription come in different forms of penis enlargement and penis enhancement products that you can get online or in the market. There are buy accutane uk a few options available when it comes to girth enhancement.

Instead I buy adobe photoshop cs4 recommend getting your hands on a nifty little piece of software called a registry cleaner. This will buy microsoft office 2007 product key really consume your time. Be very buy dreamweaver online careful when deleting registry entries. They slow buy xp pro oem it down because every time you ask your computer to do something it needs to access files in the registry. Think of purchase vista key from microsoft the registry as the engine in your computer. Using a buy windows xp professional product key slow computer can be very frustrating. If you buy photoshop cs 4 do decide to go ahead and download SDFix you need to be aware that it only works on Windows 2000 and XP on accounts that have full administrator privileges and it must be run in safe mode. • Run your buy xp license key disk defragmentation software. Even though buy autocad software these files are no longer required they are there. However by buy windows vista ultimate product key simply using the password protect your information is locked away from the prying eyes of others with a password only you have.

If you buy microsoft windows 2000 want to fix PC registry you are going to need to download a registry cleaner software like System Mechanic. You may buy windows xp volume license also wonder how the best registry cleaners can be quite so cost effective but this is actually quite straightforward. But how buy visual studio pro do you get this nasty virus off your system. When it buy acrobat distiller is not running at full capacity the rest of the system suffers. Stop asking (buy microsoft word software) "why is my computer so slow" or "how to make my computer go faster" install the software and speed up your system in minutes. Over any buy adobe acrobat 9 pro extended period of time the registry can become cluttered with information and data no longer relevant. That is buy cs3 flash actually the main reason why projects get delayed because team members that work on certain parts of the projects unintentionally affect what the others are doing. And unfortunately (buy microsoft office 2007 vista) there is no internal tool to clean up the registry for you. If you (buy windows 2008 web edition) were not aware the virus has the intention to trick you. That is purchase windows xp activation key actually the main reason why projects get delayed because team members that work on certain parts of the projects unintentionally affect what the others are doing. Without going buy windows xp home sp2 too deep into the technical mumbo jumbo your registry is the central information store for just about everything to do with your computer. This can purchase office 2007 pro lead to a build up of corrupt entries and can effect the performance speed of the PC as well cause serious errors. Even though buy adobe captivate 4 these files are no longer required they are there. After you (purchase windows vista home) have done this you will then simply click on the button marked "Encrypt Now" and your files are now encrypted. All of purchase microsoft office 2007 upgrade this being said SDFix does a good job of what it is intended to do and that is get rid of the nastiest and most persistent threats out there that maybe only a handful of spyware removal tools can get rid of. Any changes buy microsoft windows xp online made to installed software or system policies will be held in the registry.

Tired of purchase windows xp pro download your laptop freezing. Spyware Guard buy microsoft project 2009 is a dangerous rogue program that posts false positive messages that you system is infected. There's a (purchase adobe acrobat pro) small chance though it could harm your computer but it does help a lot of people with registry programs. Get sites buy microsoft office student edition that illustrate simple example rather than those that throw a complex coded application that you hardly can find out the beginning and the ending. However projects, buy cs4 master, entail certain risks that managers are well aware of. They can, buy vista with xp downgrade, be:• Your computer freezes up completely leaving you unable to so much as move the mouse around.

Once it buy windows server 2003 standard is slowed down you can fix PC registry and have it move faster again. Your computer's (buying windows for mac) registry is where all of the files your computer needs to perform tasks are stored. Lets take buy windows cd key a look at Regcure first shall we. This will buy windows vista home premium really consume your time. When you purchase xp online have a USB flash that keeps all of your important documents you may consider using the password protect to ensure that all of your work is kept private especially if you should lose the drive. So if buy microsoft office academic you feel that your project and your team members are running in circles consider document version control software.

In your cialis cost quest for a safe penile enhancement method you must have come across sites that promote various products such as exercises traction devices pills and patches. If a prix viagra 50 man feels that he has a smaller than average size penis this can lead to feelings of anxiety and fear of love making. 5 inch cheap viagra canada in thickness. The average acheter viagra au quebec penis girth = 5. In 2001 propecia where to buy Lifestyles Condoms did another survey with 301 volunteers over 18 years old. Here are buy viagra without the answers to some frequently asked questions about getting a larger thicker and more satisfying erect penis size fast.

Mucuna Pruriens where can i buy viagra legally ExtractThe anabolic effect of this herb increases testosterone. This is cialis for cheap due to the fact that it contains lycopene which will protect you from many other types of cancer as well. Check out cialis online australia Best Penis Enhancement Products that are not just clinically approved and recommended by doctors but also come with extra bonuses and a complete money back guarantee. These are viagra kaufen gÓÌnstig mostly gimmickry that will only give you a temporary increase in size. An erection buy cialis using paypal relies on strong blood flow and any man with impotence is likely to have insufficient blood flow when sexually aroused.

I am acheter cialis en pharmacie sure you would agree with me male enhancement can not get any simpler than this. Men are prix cialis pharmacie becoming more aware of penis enhancement finding need of a larger penis. Most women comprar cialis en espana do care about the size of their partner. Natural exercise buy generic accutane online enhancement pills surgery enlargement penis enlargement devices are some enlargement techniques. Good quality, viagra 50mg price, patches come with extra bonuses like free access to exercise programs. Penis exercise (propecia online price) is a safe and healthy method to enlarge your manhood if you follow the proper approach and program. A good (viagra for sale ireland) diet plan might be useful in setting up the right healthy food menu plan for you. This article achat cialis 5 mg will give you an idea on some of the best tips and tricks you can use to get those few extra inches you've always wanted. Perhaps you viagra to buy uk have always felt a little uncomfortable when naked. In fact comprar viagra en vigo there is never a need for anything more. This limits achat viagra france the results you can get from them however and if you are looking for a much larger penis then you should be looking at herbal penis enlargement pills. L'arginineL'arginine is, cialis price at walmart, not a herb but a non essential amino acid; it declines with age and is responsible for many health problems.

5 inches vente viagra belgique long and 5 inches around to over 8 inches long and exactly 6 inches around. The exercises order viagra from uk will make you bigger maybe even much bigger but not overnight. Many of buy viagra online cheap the pill products advertised on TV don't really work and in fact that are nothing more than placebos however that doesn't mean all of them are not to be trusted. Fresh tomatoes (viagra sale) contain Beta Carotene which is also very effective for fighting off prostate problems. These pills viagra online cialis are designed to work on the area to improve size desire and control. Fresh tomatoes buy accutane uk contain Beta Carotene which is also very effective for fighting off prostate problems. 2 inchesMen buying viagra in canada taking part in the survey were asked to measure themselves and then report their results online. In order, purchase viagra in australia, to get dramatic results you would need to do exercises that could possibly do some damage to the penis and it is best not to go there.

And I buy dreamweaver online am not the only person who is saying this. Does this purchase microsoft office professional 2003 sound familiar to you: From one day to the next your PC runs slower than normal pop ups come out on its own you get redirected to some commercial sites surfing on the internet programs installed on your computer don't work anymore.

When the purchase xp operating system registry is cluttered this way it takes the computer longer to locate the information it needs. This is purchase xp professional key what I consider the best and safest way to remove Spyware Guard 2009. If you, buy cs4 upgrade, are interested you can check out some reviews of the top products below as well as my recommendation for the #1 cleaner on the market. You know buy windows wholesale why it's difficult to begin to learn a programming language.

While this buy windows product key is a nearly impossible task to perform manually with the right software you can do it quite quickly and easily. You may buy autocad dynamic blocks come to discover that you will have learnt a lot in a very short period of time.

If you purchase adobe distiller don't use a spyware blocker program then you leave yourself open to various risks:General slowdown of your PCStrange pop ups and advertisements out of nowhereAltering your home page or other settings on your browserExcessive memory utilization Altering registry settings or installing other spyware programsPC registry corruption (yikes time to restore. However with buy indesign cs3 mac the passage of time and the normal everyday use of your computer you may notice that the operating system no longer performs the way it used to. Before we buy microsoft project standard get to how to fix Internet Explorer freezing it is important to understand what causes it. In the buying windows 2000 process of learning do not receive blows you cant block I mean try to learn what you can accommodate it would be better to learn in short intervals of two hours maximum. There you buy windows vista license can view all the background programs running on your computer. But what buy xp license key happens over time is that because of the dynamic nature of our computers the new programs we install the old programs we remove the updates and upgrades etc. Perhaps you buy acrobat 9 pro have to reboot your computer before one of your programs will work correctly or your computer runs extremely slowly. Well save buy adobe photoshop 5.5 your money. But what (buy microsoft windows xp online) happens over time is that because of the dynamic nature of our computers the new programs we install the old programs we remove the updates and upgrades etc. Make sure buy windows vista enterprise that the software you download is able to optimize and condense the registry so that it is running as efficiently as possible. That is buy office 2007 key actually the main reason why projects get delayed because team members that work on certain parts of the projects unintentionally affect what the others are doing. Before you purchase windows xp operating system buy a new CPU or spend hundreds on upgrades try these three things first. Of course buy windows vista amazon having real time protection doesn't hurt either. You can buy microsoft office 2003 student do this manually or set an automatic schedule with a specific software program. You know purchase windows xp key why it's difficult to begin to learn a programming language.

The best buy win xp 64 registry cleaners will cost money but you will also be buying the assurance that the company producing the software will use their profits to make sure the registry cleaner is regularly updated. It can buy microsoft office professional 2007 full version also be the cause of error messages. If the buy adobe acrobat australia problem is not running too many programs at once then your computer freezing is related to errors in the Windows registry. The registry (buy visual studio 2008 upgrade) in your computer is very important so when you clean the registry it should always be backed up. Its powerful buy microsoft word for vista and safe to use which in turn means a lot. There are buy windows server 2008 datacenter many registry cleaners available some you must buy and others are free the question of course is which registry cleaner should you choose. Would you buy microsoft windows license like to know how to remove Spyware Guard 2009. They simply buy windows vista home premium product key provide purchasers with a download link. Well you (buy adobe creative suite 3) have come to the right place. Do you buy microsoft office 2008 for vista feel like you are ready to junk the thing and get a new one. Without reservation purchase office 2007 license key I would recommend that you buy Registry Easy. Maybe you buy windows xp black already have detected a (or some) Trojan virus(es) with an antivirus program. Want to purchase vista ultimate know how to stop laptop freezes from happening. It is, buy windows xp key, always recommended that you try to stay away from free registry cleaners. Because the buy photoshop cs3 for mac software is sold online there is very little in the way of overhead expenses.

No wonder buy cheap viagra relationships do suffer a lot. Initially you viagra sale can start with performing just 5 repetitions clenching the muscle for for just 5 seconds each time and increase the number of repetitions as you get used to with these exercises.

Natural penis cheap viagra and cialis enlargement techniques will give you bigger gains than pills pumps or even surgery.

Accordingly bananas buy propecia online without prescription are effective in affecting the minds of people before having sex. Yeast infection acheter cialis en france on a man's penis can be sexually transmitted and hence force him to lead a solitary life if left untreated. Natural techniques viagra for sale nz work to elongate the ligaments in your penis and expand the capacity of the blood vessels which if done properly results in an erection that is both longer and thicker. Surgery works comprar cialis viagra by injecting a fatty implant into the penile shaft giving you an inch or two of added length but no girth. A longer buying viagra uk penis allows you to penetrate the more sensitive areas of a woman and reach nerve endings that could never be touched by a below average male penis. Are there accutane online any other benefits to natural penis enlargement Natural penis enlargement techniques also work to strengthen your PC muscles significantly which will result in harder erections increased staying power and more powerful ejaculations.

A lot acheter viagra pharmacie of studies have been done that focus on this particular method and even though results may vary between studies around 85 90% of the participants have had positive gains to report. If you viagra online vipps want to end early ejaculation as soon as TONIGHT forget about "stamina" pills penis desensitizing creams and climax control condoms. excessive Candida, cialis online rezept, activity should be kept in check by diet and lifestyle changes. Often their cialis low price partners become sexually frustrated as well. They will, viagra price usa, help some men achieve an erection but they may also cause vascular damage and blisters if used to excess. The techniques buy cialis australia rely on an ancient form of a stretching exercise that keeps constant pressure on the penile shaft causing cells and penile tissue to divide and multiply allowing the penis to hold more blood. There are, viagra prix en pharmacie, many reasons why you don't need pills or surgery. By hanging (order viagra from india) weights from your penis for hours at a time you run the real risk of doing permanent damage to the vascular structure of your penis. Most of vente viagra en france these products can be found on the internet. Yeast infection cialis cost walmart if left untreated can turn chronic. What is viagra to purchase the true most effective method for me to stop premature ejaculation as soon as tonight Do what worked for me. While these achat cialis en suisse do work they also tend to give you serious health risks like stroke heart attack and low blood pressure etc. There are viagra kaufen in mÓÌnchen course other male infertility causes. But you comprar viagra en chile must know that herbal solutions are not meant to give you an instant erection like ED drugs. Cancer treatments prix cialis pharmacie can stop sperm production temporarily or for good. In fact buy viagra online no prescription both methods are clinically proven to add penis size & help you last longer in bed. Thankfully there, achat viagra quebec, are numerous ways to take control of this weak erectile problem. They are buy cheap viagra in uk safe effective and easy to use. Damaged capillaries (can i buy viagra without a prescription) could lead to permanent impotence. Hence the buy accutane 40mg best recommend treatment for treating yeast infection in male is to resort to natural methods to cure the infection at its roots. That way cheap cialis india you know you have nothing to lose and a large impressive satisfying penis to gain. Never attempt buy propecia uk to take any medication or go under the knife as this can do you more harm than good.

Kcorrect

From NYU CCPP Wiki

Contents

General description

The code and results are described in a paper in the Astronomical Journal.

This IDL code fits very restricted spectral energy distribution models to galaxy photometry or spectra in the restframe UV, optical and near-infrared. The main purpose of the fits are for calculating K-corrections, which the code does as well. The templates it uses for the fits may also be interpreted physically, since they are based on the Bruzual-Charlot stellar evolution synthesis codes. Thus, for each fit galaxy we can provide an estimate of the stellar mass-to-light ratio.

The easiest interface to the code, if it is available to you, is the IDL code. Detailed documentation is available for all of the routines. For users of the IDL version of the code, we have special high-level routines to handle data from a number of commonly used surveys: SDSS, GALEX, 2MASS, DEEP2 and GOODS. However, the lower level IDL routines are written generally enough that one can use those routine to handle data from any survey in the restframe UV, optical, or near-infrared.

The lowest level code compiles into a shared object library callable by C, so that non-IDL users can incorporate the K-correction routines directly into their code. It is possible in principle to link the C libraries into code based on SM, TCL/Tk, or Python, and I would be interested in helping interested parties to do this.

One can imagine using the results of this code to calculate the evolution of the luminosity function, the distribution of galaxy colors, as well as to develop galaxy classification algorithms.

What's new in v4

There are three main things that are new in the latest version:

  1. The templates have been extended to work in the rest-frame ultraviolet, and still work in the optical and near infrared. In particular, our templates are consistent with data at low redshift from GALEX, SDSS, and 2MASS can be explained by our templates, and with data up to redshifts of 1.5 or 2.0 in DEEP2 and GOODS.
  2. Because they are based on unaltered stellar evolution synthesis results from Bruzual-Charlot models, the fits have a natural physical meaning and one can make physical conclusions about recent star-formation histories and stellar masses.
  3. The SDSS AB corrections have changed somewhat.
  4. I have added a bunch of higher level IDL routines to perform common tasks, like K-correcting SDSS data, GOODS data, GALEX data, DEEP2 data, and 2MASS data, in addition to taking SDSS data and simulating DEEP2 or GOODS observations at higher redshift. When possible, users should stick to these high-level routines.

The new templates were obtained using a clever algorithm called "nonnegative matrix factorization," which finds the best set of N nonnegative templates which can be linearly, nonnegatively combined to explain a set of data. Think of it as "nonnegative PCA." However, it has the advantage over PCA that you can account explicitly for the uncertainties in the data. In our case, we use a basis set for the templates which consists of predictions of stellar evolution synthesis models, but you could simply use a set of discrete delta functions if you liked. This method has a bunch of potential applications in astronomy. The code is NMF_SPARSE in idlutils.

Conditions of use

Conditions of using the code released here are to send your email address to mb144@nyu.edu, to cite Blanton et al. 2007, and to specify the version tag (eg. v4_1_4) of the code used. (You can check this in the IDL code using the k_version command). Note that a previous version of the kcorrect paper existed (Blanton et al. 2003) which you need only cite if you are using v3_2 or earlier.

Obtaining the software

First off, if you are downloading the code, please register it. Do so by sending your email address to mb144@nyu.edu. No other information is required. I want this because it will allow me to contact users in case of any improvements or bug fixes.

Note that the IDL code depends on the idlutils package. The best way to obtain the code is to simply download the latest version from this site. The tagged and released versions, from latest to earliest, are:

The earlier version is only included so that you can reproduce old results if you like. Note that there have been some usage changes. It is also possible to export tagged versions from a public CVS repository, using the CVS "export" feature, as follows (pirated this description from spectro.princeton.edu):

  • Make sure your environment uses ssh to access CVS:
CVS_RSH=ssh
export CVS_RSH
  • The first time you access the repository, create the .cvspass file (run this in your home directory):
cvs -d :pserver:anonymous@spectro.princeton.edu:/usr/local/cvsroot login
When the above asks for a password, just hit Enter.
  • After this, you can just export any version you want:
cvs -d :pserver:anonymous@spectro.princeton.edu:/usr/local/cvsroot export -r v4_1_4 kcorrect
where you can replace v4_1_4 with whatever version you want.

Please export only based on revision tag, so that we can track versions properly.

It is also possible to CVS "checkout" the latest version of the code. This is not recommended unless you want to become involved in developing kcorrect (that is, if you will want to alter the code and check it back in). Please contact me if you want to do this.

Installing the software

The code has been tested, and compiles and runs on a Red Hat 7.1 OS. Little experimentation with other operating systems has been performed. Other Linux versions should port very easily, at least. In order to compile the code follow these directions:

First, set the environmental variables. For example, in bash:

KCORRECT_DIR=/usr/local/kcorrect
PATH=$KCORRECT_DIR/bin:$PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$KCORRECT_DIR/lib
export KCORRECT_DIR
export LD_LIBRARY_PATH
IDL_PATH=$IDL_PATH:+$KCORRECT_DIR/pro

or in tcsh:

setenv KCORRECT_DIR /usr/local/kcorrect
setenv PATH $KCORRECT_DIR/bin:$PATH
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$KCORRECT_DIR/lib
setenv IDL_PATH ${IDL_PATH}:+$KCORRECT_DIR/pro

These default settings may need to be changed on your system as follows:

  1. KCORRECT_DIR: Simply substitute whatever directory you have downloaded this product into.
  2. PATH: Obviously needed to run the binaries created
  3. LD_LIBRARY_PATH: Required for the stand-alone code, so that the OS can find libkcorrect.so at runtime.
  4. IDL_PATH: Set only if you are using IDL

You probably want to put these settings in your .bashrc or .tcshrc file. EvilUPS or UPS users can just type "setup -r /usr/local/kcorrect kcorrect"

Second, type "kevilmake -k" while in $KCORRECT_DIR. Then everything should compile At this point, you should be able to open IDL and start using the utilities described below, or run the stand-alone C code.

The IDL code depends on the idlutils package.

Note that the C codes "fit_coeffs.c" and "reconstruct_maggies.c" only depend on the K-correction library; thus, you can use them as templates for incorporating the K-correction code directly into your C code, as long as you include the K-correction library. In fact, you would probably put something like "fit_coeffs.c" into your code but include the k_reconstruct_maggies() call directly inside to get the K-corrections.

There is a known problem with compiling the stand-alone C code on a Mac OS X system. See Known problems for a description.

Basic concept of obtaining K-corrections

Enlarge

I'll describe the basic idea before getting into exactly how to use the code.

If you want to convert apparent magnitudes in band R to absolute magnitudes in band Q, you need to calculate the K-correction, which is defined by the equation:

mR = MQ + DM(z) + KQR(z),

where mR is the apparent magnitude, MQ is the absolute magnitude, DM(z) is the distance modulus, accounting for the angular diameter distance and cosmological surface-brightness dimming, and KQR(z) is the K-correction. By absolute magnitude we mean: the apparent magnitude in band Q the object would have if it were observed at rest, 10 pc away, using an aperture that contains its total flux. The distance modulus accounts for the difference between an object's actual distance and 10 pc. The K-correction accounts for the fact that you observed a redshifted galaxy in band R but the absolute magnitude requires a rest-frame observation in band Q. Obviously the difference between the fluxes observed in different bandpasses is fully determined by the galaxy SED and the description of the bandpasses. See Hogg et al. (2002) for a full description of what the K-correction is.

In order to get the appropriate SED for a set of galaxy fluxes, kcorrect fits an SED which is a nonnegative linear combination of some small number of templates. The templates have been optimized to minimize the residuals between the actual galaxy fluxes and the galaxy fluxes reconstructed from the galaxy SED fit. The units of the fit spectra created are in ergs cm−2 s−1 A−1.

As an example, consider the figure below. I have taken actual spectra from the SDSS and projected them onto the g, r, and i bandpasses (since these are the ones the spectrum overlaps). Then I have run kcorrect (in this case version v3_2) and tried to reconstruct the spectrum. What kcorrect does here is to fit the nonnegative sum of three (carefully chosen) templates to the g, r, and i fluxes. The black line is the original spectrum, the red is the reconstructed. As you can see, the fit is reasonable.

I designed the code so it could calculate K-corrections from some set of observed AB bands to those same bands shifted by an arbitrary redshift, if so desired. For example, for the SDSS spectroscopic survey, most galaxies are observed near redshift 0.1; it makes sense, therefore, to K-correct to bandpasses shifted by 0.1 (ie. by a factor 1.1). This procedure minimizes errors in the estimated K-corrections, because the galaxies at z=0.1 will then have a K-correction which independent of their SEDs (and therefore their colors) and equal to −2.5log10(1+0.1). In general, for a bandpass shifted by z_0, the K-correction for a galaxy at z_0 to the observed bandpass shifted by z_0 is −2.5log10(1+z_0), independent of galaxy SED. A bandpass b shifted by redshift z is denoted zb (as in 0.1g).

The inputs to the code are used AB maggies. These are the ratio of the source to the AB standard source in each band. To relate these quantities to magnitudes, an object with total flux f in maggies has magnitude

m = − 2.5 log 10 f .

An advantage of the maggie unit system is that it is linear, and thus can when necessary accommodate negative flux estimates. Two notes:

  1. As discussed below, SDSS catalog numbers are NOT on our best guess for the AB system. A set of offsets must be applied to the magnitudes to achieve our best guess. Our high level IDL code deals with this automatically.
  2. SDSS catalog magnitudes obtained from the official survey database are luptitudes, which for reasonably bright objects are equivalent to magnitudes. While maggies are simply related to magnitudes by 10−0.4m, the conversion from luptitudes to maggies is a bit more complicated; see the description accompanying the DR2 documentation). Our high level IDL code deals with these conversions automatically.

But you may still be wondering what I mean by an "AB" magnitude. The AB system is designed such that a flat spectrum object with fν = 3631 Jy = 3.631 × 10−20 ergs cm−2 s−1 Hz−1 should have every magnitude equal to zero. The beauty of the AB system is that the uniform definition makes it convenient to synthesize AB magnitudes from theory or models. The tragic flaw is that the quality of the AB-ness of a system is very dependent on precise spectrophotometry of standards and the carefulness of the calibrators, since no objects have a flat spectrum. There is a tension between these two needs --- similar to other tensions throughout astronomy between making precise measurements and making interpretable ones.

Finally, I have also included code to calculate photometric redshifts based on the templates. This procedure is as simple as running the K-correction code at each redshift and finding that redshift which provides the best fit in the χ2 sense.

IDL routines for SDSS, GALEX, 2MASS, DEEP2, and GOODS users

The easiest interface to the code, if it is available to you, is the IDL code. The detailed documentation is available for all of the routines. The IDL code depends on the idlutils package.

The following routines exist:

  1. sdss_kcorrect: SDSS K-corrections
  2. sdss2bessell: Take SDSS ugriz fluxes and return Bessell UBVRI fluxes
  3. sdss_kphotoz: SDSS photometric redshifts
  4. galex_kcorrect: GALEX+SDSS K-corrections
  5. twomass_kcorrect: 2MASS+SDSS K-corrections
  6. gst_kcorrect: GALEX+SDSS+2MASS kcorrections
  7. deep_kcorrect: DEEP K-corrections
  8. sdss2deep: Take local SDSS observations and return fluxes which would be observed in DEEP at some given redshift.
  9. goods_kcorrect: GOODS K-corrections
  10. sdss2goods: Take local SDSS observations and return fluxes which would be observed in GOODS at some given redshift.

In all cases I have tried to make the inputs as close to the catalogs that the user might be using, and in the form of a structure passed by the user. The code calls routines like the following to handle the transformations:

  1. sdss_to_maggies
  2. galex_to_maggies
  3. twomass_to_maggies
  4. deep_to_maggies
  5. goods_to_maggies

As noted in the documentation, these routines sometimes perform corrections to the AB system (such as the small corrections for the SDSS and the transformation from the Vega system in 2MASS). Also, they tend to add small uncertainties in quadrature with all of the uncertainties in order not to overfit to possible calibration errors. Sometimes they require the Schlegel, Finkbeiner and Davis dustmaps to be correctly installed on you system. Finally, they try to recognize the usual error flags and set inverse variances to zero where appropriate. The K-correction routines do output the maggies and inverse variances they calculate in the "omaggies" and "oivar" keywords.

In the case of SDSS, I provide both calibObj structure inputs (like those used by the Princeton reductions and the NYU-VAGC) and tsObj inputs (like those used by the Data Archive Servers). I don't ever use the Catalog Archive Server but would be happy to add an input structure for people who do if you let me know what columns to assume is in it. In the meanwhile, basically anything called "Counts" in the tsObj structure corresponds to anything called "Mag" in the CAS. Note the oddity that COUNTS_MODEL corresponds to modelMag.

These K-correction and photometric redshift routines will also return absolute magnitudes (and inverse variances of the same). To do so it assumes Ωm = 0.3 and ΩΛ = 0.7 (though these can be set differently on input). Absolute magnitudes are reported minus 5log10(h) (where Ho = h*100 km/s/Mpc), with h=1 (ie, to use H0=72 km/s/Mpc one has add 5log10(.72) to the output of the code).

You will also note some outputs having to do with mass-to-light ratios and masses.

Lower-level IDL routines for K-corrections and photo-z's of arbitrary data

All the above K-correction and photometric redshift routines use the same basic engines, kcorrect and kphotoz. These routines uses SDSS filters by default but allow any type to be input. To perform K-corrections for other sets of bandpasses (say, the Bessell bandpasses or 2MASS bandpasses), look for them in $KCORRECT_DIR/data/filters and insert them in the filterlist= flag.

As an example of using kcorrect, one might do the following:


kcorrect, [1., 4.78, 10.96, 14.45, 19.05],  $
          [1100., 28., 7.7, 4.4, 2.5], $
          0.03, kcorrect, band_shift=0.1, chi2=chi2

which would take the set of maggies in the first argument, observed for a galaxy at redshift 0.03, and return the K-corrections to the ugriz magnitudes shifted by 0.1. This choice of maggies and uncertainties should return a good chi^2. Note that it is a nonnegative fit, so linear goodness of fit measures don't exactly apply.

Please note that kcorrect uses a lot of overhead (2-3 seconds worth), so if you can, use it on several thousand galaxies simultaneously at least. If you use it on each object individually (as in the example given above), you will be in trouble. If you truly cannot avoid it, then specify the extra arguments rmatrix and zvals. For example, if you run the following:


kcorrect, [1., 4.78, 10.96, 14.45, 19.05],  $
          [1100., 28., 7.7, 4.4, 2.5], $
          0.03, kcorrect, band_shift=0.1, chi2=chi2, $
          rmatrix=rmatrix, zvals=zvals
kcorrect, [1., 4.73, 11.26, 14.25, 18.85],  $
          [1100., 28., 7.7, 4.4, 2.5], $
          0.03, kcorrect, band_shift=0.1, chi2=chi2, $
          rmatrix=rmatrix, zvals=zvals

You will find that the second call takes far less time than the first, because the temporary data stored in rmatrix and zvals will not have to be regenerated. The high-level routines I discuss above all maintain common blocks which store rmatrix and zvals for you so you don't have to worry about this.

If you want to look at the fit spectrum, then specify vmatrix, lambda, and coeffs. The commands


kcorrect, [1., 4.78, 10.96, 14.45, 19.05],  $
          [1100., 28., 7.7, 4.4, 2.5], $
          0.03, kcorrect, band_shift=0.1, chi2=chi2, $
          vmatrix=vmatrix, lambda=lambda, coeffs=coeffs
plot, lambda, vmatrix#coeffs, xra=[2000., 12000.]

will plot the best fit spectrum. You can also just call k_load_vmatrix to get the templates.

If you want to project that spectrum onto a new set of bandpasses, use k_reconstruct_maggies. For example, to project back onto the SDSS bandpasses, the command


k_reconstruct_maggies, coeffs, 0.03, maggies, vmatrix=vmatrix, $
    lambda=lambda, filterlist=['sdss_u0.par', 'sdss_g0.par', $
    'sdss_r0.par', 'sdss_i0.par', 'sdss_z0.par']

will pass back the reconstruction in the array maggies. You can project onto any bandpasses you want. For example,


k_reconstruct_maggies, coeffs, 0.03, maggies, vmatrix=vmatrix, $
    lambda=lambda, filterlist=['bessell_B.par', 'bessell_V.par']
vega2ab=k_vega2ab(filterlist=['bessell_B.par', 'bessell_V.par'],/kurucz)
bessellmags=-2.5*alog10(maggies)-vega2ab
BminusV=bessellmags[0]-bessellmags[1]

will yield the Vega B-V for the best fit.

Fitting photometric redshifts just requires fitting the coefficients for a number of redshifts and minimizing the &chi2 residuals for the fits. I provide the IDL routine kphotoz to do so (similar to the kcorrect routine). For example, one might do the following:


kphotoz, [1., 4.78, 10.96, 14.45, 19.05],  $
         [1100., 28., 7.7, 4.4, 2.5], $
         photoz

Again, there is large overhead, so one-at-a-time is not the way to call kphotoz. As for kcorrect, you can avoid spending this overhead more than once either by feeding it lists of objects or as follows:


kphotoz, [1., 4.78, 10.96, 14.45, 19.05],  $
         [1100., 28., 7.7, 4.4, 2.5], $
         photoz, rmatrix=rmatrix, zvals=zvals
kphotoz, [1., 4.78, 10.96, 14.45, 19.05],  $
         [1100., 28., 7.7, 4.4, 2.5], $
         photoz, rmatrix=rmatrix, zvals=zvals

By default, kphotoz uses a very simple prior (equal to the redshift z) to push the fits away from z=0. You can turn this off with the flag /noprior, or specify your own prior using the inputs zprior (which indicates the redshift grid) and lprior (which indicates the natural log of the prior).

A piece of advice on the type of magnitudes to use for SDSS photometric redshifts. For modern versions of PHOTO (v5_4 and later) it is best to simply use the model magnitudes for all galaxies. (And indeed this is what we use in sdss_kphotoz).

Users of kcorrect v3_2 will hopefully find that I retained backwards compatibility. Please note that the calling procedure has changed since v1_16, in the sense that inputting maggies is now the default.

Other useful utilities in the IDL library

In addition to the K-correction tools, kcorrect has some other useful tools in it:

  1. k_project_filters() is a standalone IDL routine to project a spectrum onto a filter.
  2. k_smooth smooths a spectrum with a Gaussian.
  3. k_solar_magnitudes() calculates Solar absolute magnitudes in any filter.
  4. k_vega2ab() provides conversions between AB and Vega magnitudes.
  5. lf_distmod() calculates distance moduli given a redshift and cosmology.
  6. A number of useful routines (mostly starting with "lf_") exist for calculating luminosity functions.
  7. There are various pieces of code (not all written by me) for reading in certain types of data files, like Bruzual-Charlot predictions (by John Moustakas), Bruce Draine's PAH spectra, PEGASE2 predictions (by Alex Quintero), Witt-Gordon multiple-scattering dust extinction predictions, and Mappings-III style emission line fluxes.

Stand-alone C code

The C code requires a bit more attention to use. If people say they would use it if it were easier, I will improve it. In this section, I will describe the stand-alone C programs which fit for the coefficients and which calculate the reconstructed maggies. In the next section, I will briefly describe how to use the libraries within your own C code.

There are two stand-alone programs, fit_coeffs and reconstruct_maggies. fit_coeffs uses the maggies in each band to calculate the coefficients. reconstruct_maggies uses the list of coefficients (as output by fit_coeffs to reconstruct the magnitudes.

fit_coeffs has a help flag:


apeiron.[kcorrect].7 % fit_coeffs --help
Usage: cat  | fit_coeffs [--vfile vfile --lfile lfile
            --ffile ffile ]

As indicated, you would call it like


cat maggies.dat | fit_coeffs

where each line of "maggies.dat" has the form:


redshift umaggies gmaggies rmaggies imaggies zmaggies uinvvar ginvvar rinvvar iinvvar zinvvar

All of the quantities in this file are in maggies, as described above. So you have to convert the luptitudes or magnitudes --- and the inverse variances --- into maggies before calling this. (Note that the conversion to the inverse variances from the maggies and the magnitude errors is (0.4 ln(10) × maggies × magerr)-2).

From the set of maggies and errors, the code calculates a set of four coefficients which correspond to its guess about the nature of the galaxy SED. The coefficients are output to standard out in the form:


redshift coeff0 coeff1 coeff2

where the redshift is included for reasons which will be clear soon.

Once you have the coefficients, you can calculate the reconstructed maggies for a galaxy with the same SED and same total flux, observed at any redshift through a shifted bandpass, using reconstruct_maggies. The help flag for reconstruct_maggies yields


apeiron.[kcorrect].8 % reconstruct_maggies --help
Usage: cat  | reconstruct_maggies [--vfile vfile --lfile lfile
            --ffile ffile --band-shift band_shift --redshift redshift]

So you can call it like:


cat coeffs.dat | reconstruct_maggies

where coeffs.dat is in the same format as the output to fit_coeffs:


redshift coeff0 coeff1 coeff2

The optional parameter "band_shift" specifies the bandpasses to reconstruct (band_shift=0., the default, indicates to use the observed frame bandpasses). "redshift" specifies the redshift at which to observe the galaxy (by default, the input redshift is used). The output is in the form:


redshift u_rec g_rec r_rec i_rec z_rec

in the original maggy units.

To summarize with an example, if you wanted to calculate the K-corrections from the observed bandpasses to rest-frame bandpasses shifted by 0.1, you could call the code as follows:


cat $KCORRECT_DIR/test/sample.dat | fit_coeffs | reconstruct_maggies >! maggies.dat
cat $KCORRECT_DIR/test/sample.dat | fit_coeffs | reconstruct_maggies --band-shift 0.1 --redshift 0. >! maggies.z0.dat

The K-corrections are then defined by −2.5 log10(maggies/maggies.z0).

You can use the ffile option to reconstruct_maggies to specify a file which contains a list of the filters to use (by default, it uses the SDSS filters).

The stand-alone program fit_photoz works in the same way as fit_coeffs:


apeiron.[v3_1].27 % fit_photoz --help
Usage: cat  | fit_photoz [--vfile  --lfile
            --ffile  ]

As in:


cat maggies.dat | fit_photoz

where in this case each line of "maggies.dat" has the form:


umaggies gmaggies rmaggies imaggies zmaggies uinvvar ginvvar rinvvar iinvvar zinvvar

The output is again to standard out and is of the form:


photoz coeff0 coeff1 coeff2

The same rules apply here as to the IDL code: call the code for many objects at a time, or else the overhead (about 3 seconds) will kill you.

As I noted above, I have not worked very hard to make the stand-alone C code or the C library very usable, as generally speaking that would have meant replicating features in IDL and C, and I wasn't sure how many people would use the pure C versions. If there is a need to do this, I might be convinced to -- or if YOU do it, we could include your stuff in the library.

kcorrect C library

Why would you bother incorporating the K-correction code into your code at all, rather than just calculating the K-corrections once and reading in the results? Well, perhaps you have to calculate 1/Vmax, in which for each object you have to check its K-correction at (nearly) arbitrary redshifts. It is best to calculate the K-corrections on the fly in these cases, so we provide ways of doing this through a shared object libary.

For example, the stand-alone C code uses the "libkcorrect.so" library (in fact, this is *exactly* the same library which is linked into IDL). If you have this library in your LD_LIBRARY_PATH and you include the header file "kcorrect.h" (in $KCORRECT_DIR/include), your own code can call it. The best way to figure out how to use it is to read the examples in fit_coeffs.c and reconstruct_maggies.c, but I'll try to explain the essentials here.

1.First, the code has to have the basic information about the templates. You will usually be using the "default" templates in $KCORRECT_DIR/data/templates, so you will have to load in the files:

$KCORRECT_DIR/data/templates/vmatrix.default.dat
$KCORRECT_DIR/data/templates/lambda.default.dat

These files are in a special ASCII format which can be read into a "float*" variable in C using the routine k_load_ascii_table. For example:

k_load_ascii_table(&vmatrix,&ndim,&sizes,vmatrixfile);

loads in a set of data from vmatrixfile. The pointer to the data is returned in "vmatrix". The number of dimensions in the data is returned in "ndim". "sizes" is an array of size ndim giving the size of each dimension. The information in each of these files is the following:

  • lambda.default.dat: The wavelength scale covered by the templates (the *edges*, not centers, of all pixels) [NLAMBDA+1]
  • vmatrix.default.dat: The spectra spanning the SED space [NV,NLAMBDA]

2. Second, it is necessary to read in the filters. The list of filters is in the directory:

$KCORRECT_DIR/data/templates/sdss_filters.dat

This list is read by the routine "k_load_filters", which assumes all the filters are in the directory $KCORRECT_DIR/data/filters (or if KCORRECT_DIR is not set, in the current directory). This routine is called as:

k_load_filters(&filter_n,&filter_lambda,&filter_pass,&maxn,&nk,filterfile);

"nk" is the number of filters. "filter_n" is the number of points in each filter curve, "filter_lambda" is the wavelength scale of each filter, and "filter_pass" is the response curve of each filter. "maxn" is the maximum of "filter_n". This sets the indexing of "filter_lambda" and "filter_pass", so that to get the ith wavelength of the kth filter you access "filter_lambda[k*maxn+i]".

3. Third, you have to define the redshift range over which you are going to define a look-up table. I usually use 0. to 1., to be safe, with 1000 steps, using the code:

zvals=(float *) malloc(nz*sizeof(float));
for(i=0;i<nz;i++)
  zvals[i]=zmin+(zmax-zmin)*((float)i+0.5)/(float)nz;

where nz=1000, zmin=0., and zmax=1.

4. Finally, you have to define the look-up table which tabulates the projection of each basis element in the bmatrix onto each filter, at each redshift in zvals:

rmatrix=(float *) malloc(nz*nv*nk*sizeof(float));
k_projection_table(rmatrix,nk,nv,vmatrix,lambda,nl,zvals,nz,filter_n,
                   filter_lambda,filter_pass,band_shift,maxn);

One defines "nv" and "nl" based on the "sizes" returned by the k_load_ascii_table calls described above.

Once this overhead has been taken care of (and it is a significant amount of time --- a few seconds --- so only do it once!) you can use the routines k_fit_nonneg and k_reconstruct_maggies.

k_fit_nonneg is called as:

k_fit_nonneg(coeffs, rmatrix, nk, nv, zvals, nz, maggies, maggies_ivar,
            redshift, ngalaxy, tolerance, maxiter, niter, chi2,
            verbose)

The array coeffs should be of the size (nv*ngalaxy), and the coefficients are returned in it.

k_reconstruct_maggies is called as:

k_reconstruct_maggies(zvals, nz, rmatrix, nk, nv, coeffs, redshift,
                      reconstruct_maggies, ngalaxy)

where reconstruct_maggies are expressed in maggies.

The photo-z code can also be accessed through the C library libkcorrect.so. Instead of k_fit_coeffs, you will be calling k_fit_photoz, as in:

k_fit_photoz(photoz, coeffs, rmatrix, nk, nv, zprior, lprior, nprior,
             zvals, nz, maggies, maggies_ivar, ngalaxy, tolerance,
             maxiter, niter, chi2, verbose)

zprior, lprior, and nprior should contain the prior grid to use.

As I noted above, I have not worked very hard to make the stand-alone C code or the C library very usable, as generally speaking that would have meant replicating features in IDL and C, and I wasn't sure how many people would use the pure C versions. If there is a need to do this, I might be convinced to -- or if YOU do it, we could include your stuff in the library.

Filter curves

It is of course necessary to have filter responses to do any of this work. Thus, in kcorrect I have put together a fairly large library of filter curves in a homogeneous format. I have tried as far as possible to provide the provenance of all of these curves, though it has not always been possible to figure out.

The files are in a special SDSS format called FTCL described at the SDSS DR2 site. IDL code (in particular, yanny_readone()) exists in idlutils to read in such files.

It turns out that the SDSS filters do not have the responses they were designed to have, but Mamoru Doi has done the hard work of measuring them. Jim Gunn then took these, ran them through models of the telescope and the atmosphere (using an appropriately scaled model of the Palomar atmospheric model at airmass 1.3). Daniel Eisenstein deserves special mention for the extensive testing he has done on these. We have a repository of these and other curves. For kcorrect we use the SDSS files:


sdss_u0.par
sdss_g0.par
sdss_r0.par
sdss_i0.par
sdss_z0.par

The other SDSS files refer to the responses for each camcol.

Absolute calibration and its uncertainty in SDSS magnitudes

Our best estimate (from Eisenstein's work on hot white dwarfs) of the absolute calibration of SDSS data indicates that the magnitudes output by the SDSS pipeline code are not exactly on an AB system. There are offsets Delta m = m_AB - m_SDSS = [-0.036, 0.012, 0.010, 0.028, 0.040] in u, g, r, i, and z bands. Note these numbers have changed since v3_2. We have trained our templates on SDSS magnitudes corrected to this system. For the moment we recommend that the user apply these corrections to the magnitudes they are using.

In addition, we always apply minimum uncertainty of [0.05, 0.02, 0.02, 0.02, 0.03] mag in ugriz (the high level routines SDSS_KCORRECT, etc. already do so). This is because there is always an uncertainty in the calibration of any given galaxy, and we don't want the templates working super-hard to fit (say) some unrealistically small error bar in one band at the expense of the other bands.

Linear relationships between different band systems

Using this code on a number of SDSS galaxies, we have estimated the linear relationships between a number of different bandpass systems. The kcorrect paper has a table with these relationships.

Known problems

1. In v4_1_4 and earlier, Linux 64-bit boxes fail with the message:

ld -shared -o /u/rreyes/IDL/kcorrect/lib/libkcorrect.so idl_k_projection_table.o k_projection_table.o idl_k_fit_spec.o k_fit_spec.o idl_k_fit_nonneg.o k_fit_nonneg.o idl_k_fit_photoz.o k_fit_photoz.o idl_k_reconstruct_maggies.o k_reconstruct_maggies.o k_strparse.o k_yanny_readone.o k_filter_struct.o k_fileopen.o k_load_filters.o k_read_ascii_table.o k_nonneg_solve.o k_interpolate.o idl_k_binspec.o k_binspec.o k_utils.o k_qromo.o k_midpnt.o k_choldc.o k_cholsl.o k_locate.o k_brent.o k_evolve.o k_zbrent.o k_polint.o idl_lf_calc_vmax.o idl_ztoV.o idl_Vtoz.o idl_z2dm.o idl_z2t.o idl_t2z.o idl_lf_eep.o idl_lf_select_eep.o ztransform.o iterate_lf.o philike.o phierrors_lf.o gaussj.o lf_select_eep.o lf_calc_vmax.o lf_eep.o lf_eepfit.o lf_WH_interp.o lf_set_AB.o lf_sum_AB.o
ld: k_projection_table.o: relocation R_X86_64_32 against `k_midpnt' can not be used when making a shared object; recompile with -fPIC
k_projection_table.o: could not read symbols: Bad value
make[1]: *** [/u/rreyes/IDL/kcorrect/lib/libkcorrect.so] Error 1

You want to edit the Linux section of kevilmake so it reads:

	"Linux" )
		SO_EXT=so
		X_CFLAGS="-fPIC -g -Wall"
		X_FFLAGS="-ffixed-line-length-none"
		SDSS_CFLAGS=
		X_LD_FLAGS=-shared ;;

Or just use the idlutils "evilmake" utility (if you are using the IDL version of kcorrect you need idlutils installed anyway).

2. There is a known problem with compiling the stand-alone C code on a Mac OS X 10.4 system or earlier, which results in the following error message:

cc -I/Users/blanton/kcorrect/include -I/Users/blanton/kcorrect/src -g
-Wall -dy namic -O3 -DCHECK_LEAKS -o
/Users/blanton/kcorrect/bin/fit_photoz fit_photoz.c - lm
-L/Users/blanton/kcorrect/lib \ -lkcorrect ld:
/Users/blanton/kcorrect/lib/libkcorrect.dylib is input for the dynamic
link editor, is not relocatable by the static link editor again make:
*** [/Users/blanton/kcorrect/bin/fit_photoz] Error 1 make: Target
`all' not remade because of errors. 

I am honestly not really sure what causes this. The library libkcorrect.dylib is fine for importing into IDL but NOT for importing into the stand-alone C code. If you want the library to be built correctly for importing into C programs, you can uncomment the two lines in the "kevilmake" script:

#   Uncomment the following two lines to get .dylib libraries that can
#   be linked into C programs on a Mac OS X system
#		LD=libtool
#		X_LD_FLAGS="-dynamic -L/usr/lib -lc -lcc_dynamic"

In this case, the library will be fine for importing into C but no good for using from IDL. I can't make the Mac do both with a single library file. Sorry! If somebody knows how to do this, PLEASE let me know.

3. In Mac OS X 10.5 (Leopard), there occurred some changes to the gcc libraries, which require the following addition to "kevilmake" at the end of the "Darwin" section:

    if [ `uname -r | cut -c 1` == 9 ]; then
     X_LD_FLAGS="-bundle -flat_namespace -undefined suppress"
#      Uncomment the following two lines to get .dylib libraries that can
#      be linked into C programs on a Mac OS X system
#     LD=libtool
#     X_LD_FLAGS="-dynamic -L/usr/lib -lc "
   fi


4. In v3_2 and earlier, fit_coeffs sends output to stdout occasionally of the form:

ERROR: choldc failed (sum==-1.197184e+06)

which screws up the inputs to reconstruct_maggies. If this affects you, change the line in k_choldc.c:

printf("ERROR: choldc failed (sum==%e)\n",sum);

to

fprintf(stderr, "ERROR: choldc failed (sum==%e)\n",sum);

5. In versions v1_10 and earlier, the code returned K-corrections to non-AB systems (oops!). Back in those days, Ivan Baldry pointed out that kcorrect returned non-AB magnitudes when it was requested to output K-corrections to shifted bandpasses. The sense of the error was that the K-correction was missing a term of −2.5 log10 (1+z) for a bandpass shift of z_0. This error occurred independent of bandpass, color, redshift, and anything else. Thus, when interpreting magnitudes returned by kcorrect v1_10 and earlier, please apply a correction of −2.5 log10 (1+z), where z_0 is the shift of the bandpass (eg. zb is the b-band shifted by z). Luckily this only is an error in the absolute measures of magnitude; colors are unchanged, the shapes of LFs are unchanged (just shifted in magnitude), etc. Many thanks to Ivan for pointing out the error.

6. In Mac OS 10.5 and greater, and IDL v7.0.4 and greater, kcorrect only works if "idl32" is used. This is because the compilation doesn't do handle the 64-bit stuff correctly yet. We're working on a fix!

7. The twomass_*.par filter curves are off by a factor of lambda, because apparently the 2MASS web site posted energy-counting filter curves (but called them photon-counting). Will be fixed in next release.

Acknowledgements

This work was funded in part by a GALEX Archival research grant (Program 38).

Sam Roweis provided irreplaceable help in teaching me the algorithms used in this code. David Hogg tracked down many of the bandpass responses given here. Ivan Baldry was critical to debugging the code. Hewett and Warren provided a bandpass response for the bj band. Thanks to Alison Coil, Jeff Newman, and Risa Wechsler for help understand and using the DEEP2 data. Thanks to Lexi Moustakas for help using the GOODS catalog -- and the GOODS team for access to that catalog. Thanks to John Moustakas for his code for reading in Bruzual-Charlot templates.

Funding for the Sloan Digital Sky Survey (SDSS) has been provided by the Alfred P. Sloan Foundation, the Participating Institutions, the National Aeronautics and Space Administration, the National Science Foundation, the U.S. Department of Energy, the Japanese Monbukagakusho, and the Max Planck Society. The SDSS Web site is http://www.sdss.org/.

The SDSS is managed by the Astrophysical Research Consortium (ARC) for the Participating Institutions. The Participating Institutions are The University of Chicago, Fermilab, the Institute for Advanced Study, the Japan Participation Group, The Johns Hopkins University, Los Alamos National Laboratory, the Max-Planck-Institute for Astronomy (MPIA), the Max-Planck-Institute for Astrophysics (MPA), New Mexico State University, University of Pittsburgh, Princeton University, the United States Naval Observatory, and the University of Washington.

This publication makes use of data products from the Two Micron All Sky Survey, which is a joint project of the University of Massachusetts and the Infrared Processing and Analysis Center/California Institute of Technology, funded by the National Aeronautics and Space Administration and the National Science Foundation.

The Galaxy Evolution Explorer (GALEX) is a NASA Small Explorer. The mission was developed in cooperation with the Centre National d'Etudes Spatiales of France and the Korean Ministry of Science and Technology.

DEEP2 is a collaboration between UC Santa Cruz and UC Berkeley. Funding for the DEEP2 survey has been provided by NSF grant AST-0071048 and AST-0071198. (Some of) the data presented herein were obtained at the W.M. Keck Observatory, which is operated as a scientific partnership among the California Institute of Technology, the University of California and the National Aeronautics and Space Administration. The Observatory was made possible by the generous financial support of the W.M. Keck Foundation. The DEEP2 team and Keck Observatory acknowledge the very significant cultural role and reverence that the summit of Mauna Kea has always had within the indigenous Hawaiian community and appreciate the opportunity to conduct observations from this mountain.

Frequently Asked Questions

Why do I get a compilation error in K_LOAD_FILTERS?

filter_str=yanny_readone(curr_path+'/'+filterlist[i],hdr=hdr, $                                                                  ^
% Syntax error.
 At: /Applications/kcorrect/pro/utils/k_load_filters.pro, Line 70 
% 1 Compilation error(s) in module K_LOAD_FILTERS.

Because you do not have idlutils installed. Install the idlutils package (you don't need the idlspec2d or anything else described on the above web page).

kcorrect assumes h=1. How do I change that?

For calculating absolute magnitudes, kcorrect uses a Hubble constant H0 = 100h km/s/Mpc with h = 1, whereas in the actual Universe h = 0.7 or so. In order to convert the kcorrect outputs to your desired value of h you need to apply the term:

M(h) = M(h = 1) + 5log10h

In this formula M(h = 1) is the output of kcorrect and M(h) is the absolute magnitude you want. That is, for a fixed flux the actual absolute magnitudes are brighter (i.e. you have to subtract about 0.77 mag) than the kcorrect outputs, because the Hubble constant is smaller, and thus things are further away.

How can I project onto filter XXX?

; First enumerate the filters you want to project onto:
fs = ['galex_FUV.par','bessell_U.par','bessell_B.par']

; Then project the SEDs into the variable maggies
k_projection_table, maggies, vm # coeffs, lambda, redshifts, fs, zmin=0,zmax=0,nz=1

lambda, vm and coeffs come from the routine kcorrect.

redshifts & fs are from you. zmin,zmax and nz are set so that you will be given the maggies at the redshifts you specify.--Konidaris 21:57, 15 September 2006 (EDT)