<p>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.</p>
<p>To do this you can use something like <code>curl</code> (which should be included on recent builds of Windows 10 according to <a href="https://www.addictivetips.com/windows-tips/use-curl-on-windows-10/" rel="nofollow noreferrer">this website</a>; 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 <code>requests</code> library (example on how to pass form data using <code>requests</code> is <a href="https://requests.readthedocs.io/en/master/user/quickstart/#passing-parameters-in-urls" rel="nofollow noreferrer">here</a>) to do the same thing. An example using <code>curl</code> for Markarian 143 would be:</p>
<pre><code>curl https://www.cv.nrao.edu/cgi-bin/postage.pl -d &quot;Equinox=J2000&amp;PolType=I&amp;MAPROJ=SIN&amp;rotate=0.0&amp;Type=image/jpeg&amp;RA=10 26 53&amp;Dec=+62 20 11&amp;Size=1 1&amp;Cells=15 15&quot; -o postage.jpg
</code></pre>
<p>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 <code>postage.jpg</code>. You could wrap this up as part of script to insert the RA and Dec values into the <code>curl</code> 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.</p>
<p>Here's a brief setup guide for Python+astroquery on Windows 10 to allow NED queries:</p>
<ol>
<li><p>Obtain and install latest 3.10 version from <a href="https://www.python.org/downloads/windows/" rel="nofollow noreferrer">Python.org</a> - the 64bit version is generally recommended. (Selecting the option to add the <code>Python.exe</code> to the <code>PATH</code> 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)</p>
</li>
<li><p>From a Windows command prompt, setup up a virtual environment to keep things clean and separate (this assumes it has put you into the <code>C:\Users\&lt;username&gt;\</code> directory - default I think) :</p>
<p>a. <code>python -m venv .\venvs\nvss-venv</code> (I like to make all my virtualenvs in a directory (<code>venvs</code>) and name them after what they do (<code>nvss-venv</code>) but this is up to you)</p>
<p>b. Activate virtualenv with <code>.\venvs\nvss-venv\Scripts\activate.bat</code></p>
<p>c. Install Python modules: <code>pip install astroquery ipython</code> (<code>astroquery</code> will pull in the needed Astropy; <code>ipython</code> is optional but adds a much nicer command shell for exploring Python)</p>
</li>
<li><p>From the Python or IPython command line you can do (this is just the very first part from <a href="https://astroquery.readthedocs.io/en/latest/ipac/ned/ned.html" rel="nofollow noreferrer">the tutorial</a> in the <code>astroquery</code> docs - more info on tuning the query and other features there):</p>
</li>
</ol>
<pre><code>from astroquery.ipac.ned import Ned

result_table = Ned.query_object(&quot;Mrk 123&quot;)
print(result_table[('Object Name', 'RA', 'DEC')])
</code></pre>
<p>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)
<a href="https://i.sstatic.net/KQgct.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KQgct.png" alt="Ipython terminal showing the result of a NED query using python astroquery" /></a></p>

CC BY-SA 4.0
2022-06-18T18:24:17.063Z
I will try this for NVSS, can you let me know if there is any way for NED IPAC?
Mirae
CC BY-SA 4.0
2022-06-18T21:32:37.677Z
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)
astrosnapper
CC BY-SA 4.0
2022-06-19T17:42:00.197Z
Does the older version of the site which allows [batch queries](https://ned.ipac.caltech.edu/forms/gmd.html) 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](https://tinyurl.com/nedclassic). 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](https://astroquery.readthedocs.io/en/latest/ipac/ned/ned.html)
astrosnapper
CC BY-SA 4.0
2022-06-19T22:23:40.100Z
@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?
Mirae
CC BY-SA 4.0
2022-06-21T01:10:11.033Z
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.
astrosnapper
CC BY-SA 4.0
2022-06-22T02:20:13.827Z
Got it. It's of great help!
Mirae
CC BY-SA 4.0
2022-06-17T15:54:38.273Z
2022-06-21T01:07:47.360Z
2022-06-21T01:07:47.360Z
astrosnapper
<p>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 <a href="https://ned.ipac.caltech.edu/" rel="nofollow noreferrer">NED IPAC</a> and from there collect their RA, dec, and Radio flux.</p>
<p>Then I would again input these RA dec manually in <a href="https://www.cv.nrao.edu/nvss/postage.shtml" rel="nofollow noreferrer">NVSS</a> to get their image files.</p>
<p>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.</p>

<observational-astronomy><galaxy><radio-astronomy><raw-data>
Method to get data from NED IPAC and NVSS, without manually giving RA/dec input
Mirae
# Method to get data from NED IPAC and NVSS, without manually giving RA/dec input

(Asked by: username_0 on 2022-06-15)

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](https://ned.ipac.caltech.edu/) and from there collect their RA, dec, and Radio flux.

Then I would again input these RA dec manually in [NVSS](https://www.cv.nrao.edu/nvss/postage.shtml) 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.

**Tags:** observational-astronomy, galaxy, radio-astronomy, raw-data


---

## 1 answers

### Answer by username_1 on 2022-06-17. Score: 4 | Accepted answer

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](https://www.addictivetips.com/windows-tips/use-curl-on-windows-10/); 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](https://requests.readthedocs.io/en/master/user/quickstart/#passing-parameters-in-urls)) 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](https://www.python.org/downloads/windows/) - 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](https://astroquery.readthedocs.io/en/latest/ipac/ned/ned.html) 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](https://i.sstatic.net/KQgct.png)](https://i.sstatic.net/KQgct.png)

> **Comments:**
> **username_0**: I will try this for NVSS, can you let me know if there is any way for NED IPAC?  
> **username_1**: 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)  
> **username_1**: Does the older version of the site which allows [batch queries](https://ned.ipac.caltech.edu/forms/gmd.html) 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](https://tinyurl.com/nedclassic). 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](https://astroquery.readthedocs.io/en/latest/ipac/ned/ned.html)  
> **username_0**: @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?  
> **username_1**: 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.  
> **username_0**: Got it. It's of great help!  

---

