Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-5440

Offer a way to set the value of a field to a given value for all records

    Details

    • Type: Improvement
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: afw
    • Team:
      Data Release Production

      Description

      I would like a simple (one-line) way to a field of a catalog to a given value. This should work for discontiguous catalogs and flag fields (unlike the numpy interface). It should preferably work field names (not just "keys"), since the overhead for lookup occurs only once for setting all fields.

      One use case is RFC-154, where we want to set an "is star" flag field to True for all instances of a subset of a source catalog.

        Attachments

          Issue Links

            Activity

            Hide
            Parejkoj John Parejko added a comment -

            It looks like Eli Rykoff solved this problem in fgcmcal this way:

            tempCat[ccdKey][:] = ccdId
            

            I don't know if that will work for flags, and I don't know if it works with field names, but it's better than nothing.

            Show
            Parejkoj John Parejko added a comment - It looks like Eli Rykoff solved this problem in fgcmcal this way: tempCat[ccdKey][:] = ccdId I don't know if that will work for flags, and I don't know if it works with field names, but it's better than nothing.
            Hide
            jbosch Jim Bosch added a comment -

            The above won't work for flags, but it will work with field names.

            An ugly workaround for Flags is

            tmpCat[flagKey] =  np.ones_like(tmpCat[flagKey])*constantBool

             

            Show
            jbosch Jim Bosch added a comment - The above won't work for flags, but it will work with field names. An ugly workaround for Flags is tmpCat[flagKey] = np.ones_like(tmpCat[flagKey])*constantBool  

              People

              • Assignee:
                Unassigned
                Reporter:
                rowen Russell Owen
                Watchers:
                Eli Rykoff, Jim Bosch, John Parejko, John Swinbank, Russell Owen
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel