2
$\begingroup$

I am collecting the radio flux data at 1.4Ghz frequency for all 1544 Markarian Galaxies for a study. For that, I have to first put the names of these Markarian galaxies in NED IPAC and from there collect their RA, dec, and Radio flux.

Then I would again input these RA dec manually in NVSS to get their image files.

Is there a way so that I do not have to put the numbers manually but rather use one file and get the output in another file or something simpler from both sites? I am using windows 10. Please let me know.

$\endgroup$

1 Answer 1

2
$\begingroup$

Unfortunately although a lot of astronomy image/catalog services allow uploading a file of object names or coordinates to query, it seems the NVSS postage stamp server is not one of them. The only way I can see to do it is to submit the form data to the server's CGI program.

To do this you can use something like curl (which should be included on recent builds of Windows 10 according to this website; otherwise it gives instructions on how to get it) or if you are doing this as part of a bigger project, then you could use something like Python's requests library (example on how to pass form data using requests is here) to do the same thing. An example using curl for Markarian 143 would be:

curl https://www.cv.nrao.edu/cgi-bin/postage.pl -d "Equinox=J2000&PolType=I&MAPROJ=SIN&rotate=0.0&Type=image/jpeg&RA=10 26 53&Dec=+62 20 11&Size=1 1&Cells=15 15" -o postage.jpg

This passes values to all the form's fields (found from doing a 'view source' on the webpage) to the postage stamp-making CGI code and save the output in a file called postage.jpg. You could wrap this up as part of script to insert the RA and Dec values into the curl line and save the output with a per-object filename - messy but do-able. As a final note, if you going to let this rip on all 1544 galaxies, I would add a delay of a few 10s of seconds between each call as a courtesy and not blast the NVSS endpoint with requests.

Here's a brief setup guide for Python+astroquery on Windows 10 to allow NED queries:

  1. Obtain and install latest 3.10 version from Python.org - the 64bit version is generally recommended. (Selecting the option to add the Python.exe to the PATH is a good idea and makes the following commands much easier if you don't need to keep putting in the full path to python everytime)

  2. From a Windows command prompt, setup up a virtual environment to keep things clean and separate (this assumes it has put you into the C:\Users\<username>\ directory - default I think) :

    a. python -m venv .\venvs\nvss-venv (I like to make all my virtualenvs in a directory (venvs) and name them after what they do (nvss-venv) but this is up to you)

    b. Activate virtualenv with .\venvs\nvss-venv\Scripts\activate.bat

    c. Install Python modules: pip install astroquery ipython (astroquery will pull in the needed Astropy; ipython is optional but adds a much nicer command shell for exploring Python)

  3. From the Python or IPython command line you can do (this is just the very first part from the tutorial in the astroquery docs - more info on tuning the query and other features there):

from astroquery.ipac.ned import Ned

result_table = Ned.query_object("Mrk 123")
print(result_table[('Object Name', 'RA', 'DEC')])

Results are shown in the screenshot below (not sure what numpy is complaining about it, it seems to be doing that a lot with the 1.22 version) Ipython terminal showing the result of a NED query using python astroquery

$\endgroup$
6
  • $\begingroup$ I will try this for NVSS, can you let me know if there is any way for NED IPAC? $\endgroup$
    – Mirae
    Jun 18 at 18:24
  • 1
    $\begingroup$ I misunderstood that part of the question and thought that the NVSS part was the problem - I will take a look at what can be done for the IPAC part (should hopefully be easier) $\endgroup$ Jun 18 at 21:32
  • 1
    $\begingroup$ Does the older version of the site which allows batch queries provide the right things (with the right boxes ticked, based on what you want) ? I tried this for Mrk 1-4 and got these results. You could add urlencoded object names in a modified URL (up to 200-300 at a time says the form) and use curl as before. Otherwise it might be best to migrate to a scripting language like Python and use Astroquery's NED query $\endgroup$ Jun 19 at 17:42
  • $\begingroup$ @astronapper I didn't find this old website earlier, it is allowing me to separate required flux values for a list of objects. Thanks a lot. Do I need to have astropy installed, to begin with Astroquery's NED query? $\endgroup$
    – Mirae
    Jun 19 at 22:23
  • 1
    $\begingroup$ Added some setup and query instructions for Python and astroquery on Windows 10 and an example NED query - hope this helps. To answer your specific question, if you are installing astroquery via pip, then it will automatically pull in all the needed Python libraries (including astropy) for you. $\endgroup$ Jun 21 at 1:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .