<?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=PAUdm_forced_aperture_coadd</id>
	<title>PAUdm forced aperture coadd - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pwiki.pic.es/index.php?action=history&amp;feed=atom&amp;title=PAUdm_forced_aperture_coadd"/>
	<link rel="alternate" type="text/html" href="https://pwiki.pic.es/index.php?title=PAUdm_forced_aperture_coadd&amp;action=history"/>
	<updated>2026-04-26T08:42:54Z</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=PAUdm_forced_aperture_coadd&amp;diff=860&amp;oldid=prev</id>
		<title>Jcarrete: Created page with &quot;Here are the instructions to update the paudm_forced_aperture_coadd table in CosmoHub.  We write this entry after an email from Santi Serrano (subject: &quot;Fixed ZP and MEMBA Coa...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pwiki.pic.es/index.php?title=PAUdm_forced_aperture_coadd&amp;diff=860&amp;oldid=prev"/>
		<updated>2020-09-14T15:33:57Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Here are the instructions to update the paudm_forced_aperture_coadd table in CosmoHub.  We write this entry after an email from Santi Serrano (subject: &amp;quot;Fixed ZP and MEMBA Coa...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Here are the instructions to update the paudm_forced_aperture_coadd table in CosmoHub.&lt;br /&gt;
&lt;br /&gt;
We write this entry after an email from Santi Serrano (subject: &amp;quot;Fixed ZP and MEMBA Coadds now in PAUdm&amp;quot; date: 10/09/2020)&lt;br /&gt;
&lt;br /&gt;
He announced the following different MEMBA productions in PAUdm:&lt;br /&gt;
&lt;br /&gt;
* 955 - COSMOS&lt;br /&gt;
* 956 - W1&lt;br /&gt;
* 957 - W2&lt;br /&gt;
* 958 - W3&lt;br /&gt;
* 959 - W4&lt;br /&gt;
&lt;br /&gt;
Being @ui.pic.es:&lt;br /&gt;
&lt;br /&gt;
I create them in:&lt;br /&gt;
&lt;br /&gt;
    /cephfs/pic.es/astro/scratch/jcarrete/sandbox/PAU/PAU_MEMBA&lt;br /&gt;
&lt;br /&gt;
    psql -U postgres -W -h db.pau.pic.es dm -c &amp;quot;COPY (SELECT * FROM forced_aperture_coadd WHERE production_id = 955) TO stdout DELIMITER ',' CSV&amp;quot; | pv  &amp;gt; forced_aperture_coadd_production_id_955.csv&lt;br /&gt;
    psql -U postgres -W -h db.pau.pic.es dm -c &amp;quot;COPY (SELECT * FROM forced_aperture_coadd WHERE production_id = 956) TO stdout DELIMITER ',' CSV&amp;quot; | pv  &amp;gt; forced_aperture_coadd_production_id_956.csv&lt;br /&gt;
    psql -U postgres -W -h db.pau.pic.es dm -c &amp;quot;COPY (SELECT * FROM forced_aperture_coadd WHERE production_id = 957) TO stdout DELIMITER ',' CSV&amp;quot; | pv  &amp;gt; forced_aperture_coadd_production_id_957.csv&lt;br /&gt;
    psql -U postgres -W -h db.pau.pic.es dm -c &amp;quot;COPY (SELECT * FROM forced_aperture_coadd WHERE production_id = 958) TO stdout DELIMITER ',' CSV&amp;quot; | pv  &amp;gt; forced_aperture_coadd_production_id_958.csv&lt;br /&gt;
    psql -U postgres -W -h db.pau.pic.es dm -c &amp;quot;COPY (SELECT * FROM forced_aperture_coadd WHERE production_id = 959) TO stdout DELIMITER ',' CSV&amp;quot; | pv  &amp;gt; forced_aperture_coadd_production_id_959.csv&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, having the kerberos certificate of hive from beeline. CREATE PARTITIONS:&lt;br /&gt;
&lt;br /&gt;
    ALTER TABLE jcarrete.paudm_forced_aperture_coadd_csv ADD IF NOT EXISTS PARTITION(production_id=955);&lt;br /&gt;
    ALTER TABLE jcarrete.paudm_forced_aperture_coadd_csv ADD IF NOT EXISTS PARTITION(production_id=956);&lt;br /&gt;
    ALTER TABLE jcarrete.paudm_forced_aperture_coadd_csv ADD IF NOT EXISTS PARTITION(production_id=957);&lt;br /&gt;
    ALTER TABLE jcarrete.paudm_forced_aperture_coadd_csv ADD IF NOT EXISTS PARTITION(production_id=958);&lt;br /&gt;
    ALTER TABLE jcarrete.paudm_forced_aperture_coadd_csv ADD IF NOT EXISTS PARTITION(production_id=959);&lt;br /&gt;
&lt;br /&gt;
Copy files into the corresponding hdfs directories: From data.astro:&lt;br /&gt;
&lt;br /&gt;
    hdfs dfs -put /cephfs/pic.es/astro/scratch/jcarrete/sandbox/PAU/PAU_forced_aperture_coadd/forced_aperture_coadd_production_id_955.csv /user/jcarrete/data/paudm/forced_aperture_coadd/production_id\=955/forced_aperture_coadd_production_id_955.csv&lt;br /&gt;
&lt;br /&gt;
    hdfs dfs -put /cephfs/pic.es/astro/scratch/jcarrete/sandbox/PAU/PAU_forced_aperture_coadd/forced_aperture_coadd_production_id_956.csv /user/jcarrete/data/paudm/forced_aperture_coadd/production_id\=956/forced_aperture_coadd_production_id_956.csv&lt;br /&gt;
&lt;br /&gt;
    hdfs dfs -put /cephfs/pic.es/astro/scratch/jcarrete/sandbox/PAU/PAU_forced_aperture_coadd/forced_aperture_coadd_production_id_957.csv /user/jcarrete/data/paudm/forced_aperture_coadd/production_id\=957/forced_aperture_coadd_production_id_957.csv&lt;br /&gt;
&lt;br /&gt;
    hdfs dfs -put /cephfs/pic.es/astro/scratch/jcarrete/sandbox/PAU/PAU_forced_aperture_coadd/forced_aperture_coadd_production_id_958.csv /user/jcarrete/data/paudm/forced_aperture_coadd/production_id\=958/forced_aperture_coadd_production_id_958.csv&lt;br /&gt;
&lt;br /&gt;
    hdfs dfs -put /cephfs/pic.es/astro/scratch/jcarrete/sandbox/PAU/PAU_forced_aperture_coadd/forced_aperture_coadd_production_id_959.csv /user/jcarrete/data/paudm/forced_aperture_coadd/production_id\=959/forced_aperture_coadd_production_id_959.csv&lt;br /&gt;
&lt;br /&gt;
From beeline:&lt;br /&gt;
&lt;br /&gt;
    INSERT OVERWRITE TABLE cosmohub.paudm_forced_aperture_coadd PARTITION (production_id=955)&lt;br /&gt;
    SELECT `ref_id`, `band`, `flux`, `flux_error`, `chi2`, `n_coadd`, `run`&lt;br /&gt;
    FROM jcarrete.paudm_forced_aperture_coadd_csv&lt;br /&gt;
    WHERE ref_id IS NOT NULL &lt;br /&gt;
    AND production_id = 955;&lt;br /&gt;
&lt;br /&gt;
    INSERT OVERWRITE TABLE cosmohub.paudm_forced_aperture_coadd PARTITION (production_id=956)&lt;br /&gt;
    SELECT `ref_id`, `band`, `flux`, `flux_error`, `chi2`, `n_coadd`, `run`&lt;br /&gt;
    FROM jcarrete.paudm_forced_aperture_coadd_csv&lt;br /&gt;
    WHERE ref_id IS NOT NULL &lt;br /&gt;
    AND production_id = 956;&lt;br /&gt;
&lt;br /&gt;
    INSERT OVERWRITE TABLE cosmohub.paudm_forced_aperture_coadd PARTITION (production_id=957)&lt;br /&gt;
    SELECT `ref_id`, `band`, `flux`, `flux_error`, `chi2`, `n_coadd`, `run`&lt;br /&gt;
    FROM jcarrete.paudm_forced_aperture_coadd_csv&lt;br /&gt;
    WHERE ref_id IS NOT NULL &lt;br /&gt;
    AND production_id = 957;&lt;br /&gt;
&lt;br /&gt;
    INSERT OVERWRITE TABLE cosmohub.paudm_forced_aperture_coadd PARTITION (production_id=958)&lt;br /&gt;
    SELECT `ref_id`, `band`, `flux`, `flux_error`, `chi2`, `n_coadd`, `run`&lt;br /&gt;
    FROM jcarrete.paudm_forced_aperture_coadd_csv&lt;br /&gt;
    WHERE ref_id IS NOT NULL &lt;br /&gt;
    AND production_id = 958;&lt;br /&gt;
&lt;br /&gt;
    INSERT OVERWRITE TABLE cosmohub.paudm_forced_aperture_coadd PARTITION (production_id=959)&lt;br /&gt;
    SELECT `ref_id`, `band`, `flux`, `flux_error`, `chi2`, `n_coadd`, `run`&lt;br /&gt;
    FROM jcarrete.paudm_forced_aperture_coadd_csv&lt;br /&gt;
    WHERE ref_id IS NOT NULL &lt;br /&gt;
    AND production_id = 959;&lt;br /&gt;
&lt;br /&gt;
Estimating statistics for the different partitions:&lt;br /&gt;
&lt;br /&gt;
    ANALYZE TABLE cosmohub.paudm_forced_aperture_coadd PARTITION(production_id=955) COMPUTE STATISTICS FOR COLUMNS;&lt;br /&gt;
    ANALYZE TABLE cosmohub.paudm_forced_aperture_coadd PARTITION(production_id=956) COMPUTE STATISTICS FOR COLUMNS;&lt;br /&gt;
    ANALYZE TABLE cosmohub.paudm_forced_aperture_coadd PARTITION(production_id=957) COMPUTE STATISTICS FOR COLUMNS;&lt;br /&gt;
    ANALYZE TABLE cosmohub.paudm_forced_aperture_coadd PARTITION(production_id=958) COMPUTE STATISTICS FOR COLUMNS;&lt;br /&gt;
    ANALYZE TABLE cosmohub.paudm_forced_aperture_coadd PARTITION(production_id=959) COMPUTE STATISTICS FOR COLUMNS;&lt;/div&gt;</summary>
		<author><name>Jcarrete</name></author>
	</entry>
</feed>