<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://pwiki.pic.es/index.php?action=history&amp;feed=atom&amp;title=PAUS-photoz_bcnz_v36</id>
	<title>PAUS-photoz bcnz v36 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pwiki.pic.es/index.php?action=history&amp;feed=atom&amp;title=PAUS-photoz_bcnz_v36"/>
	<link rel="alternate" type="text/html" href="https://pwiki.pic.es/index.php?title=PAUS-photoz_bcnz_v36&amp;action=history"/>
	<updated>2026-04-20T15:11:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://pwiki.pic.es/index.php?title=PAUS-photoz_bcnz_v36&amp;diff=597&amp;oldid=prev</id>
		<title>Jcarrete at 13:00, 6 February 2020</title>
		<link rel="alternate" type="text/html" href="https://pwiki.pic.es/index.php?title=PAUS-photoz_bcnz_v36&amp;diff=597&amp;oldid=prev"/>
		<updated>2020-02-06T13:00:59Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:00, 6 February 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l18&quot; &gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;3. Ingest into paudb:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;3. Ingest into paudb:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tail -n +2 filename.csv | awk -F, '{print 866,$6,$7,$4,$5,$8,$1,$3,$2}' | tr ' ' ',' &amp;gt; filename_reordered.csv&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I assume I have a CSV (comma separated value) file with header, and with the fields are ordered in the same way as in the database model:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I assume I have a CSV (comma separated value) file with header, and with the fields are ordered in the same way as in the database model:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;tail -n +2 filename.csv | pv -l | psql -U postgres -h &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;db01&lt;/del&gt;.pau.pic.es dm - c &amp;quot;COPY &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;paudm.&lt;/del&gt;photoz_bcnz FROM STDIN DELIMITER ',' CSV&amp;quot;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Once the csv is created&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;    &lt;/ins&gt;tail -n +2 filename.csv | pv -l | psql -U postgres -h &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;db&lt;/ins&gt;.pau.pic.es dm -c &amp;quot;COPY photoz_bcnz FROM STDIN DELIMITER ',' CSV&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Jcarrete</name></author>
	</entry>
	<entry>
		<id>https://pwiki.pic.es/index.php?title=PAUS-photoz_bcnz_v36&amp;diff=596&amp;oldid=prev</id>
		<title>Jcarrete: Created page with &quot;'''This is the way we ingest PAUS photo-z releases in CosmoHub and PAUdb'''  This is the case for file:      /nfs/astro/eriksen/kcorr/bcnz_v36.parquet  1. Create a new product...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pwiki.pic.es/index.php?title=PAUS-photoz_bcnz_v36&amp;diff=596&amp;oldid=prev"/>
		<updated>2020-02-06T13:00:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;This is the way we ingest PAUS photo-z releases in CosmoHub and PAUdb&amp;#039;&amp;#039;&amp;#039;  This is the case for file:      /nfs/astro/eriksen/kcorr/bcnz_v36.parquet  1. Create a new product...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''This is the way we ingest PAUS photo-z releases in CosmoHub and PAUdb'''&lt;br /&gt;
&lt;br /&gt;
This is the case for file:&lt;br /&gt;
&lt;br /&gt;
    /nfs/astro/eriksen/kcorr/bcnz_v36.parquet&lt;br /&gt;
&lt;br /&gt;
1. Create a new production in the db.pau.pic.es in the production table.&lt;br /&gt;
&lt;br /&gt;
In this case we create production = 953, with input_production_id = 944. Some more information is needed.&lt;br /&gt;
&lt;br /&gt;
2. There is a python notebook:&lt;br /&gt;
&lt;br /&gt;
    /nfs/user/j/jcarrete/python_notebooks/PAUdm photoz parquet files.ipynb&lt;br /&gt;
&lt;br /&gt;
Where we convert the super large parquet file with many fields into a csv fields with the needed fields:&lt;br /&gt;
&lt;br /&gt;
    /cephfs/pic.es/astro/scratch/jcarrete/sandbox/parquet_bcnz_v36_some_fields.csv&lt;br /&gt;
&lt;br /&gt;
3. Ingest into paudb:&lt;br /&gt;
&lt;br /&gt;
tail -n +2 filename.csv | awk -F, '{print 866,$6,$7,$4,$5,$8,$1,$3,$2}' | tr ' ' ',' &amp;gt; filename_reordered.csv&lt;br /&gt;
&lt;br /&gt;
I assume I have a CSV (comma separated value) file with header, and with the fields are ordered in the same way as in the database model:&lt;br /&gt;
&lt;br /&gt;
tail -n +2 filename.csv | pv -l | psql -U postgres -h db01.pau.pic.es dm - c &amp;quot;COPY paudm.photoz_bcnz FROM STDIN DELIMITER ',' CSV&amp;quot;Once the csv is created&lt;/div&gt;</summary>
		<author><name>Jcarrete</name></author>
	</entry>
</feed>